Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java +16 −10 Original line number Diff line number Diff line Loading @@ -155,8 +155,8 @@ public class A2dpProfile implements LocalBluetoothProfile { 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); if (mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return mService.disconnect(device); } Loading @@ -179,23 +179,29 @@ public class A2dpProfile implements LocalBluetoothProfile { } public boolean isPreferred(BluetoothDevice device) { if (mService == null) return false; return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; if (mService == null) { return false; } return mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } public int getPreferred(BluetoothDevice device) { if (mService == null) return BluetoothProfile.PRIORITY_OFF; return mService.getPriority(device); if (mService == null) { return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } return mService.getConnectionPolicy(device); } public void setPreferred(BluetoothDevice device, boolean preferred) { if (mService == null) return; if (mService == null) { return; } if (preferred) { if (mService.getPriority(device) < BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) < BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } } else { mService.setPriority(device, BluetoothProfile.PRIORITY_OFF); mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN); } } boolean isA2dpPlaying() { Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpSinkProfile.java +8 −8 Original line number Diff line number Diff line Loading @@ -124,8 +124,8 @@ final class A2dpSinkProfile implements LocalBluetoothProfile { return false; } // Downgrade priority as user is disconnecting the headset. if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return mService.disconnect(device); } Loading @@ -141,14 +141,14 @@ final class A2dpSinkProfile implements LocalBluetoothProfile { if (mService == null) { return false; } return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; return mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } public int getPreferred(BluetoothDevice device) { if (mService == null) { return BluetoothProfile.PRIORITY_OFF; return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } return mService.getPriority(device); return mService.getConnectionPolicy(device); } public void setPreferred(BluetoothDevice device, boolean preferred) { Loading @@ -156,11 +156,11 @@ final class A2dpSinkProfile implements LocalBluetoothProfile { return; } if (preferred) { if (mService.getPriority(device) < BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) < BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } } else { mService.setPriority(device, BluetoothProfile.PRIORITY_OFF); mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN); } } Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/HeadsetProfile.java +8 −8 Original line number Diff line number Diff line Loading @@ -120,8 +120,8 @@ public class HeadsetProfile implements LocalBluetoothProfile { return false; } // Downgrade priority as user is disconnecting the headset. if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return mService.disconnect(device); } Loading Loading @@ -165,14 +165,14 @@ public class HeadsetProfile implements LocalBluetoothProfile { if (mService == null) { return false; } return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; return mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } public int getPreferred(BluetoothDevice device) { if (mService == null) { return BluetoothProfile.PRIORITY_OFF; return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } return mService.getPriority(device); return mService.getConnectionPolicy(device); } public void setPreferred(BluetoothDevice device, boolean preferred) { Loading @@ -180,11 +180,11 @@ public class HeadsetProfile implements LocalBluetoothProfile { return; } if (preferred) { if (mService.getPriority(device) < BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) < BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } } else { mService.setPriority(device, BluetoothProfile.PRIORITY_OFF); mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN); } } Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java +16 −10 Original line number Diff line number Diff line Loading @@ -153,8 +153,8 @@ public class HearingAidProfile implements LocalBluetoothProfile { public boolean disconnect(BluetoothDevice device) { if (mService == null) return false; // Downgrade priority as user is disconnecting the hearing aid. if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON){ mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return mService.disconnect(device); } Loading @@ -177,23 +177,29 @@ public class HearingAidProfile implements LocalBluetoothProfile { } public boolean isPreferred(BluetoothDevice device) { if (mService == null) return false; return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; if (mService == null) { return false; } return mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } public int getPreferred(BluetoothDevice device) { if (mService == null) return BluetoothProfile.PRIORITY_OFF; return mService.getPriority(device); if (mService == null) { return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } return mService.getConnectionPolicy(device); } public void setPreferred(BluetoothDevice device, boolean preferred) { if (mService == null) return; if (mService == null) { return; } if (preferred) { if (mService.getPriority(device) < BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) < BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } } else { mService.setPriority(device, BluetoothProfile.PRIORITY_OFF); mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN); } } Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/HfpClientProfile.java +8 −8 Original line number Diff line number Diff line Loading @@ -135,8 +135,8 @@ final class HfpClientProfile implements LocalBluetoothProfile { return false; } // Downgrade priority as user is disconnecting the headset. if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON){ mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return mService.disconnect(device); } Loading @@ -154,15 +154,15 @@ final class HfpClientProfile implements LocalBluetoothProfile { if (mService == null) { return false; } return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; return mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } @Override public int getPreferred(BluetoothDevice device) { if (mService == null) { return BluetoothProfile.PRIORITY_OFF; return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } return mService.getPriority(device); return mService.getConnectionPolicy(device); } @Override Loading @@ -171,11 +171,11 @@ final class HfpClientProfile implements LocalBluetoothProfile { return; } if (preferred) { if (mService.getPriority(device) < BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) < BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } } else { mService.setPriority(device, BluetoothProfile.PRIORITY_OFF); mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN); } } Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java +16 −10 Original line number Diff line number Diff line Loading @@ -155,8 +155,8 @@ public class A2dpProfile implements LocalBluetoothProfile { 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); if (mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return mService.disconnect(device); } Loading @@ -179,23 +179,29 @@ public class A2dpProfile implements LocalBluetoothProfile { } public boolean isPreferred(BluetoothDevice device) { if (mService == null) return false; return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; if (mService == null) { return false; } return mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } public int getPreferred(BluetoothDevice device) { if (mService == null) return BluetoothProfile.PRIORITY_OFF; return mService.getPriority(device); if (mService == null) { return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } return mService.getConnectionPolicy(device); } public void setPreferred(BluetoothDevice device, boolean preferred) { if (mService == null) return; if (mService == null) { return; } if (preferred) { if (mService.getPriority(device) < BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) < BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } } else { mService.setPriority(device, BluetoothProfile.PRIORITY_OFF); mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN); } } boolean isA2dpPlaying() { Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpSinkProfile.java +8 −8 Original line number Diff line number Diff line Loading @@ -124,8 +124,8 @@ final class A2dpSinkProfile implements LocalBluetoothProfile { return false; } // Downgrade priority as user is disconnecting the headset. if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return mService.disconnect(device); } Loading @@ -141,14 +141,14 @@ final class A2dpSinkProfile implements LocalBluetoothProfile { if (mService == null) { return false; } return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; return mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } public int getPreferred(BluetoothDevice device) { if (mService == null) { return BluetoothProfile.PRIORITY_OFF; return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } return mService.getPriority(device); return mService.getConnectionPolicy(device); } public void setPreferred(BluetoothDevice device, boolean preferred) { Loading @@ -156,11 +156,11 @@ final class A2dpSinkProfile implements LocalBluetoothProfile { return; } if (preferred) { if (mService.getPriority(device) < BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) < BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } } else { mService.setPriority(device, BluetoothProfile.PRIORITY_OFF); mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN); } } Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/HeadsetProfile.java +8 −8 Original line number Diff line number Diff line Loading @@ -120,8 +120,8 @@ public class HeadsetProfile implements LocalBluetoothProfile { return false; } // Downgrade priority as user is disconnecting the headset. if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return mService.disconnect(device); } Loading Loading @@ -165,14 +165,14 @@ public class HeadsetProfile implements LocalBluetoothProfile { if (mService == null) { return false; } return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; return mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } public int getPreferred(BluetoothDevice device) { if (mService == null) { return BluetoothProfile.PRIORITY_OFF; return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } return mService.getPriority(device); return mService.getConnectionPolicy(device); } public void setPreferred(BluetoothDevice device, boolean preferred) { Loading @@ -180,11 +180,11 @@ public class HeadsetProfile implements LocalBluetoothProfile { return; } if (preferred) { if (mService.getPriority(device) < BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) < BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } } else { mService.setPriority(device, BluetoothProfile.PRIORITY_OFF); mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN); } } Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java +16 −10 Original line number Diff line number Diff line Loading @@ -153,8 +153,8 @@ public class HearingAidProfile implements LocalBluetoothProfile { public boolean disconnect(BluetoothDevice device) { if (mService == null) return false; // Downgrade priority as user is disconnecting the hearing aid. if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON){ mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return mService.disconnect(device); } Loading @@ -177,23 +177,29 @@ public class HearingAidProfile implements LocalBluetoothProfile { } public boolean isPreferred(BluetoothDevice device) { if (mService == null) return false; return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; if (mService == null) { return false; } return mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } public int getPreferred(BluetoothDevice device) { if (mService == null) return BluetoothProfile.PRIORITY_OFF; return mService.getPriority(device); if (mService == null) { return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } return mService.getConnectionPolicy(device); } public void setPreferred(BluetoothDevice device, boolean preferred) { if (mService == null) return; if (mService == null) { return; } if (preferred) { if (mService.getPriority(device) < BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) < BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } } else { mService.setPriority(device, BluetoothProfile.PRIORITY_OFF); mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN); } } Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/HfpClientProfile.java +8 −8 Original line number Diff line number Diff line Loading @@ -135,8 +135,8 @@ final class HfpClientProfile implements LocalBluetoothProfile { return false; } // Downgrade priority as user is disconnecting the headset. if (mService.getPriority(device) > BluetoothProfile.PRIORITY_ON){ mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return mService.disconnect(device); } Loading @@ -154,15 +154,15 @@ final class HfpClientProfile implements LocalBluetoothProfile { if (mService == null) { return false; } return mService.getPriority(device) > BluetoothProfile.PRIORITY_OFF; return mService.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } @Override public int getPreferred(BluetoothDevice device) { if (mService == null) { return BluetoothProfile.PRIORITY_OFF; return BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; } return mService.getPriority(device); return mService.getConnectionPolicy(device); } @Override Loading @@ -171,11 +171,11 @@ final class HfpClientProfile implements LocalBluetoothProfile { return; } if (preferred) { if (mService.getPriority(device) < BluetoothProfile.PRIORITY_ON) { mService.setPriority(device, BluetoothProfile.PRIORITY_ON); if (mService.getConnectionPolicy(device) < BluetoothProfile.CONNECTION_POLICY_ALLOWED) { mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } } else { mService.setPriority(device, BluetoothProfile.PRIORITY_OFF); mService.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_FORBIDDEN); } } Loading