Exemplo n.º 1
0
 public boolean disconnect(BluetoothDevice device) {
   if (mService == null) return false;
   // Downgrade priority as user is disconnecting the headset.
   if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON) {
     mService.setPriority(device, BluetoothProfile.PRIORITY_ON);
   }
   return mService.disconnect(device);
 }
Exemplo n.º 2
0
 public void setPreferred(BluetoothDevice device, boolean preferred) {
   if (mService == null) return;
   if (preferred) {
     if (mService.getPriority(device) < BluetoothProfile.PRIORITY_ON) {
       mService.setPriority(device, BluetoothProfile.PRIORITY_ON);
     }
   } else {
     mService.setPriority(device, BluetoothProfile.PRIORITY_OFF);
   }
 }
Exemplo n.º 3
0
 public int getPreferred(BluetoothDevice device) {
   if (mService == null) return BluetoothProfile.PRIORITY_OFF;
   return mService.getPriority(device);
 }
Exemplo n.º 4
0
 public boolean isPreferred(BluetoothDevice device) {
   if (mService == null) return false;
   return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF;
 }