Code example for BluetoothAdapter

Methods: getScanMode

0
      } 
  }; 
     
    private void ensureDiscoverable() { 
        if(D) Log.d(TAG, "ensure discoverable");
        if (mAdapter.getScanMode() !=
            BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {
            Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
            discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 0);
            startActivity(discoverableIntent);
            mState=STATE_DISC;
        } 
    } 
     
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if(D) Log.d(TAG, "onActivityResult " + resultCode);
        if(requestCode ==REQUEST_TIMESTAMP){
        	if (resultCode == Activity.RESULT_OK) {
        		mState=STATE_Synchrony;
                Synchrony(data);
            } else {