Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +1 −9 Original line number Diff line number Diff line Loading @@ -243,14 +243,6 @@ public class AdapterService extends Service { private static final int CONTROLLER_ENERGY_UPDATE_TIMEOUT_MILLIS = 30; /** * Connection state bitmask as returned by getConnectionState. */ public static final int CONNECTION_STATE_DISCONNECTED = 0; public static final int CONNECTION_STATE_CONNECTED = 1; public static final int CONNECTION_STATE_ENCRYPTED_BREDR = 2; public static final int CONNECTION_STATE_ENCRYPTED_LE = 4; // Report ID definition public enum BqrQualityReportId { QUALITY_REPORT_ID_MONITOR_MODE(0x01), Loading Loading @@ -2948,7 +2940,7 @@ public class AdapterService extends Service { if (service == null || !Utils.checkConnectPermissionForDataDelivery( service, attributionSource, "AdapterService getConnectionState")) { return CONNECTION_STATE_DISCONNECTED; return BluetoothDevice.CONNECTION_STATE_DISCONNECTED; } return service.getConnectionState(device); Loading android/app/src/com/android/bluetooth/btservice/PhonePolicy.java +1 −1 Original line number Diff line number Diff line Loading @@ -654,7 +654,7 @@ class PhonePolicy implements AdapterService.BluetoothStateCallback { /* Make sure that device is still connected before connecting other profiles */ if (mAdapterService.getConnectionState(device) == AdapterService.CONNECTION_STATE_DISCONNECTED) { == BluetoothDevice.CONNECTION_STATE_DISCONNECTED) { debugLog("processConnectOtherProfiles: device is not connected anymore " + device); return; } Loading android/app/tests/unit/src/com/android/bluetooth/btservice/PhonePolicyTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -462,7 +462,7 @@ public class PhonePolicyTest { // ACL is connected, lets simulate this. when(mAdapterService.getConnectionState(bondedDevices[0])) .thenReturn(AdapterService.CONNECTION_STATE_ENCRYPTED_BREDR); .thenReturn(BluetoothDevice.CONNECTION_STATE_ENCRYPTED_BREDR); // We send a connection successful for one profile since the re-connect *only* works if we // have already connected successfully over one of the profiles Loading Loading @@ -507,7 +507,7 @@ public class PhonePolicyTest { // ACL is disconnected just after HEADSET profile got connected and connectOtherProfile // was scheduled. Lets simulate this. when(mAdapterService.getConnectionState(bondedDevices[0])) .thenReturn(AdapterService.CONNECTION_STATE_DISCONNECTED); .thenReturn(BluetoothDevice.CONNECTION_STATE_DISCONNECTED); // We send a connection successful for one profile since the re-connect *only* works if we // have already connected successfully over one of the profiles Loading framework/java/android/bluetooth/BluetoothDevice.java +22 −5 Original line number Diff line number Diff line Loading @@ -99,12 +99,29 @@ public final class BluetoothDevice implements Parcelable, Attributable { private static final boolean DBG = false; /** * Connection state bitmask as returned by getConnectionState. * Connection state bitmask disconnected bit as returned by getConnectionState. * * @hide */ public static final int CONNECTION_STATE_DISCONNECTED = 0; /** * Connection state bitmask connected bit as returned by getConnectionState. * * @hide */ public static final int CONNECTION_STATE_CONNECTED = 1; /** * Connection state bitmask encrypted BREDR bit as returned by getConnectionState. * * @hide */ public static final int CONNECTION_STATE_ENCRYPTED_BREDR = 2; /** * Connection state bitmask encrypted LE bit as returned by getConnectionState. * * @hide */ private static final int CONNECTION_STATE_DISCONNECTED = 0; private static final int CONNECTION_STATE_CONNECTED = 1; private static final int CONNECTION_STATE_ENCRYPTED_BREDR = 2; private static final int CONNECTION_STATE_ENCRYPTED_LE = 4; public static final int CONNECTION_STATE_ENCRYPTED_LE = 4; /** * Sentinel error value for this class. Guaranteed to not equal any other Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +1 −9 Original line number Diff line number Diff line Loading @@ -243,14 +243,6 @@ public class AdapterService extends Service { private static final int CONTROLLER_ENERGY_UPDATE_TIMEOUT_MILLIS = 30; /** * Connection state bitmask as returned by getConnectionState. */ public static final int CONNECTION_STATE_DISCONNECTED = 0; public static final int CONNECTION_STATE_CONNECTED = 1; public static final int CONNECTION_STATE_ENCRYPTED_BREDR = 2; public static final int CONNECTION_STATE_ENCRYPTED_LE = 4; // Report ID definition public enum BqrQualityReportId { QUALITY_REPORT_ID_MONITOR_MODE(0x01), Loading Loading @@ -2948,7 +2940,7 @@ public class AdapterService extends Service { if (service == null || !Utils.checkConnectPermissionForDataDelivery( service, attributionSource, "AdapterService getConnectionState")) { return CONNECTION_STATE_DISCONNECTED; return BluetoothDevice.CONNECTION_STATE_DISCONNECTED; } return service.getConnectionState(device); Loading
android/app/src/com/android/bluetooth/btservice/PhonePolicy.java +1 −1 Original line number Diff line number Diff line Loading @@ -654,7 +654,7 @@ class PhonePolicy implements AdapterService.BluetoothStateCallback { /* Make sure that device is still connected before connecting other profiles */ if (mAdapterService.getConnectionState(device) == AdapterService.CONNECTION_STATE_DISCONNECTED) { == BluetoothDevice.CONNECTION_STATE_DISCONNECTED) { debugLog("processConnectOtherProfiles: device is not connected anymore " + device); return; } Loading
android/app/tests/unit/src/com/android/bluetooth/btservice/PhonePolicyTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -462,7 +462,7 @@ public class PhonePolicyTest { // ACL is connected, lets simulate this. when(mAdapterService.getConnectionState(bondedDevices[0])) .thenReturn(AdapterService.CONNECTION_STATE_ENCRYPTED_BREDR); .thenReturn(BluetoothDevice.CONNECTION_STATE_ENCRYPTED_BREDR); // We send a connection successful for one profile since the re-connect *only* works if we // have already connected successfully over one of the profiles Loading Loading @@ -507,7 +507,7 @@ public class PhonePolicyTest { // ACL is disconnected just after HEADSET profile got connected and connectOtherProfile // was scheduled. Lets simulate this. when(mAdapterService.getConnectionState(bondedDevices[0])) .thenReturn(AdapterService.CONNECTION_STATE_DISCONNECTED); .thenReturn(BluetoothDevice.CONNECTION_STATE_DISCONNECTED); // We send a connection successful for one profile since the re-connect *only* works if we // have already connected successfully over one of the profiles Loading
framework/java/android/bluetooth/BluetoothDevice.java +22 −5 Original line number Diff line number Diff line Loading @@ -99,12 +99,29 @@ public final class BluetoothDevice implements Parcelable, Attributable { private static final boolean DBG = false; /** * Connection state bitmask as returned by getConnectionState. * Connection state bitmask disconnected bit as returned by getConnectionState. * * @hide */ public static final int CONNECTION_STATE_DISCONNECTED = 0; /** * Connection state bitmask connected bit as returned by getConnectionState. * * @hide */ public static final int CONNECTION_STATE_CONNECTED = 1; /** * Connection state bitmask encrypted BREDR bit as returned by getConnectionState. * * @hide */ public static final int CONNECTION_STATE_ENCRYPTED_BREDR = 2; /** * Connection state bitmask encrypted LE bit as returned by getConnectionState. * * @hide */ private static final int CONNECTION_STATE_DISCONNECTED = 0; private static final int CONNECTION_STATE_CONNECTED = 1; private static final int CONNECTION_STATE_ENCRYPTED_BREDR = 2; private static final int CONNECTION_STATE_ENCRYPTED_LE = 4; public static final int CONNECTION_STATE_ENCRYPTED_LE = 4; /** * Sentinel error value for this class. Guaranteed to not equal any other Loading