Loading android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +6 −0 Original line number Diff line number Diff line Loading @@ -639,6 +639,12 @@ final class RemoteDevices { * @param isCoordinatedSetMember the mIsCoordinatedSetMember to set */ void setIsCoordinatedSetMember(boolean isCoordinatedSetMember) { if ((mAdapterService.getSupportedProfilesBitMask() & (1 << BluetoothProfile.CSIP_SET_COORDINATOR)) == 0) { debugLog("CSIP is not supported"); return; } synchronized (mObject) { this.mIsCoordinatedSetMember = isCoordinatedSetMember; } Loading android/app/tests/unit/src/com/android/bluetooth/btservice/RemoteDevicesTest.java +32 −0 Original line number Diff line number Diff line Loading @@ -635,6 +635,38 @@ public class RemoteDevicesTest { .getHfAudioPolicyForRemoteAg()); } @Test public void testIsCoordinatedSetMemberAsLeAudioEnabled() { doReturn((long) (1 << BluetoothProfile.CSIP_SET_COORDINATOR)) .when(mAdapterService) .getSupportedProfilesBitMask(); // Verify that device property is null initially Assert.assertNull(mRemoteDevices.getDeviceProperties(mDevice1)); mRemoteDevices.addDeviceProperties(Utils.getBytesFromAddress(TEST_BT_ADDR_1)); DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(mDevice1); deviceProp.setIsCoordinatedSetMember(true); Assert.assertTrue(deviceProp.isCoordinatedSetMember()); } @Test public void testIsCoordinatedSetMemberAsLeAudioDisabled() { doReturn((long) (0 << BluetoothProfile.CSIP_SET_COORDINATOR)) .when(mAdapterService) .getSupportedProfilesBitMask(); // Verify that device property is null initially Assert.assertNull(mRemoteDevices.getDeviceProperties(mDevice1)); mRemoteDevices.addDeviceProperties(Utils.getBytesFromAddress(TEST_BT_ADDR_1)); DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(mDevice1); deviceProp.setIsCoordinatedSetMember(true); Assert.assertFalse(deviceProp.isCoordinatedSetMember()); } private static void verifyBatteryLevelChangedIntent(BluetoothDevice device, int batteryLevel, ArgumentCaptor<Intent> intentArgument) { verifyBatteryLevelChangedIntent(device, batteryLevel, intentArgument.getValue()); Loading Loading
android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +6 −0 Original line number Diff line number Diff line Loading @@ -639,6 +639,12 @@ final class RemoteDevices { * @param isCoordinatedSetMember the mIsCoordinatedSetMember to set */ void setIsCoordinatedSetMember(boolean isCoordinatedSetMember) { if ((mAdapterService.getSupportedProfilesBitMask() & (1 << BluetoothProfile.CSIP_SET_COORDINATOR)) == 0) { debugLog("CSIP is not supported"); return; } synchronized (mObject) { this.mIsCoordinatedSetMember = isCoordinatedSetMember; } Loading
android/app/tests/unit/src/com/android/bluetooth/btservice/RemoteDevicesTest.java +32 −0 Original line number Diff line number Diff line Loading @@ -635,6 +635,38 @@ public class RemoteDevicesTest { .getHfAudioPolicyForRemoteAg()); } @Test public void testIsCoordinatedSetMemberAsLeAudioEnabled() { doReturn((long) (1 << BluetoothProfile.CSIP_SET_COORDINATOR)) .when(mAdapterService) .getSupportedProfilesBitMask(); // Verify that device property is null initially Assert.assertNull(mRemoteDevices.getDeviceProperties(mDevice1)); mRemoteDevices.addDeviceProperties(Utils.getBytesFromAddress(TEST_BT_ADDR_1)); DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(mDevice1); deviceProp.setIsCoordinatedSetMember(true); Assert.assertTrue(deviceProp.isCoordinatedSetMember()); } @Test public void testIsCoordinatedSetMemberAsLeAudioDisabled() { doReturn((long) (0 << BluetoothProfile.CSIP_SET_COORDINATOR)) .when(mAdapterService) .getSupportedProfilesBitMask(); // Verify that device property is null initially Assert.assertNull(mRemoteDevices.getDeviceProperties(mDevice1)); mRemoteDevices.addDeviceProperties(Utils.getBytesFromAddress(TEST_BT_ADDR_1)); DeviceProperties deviceProp = mRemoteDevices.getDeviceProperties(mDevice1); deviceProp.setIsCoordinatedSetMember(true); Assert.assertFalse(deviceProp.isCoordinatedSetMember()); } private static void verifyBatteryLevelChangedIntent(BluetoothDevice device, int batteryLevel, ArgumentCaptor<Intent> intentArgument) { verifyBatteryLevelChangedIntent(device, batteryLevel, intentArgument.getValue()); Loading