Loading android/app/src/com/android/bluetooth/vc/VolumeControlStackEvent.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -173,7 +173,7 @@ public class VolumeControlStackEvent { private static String eventTypeString1ToString(int type, String value) { private static String eventTypeString1ToString(int type, String value) { switch (type) { switch (type) { case EVENT_TYPE_EXT_AUDIO_OUT_DESCRIPTION_CHANGED: case EVENT_TYPE_EXT_AUDIO_OUT_DESCRIPTION_CHANGED: return "{descrition:" + value + "}"; return "{description:" + value + "}"; default: default: break; break; } } Loading android/app/tests/unit/Android.bp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -62,6 +62,7 @@ java_defaults { "-Xep:CatchAndPrintStackTrace:ERROR", "-Xep:CatchAndPrintStackTrace:ERROR", "-Xep:CatchFail:ERROR", "-Xep:CatchFail:ERROR", "-Xep:ClassCanBeStatic:ERROR", "-Xep:ClassCanBeStatic:ERROR", "-Xep:DirectInvocationOnMock:ERROR", "-Xep:EmptyBlockTag:ERROR", "-Xep:EmptyBlockTag:ERROR", "-Xep:EmptyCatch:ERROR", "-Xep:EmptyCatch:ERROR", "-Xep:EqualsIncompatibleType:ERROR", "-Xep:EqualsIncompatibleType:ERROR", Loading @@ -70,6 +71,7 @@ java_defaults { "-Xep:InvalidBlockTag:ERROR", "-Xep:InvalidBlockTag:ERROR", "-Xep:InvalidInlineTag:ERROR", "-Xep:InvalidInlineTag:ERROR", "-Xep:InvalidParam:ERROR", "-Xep:InvalidParam:ERROR", "-Xep:JavaUtilDate:ERROR", "-Xep:MockNotUsedInProduction:ERROR", "-Xep:MockNotUsedInProduction:ERROR", "-Xep:ModifiedButNotUsed:ERROR", "-Xep:ModifiedButNotUsed:ERROR", "-Xep:NarrowCalculation:ERROR", "-Xep:NarrowCalculation:ERROR", Loading android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerStateMachineTest.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -378,7 +378,6 @@ public class AvrcpControllerStateMachineTest { @Test @Test public void testDisconnectWithNullBrowseTree() { public void testDisconnectWithNullBrowseTree() { int numBroadcastsSent = setUpConnectedState(true, true); int numBroadcastsSent = setUpConnectedState(true, true); mAvrcpControllerService.stop(); testDisconnectInternal(numBroadcastsSent); testDisconnectInternal(numBroadcastsSent); } } Loading android/app/tests/unit/src/com/android/bluetooth/hap/HapClientServiceTest.java +8 −10 Original line number Original line Diff line number Diff line Loading @@ -120,7 +120,7 @@ public class HapClientServiceTest { doReturn(mBinder).when(mFrameworkCallback).asBinder(); doReturn(mBinder).when(mFrameworkCallback).asBinder(); /* Prepare CAS groups */ /* Prepare CAS groups */ doReturn(Arrays.asList(0x02, 0x03)).when(mCsipService).getAllGroupIds(BluetoothUuid.CAP); doReturn(List.of(0x02, 0x03)).when(mCsipService).getAllGroupIds(BluetoothUuid.CAP); int groupId2 = 0x02; int groupId2 = 0x02; Map groups2 = Map groups2 = Loading @@ -130,16 +130,14 @@ public class HapClientServiceTest { Map groups3 = Map groups3 = Map.of(groupId3, ParcelUuid.fromString("00001853-0000-1000-8000-00805F9B34FB")); Map.of(groupId3, ParcelUuid.fromString("00001853-0000-1000-8000-00805F9B34FB")); doReturn(Arrays.asList(mDevice, mDevice2)) doReturn(List.of(mDevice, mDevice2)).when(mCsipService).getGroupDevicesOrdered(groupId2); .when(mCsipService) .getGroupDevicesOrdered(groupId2); doReturn(groups2).when(mCsipService).getGroupUuidMapByDevice(mDevice); doReturn(groups2).when(mCsipService).getGroupUuidMapByDevice(mDevice); doReturn(groups2).when(mCsipService).getGroupUuidMapByDevice(mDevice2); doReturn(groups2).when(mCsipService).getGroupUuidMapByDevice(mDevice2); doReturn(Arrays.asList(mDevice3)).when(mCsipService).getGroupDevicesOrdered(0x03); doReturn(List.of(mDevice3)).when(mCsipService).getGroupDevicesOrdered(groupId3); doReturn(groups3).when(mCsipService).getGroupUuidMapByDevice(mDevice3); doReturn(groups3).when(mCsipService).getGroupUuidMapByDevice(mDevice3); doReturn(Arrays.asList(mDevice)).when(mCsipService).getGroupDevicesOrdered(0x01); doReturn(List.of(mDevice)).when(mCsipService).getGroupDevicesOrdered(0x01); doReturn(BluetoothDevice.BOND_BONDED) doReturn(BluetoothDevice.BOND_BONDED) .when(mAdapterService) .when(mAdapterService) Loading Loading @@ -593,9 +591,9 @@ public class HapClientServiceTest { .when(mAdapterService) .when(mAdapterService) .getRemoteUuids(any(BluetoothDevice.class)); .getRemoteUuids(any(BluetoothDevice.class)); int test_group = 0x02; int test_group = 0x02; for (BluetoothDevice device : mCsipService.getGroupDevicesOrdered(test_group)) { testConnectingDevice(order, device); testConnectingDevice(order, mDevice); } testConnectingDevice(order, mDevice2); int flags = 0x21; int flags = 0x21; mNativeCallback.onFeaturesUpdate(getByteAddress(mDevice), flags); mNativeCallback.onFeaturesUpdate(getByteAddress(mDevice), flags); Loading Loading @@ -901,7 +899,7 @@ public class HapClientServiceTest { // Inject some initial presets // Inject some initial presets List<BluetoothHapPresetInfo> presets = List<BluetoothHapPresetInfo> presets = new ArrayList<BluetoothHapPresetInfo>( new ArrayList<>( Arrays.asList( Arrays.asList( new BluetoothHapPresetInfo.Builder(0x01, "One") new BluetoothHapPresetInfo.Builder(0x01, "One") .setAvailable(true) .setAvailable(true) Loading android/app/tests/unit/src/com/android/bluetooth/le_scan/ScanManagerTest.java +2 −11 Original line number Original line Diff line number Diff line Loading @@ -2112,19 +2112,10 @@ public class ScanManagerTest { for (int i = 0; i < scanModeMap.size(); i++) { for (int i = 0; i < scanModeMap.size(); i++) { int phy = PHY_LE_ALL_SUPPORTED; int phy = PHY_LE_ALL_SUPPORTED; int ScanMode = scanModeMap.keyAt(i); int ScanMode = scanModeMap.keyAt(i); boolean adapterServiceSupportsCoded = mAdapterService.isLeCodedPhySupported(); int expectedScanMode = scanModeMap.get(ScanMode); int expectedScanMode = scanModeMap.get(ScanMode); int expectedPhy; int expectedPhy = PHY_LE_1M_MASK; if (adapterServiceSupportsCoded) expectedPhy = PHY_LE_1M_MASK | PHY_LE_CODED_MASK; Log.d(TAG, "ScanMode: " + ScanMode + " expectedScanMode: " + expectedScanMode); else expectedPhy = PHY_LE_1M_MASK; Log.d( TAG, "ScanMode: " + String.valueOf(ScanMode) + " expectedScanMode: " + String.valueOf(expectedScanMode)); // Turn on screen // Turn on screen sendMessageWaitForProcessed(createScreenOnOffMessage(true)); sendMessageWaitForProcessed(createScreenOnOffMessage(true)); Loading Loading
android/app/src/com/android/bluetooth/vc/VolumeControlStackEvent.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -173,7 +173,7 @@ public class VolumeControlStackEvent { private static String eventTypeString1ToString(int type, String value) { private static String eventTypeString1ToString(int type, String value) { switch (type) { switch (type) { case EVENT_TYPE_EXT_AUDIO_OUT_DESCRIPTION_CHANGED: case EVENT_TYPE_EXT_AUDIO_OUT_DESCRIPTION_CHANGED: return "{descrition:" + value + "}"; return "{description:" + value + "}"; default: default: break; break; } } Loading
android/app/tests/unit/Android.bp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -62,6 +62,7 @@ java_defaults { "-Xep:CatchAndPrintStackTrace:ERROR", "-Xep:CatchAndPrintStackTrace:ERROR", "-Xep:CatchFail:ERROR", "-Xep:CatchFail:ERROR", "-Xep:ClassCanBeStatic:ERROR", "-Xep:ClassCanBeStatic:ERROR", "-Xep:DirectInvocationOnMock:ERROR", "-Xep:EmptyBlockTag:ERROR", "-Xep:EmptyBlockTag:ERROR", "-Xep:EmptyCatch:ERROR", "-Xep:EmptyCatch:ERROR", "-Xep:EqualsIncompatibleType:ERROR", "-Xep:EqualsIncompatibleType:ERROR", Loading @@ -70,6 +71,7 @@ java_defaults { "-Xep:InvalidBlockTag:ERROR", "-Xep:InvalidBlockTag:ERROR", "-Xep:InvalidInlineTag:ERROR", "-Xep:InvalidInlineTag:ERROR", "-Xep:InvalidParam:ERROR", "-Xep:InvalidParam:ERROR", "-Xep:JavaUtilDate:ERROR", "-Xep:MockNotUsedInProduction:ERROR", "-Xep:MockNotUsedInProduction:ERROR", "-Xep:ModifiedButNotUsed:ERROR", "-Xep:ModifiedButNotUsed:ERROR", "-Xep:NarrowCalculation:ERROR", "-Xep:NarrowCalculation:ERROR", Loading
android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerStateMachineTest.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -378,7 +378,6 @@ public class AvrcpControllerStateMachineTest { @Test @Test public void testDisconnectWithNullBrowseTree() { public void testDisconnectWithNullBrowseTree() { int numBroadcastsSent = setUpConnectedState(true, true); int numBroadcastsSent = setUpConnectedState(true, true); mAvrcpControllerService.stop(); testDisconnectInternal(numBroadcastsSent); testDisconnectInternal(numBroadcastsSent); } } Loading
android/app/tests/unit/src/com/android/bluetooth/hap/HapClientServiceTest.java +8 −10 Original line number Original line Diff line number Diff line Loading @@ -120,7 +120,7 @@ public class HapClientServiceTest { doReturn(mBinder).when(mFrameworkCallback).asBinder(); doReturn(mBinder).when(mFrameworkCallback).asBinder(); /* Prepare CAS groups */ /* Prepare CAS groups */ doReturn(Arrays.asList(0x02, 0x03)).when(mCsipService).getAllGroupIds(BluetoothUuid.CAP); doReturn(List.of(0x02, 0x03)).when(mCsipService).getAllGroupIds(BluetoothUuid.CAP); int groupId2 = 0x02; int groupId2 = 0x02; Map groups2 = Map groups2 = Loading @@ -130,16 +130,14 @@ public class HapClientServiceTest { Map groups3 = Map groups3 = Map.of(groupId3, ParcelUuid.fromString("00001853-0000-1000-8000-00805F9B34FB")); Map.of(groupId3, ParcelUuid.fromString("00001853-0000-1000-8000-00805F9B34FB")); doReturn(Arrays.asList(mDevice, mDevice2)) doReturn(List.of(mDevice, mDevice2)).when(mCsipService).getGroupDevicesOrdered(groupId2); .when(mCsipService) .getGroupDevicesOrdered(groupId2); doReturn(groups2).when(mCsipService).getGroupUuidMapByDevice(mDevice); doReturn(groups2).when(mCsipService).getGroupUuidMapByDevice(mDevice); doReturn(groups2).when(mCsipService).getGroupUuidMapByDevice(mDevice2); doReturn(groups2).when(mCsipService).getGroupUuidMapByDevice(mDevice2); doReturn(Arrays.asList(mDevice3)).when(mCsipService).getGroupDevicesOrdered(0x03); doReturn(List.of(mDevice3)).when(mCsipService).getGroupDevicesOrdered(groupId3); doReturn(groups3).when(mCsipService).getGroupUuidMapByDevice(mDevice3); doReturn(groups3).when(mCsipService).getGroupUuidMapByDevice(mDevice3); doReturn(Arrays.asList(mDevice)).when(mCsipService).getGroupDevicesOrdered(0x01); doReturn(List.of(mDevice)).when(mCsipService).getGroupDevicesOrdered(0x01); doReturn(BluetoothDevice.BOND_BONDED) doReturn(BluetoothDevice.BOND_BONDED) .when(mAdapterService) .when(mAdapterService) Loading Loading @@ -593,9 +591,9 @@ public class HapClientServiceTest { .when(mAdapterService) .when(mAdapterService) .getRemoteUuids(any(BluetoothDevice.class)); .getRemoteUuids(any(BluetoothDevice.class)); int test_group = 0x02; int test_group = 0x02; for (BluetoothDevice device : mCsipService.getGroupDevicesOrdered(test_group)) { testConnectingDevice(order, device); testConnectingDevice(order, mDevice); } testConnectingDevice(order, mDevice2); int flags = 0x21; int flags = 0x21; mNativeCallback.onFeaturesUpdate(getByteAddress(mDevice), flags); mNativeCallback.onFeaturesUpdate(getByteAddress(mDevice), flags); Loading Loading @@ -901,7 +899,7 @@ public class HapClientServiceTest { // Inject some initial presets // Inject some initial presets List<BluetoothHapPresetInfo> presets = List<BluetoothHapPresetInfo> presets = new ArrayList<BluetoothHapPresetInfo>( new ArrayList<>( Arrays.asList( Arrays.asList( new BluetoothHapPresetInfo.Builder(0x01, "One") new BluetoothHapPresetInfo.Builder(0x01, "One") .setAvailable(true) .setAvailable(true) Loading
android/app/tests/unit/src/com/android/bluetooth/le_scan/ScanManagerTest.java +2 −11 Original line number Original line Diff line number Diff line Loading @@ -2112,19 +2112,10 @@ public class ScanManagerTest { for (int i = 0; i < scanModeMap.size(); i++) { for (int i = 0; i < scanModeMap.size(); i++) { int phy = PHY_LE_ALL_SUPPORTED; int phy = PHY_LE_ALL_SUPPORTED; int ScanMode = scanModeMap.keyAt(i); int ScanMode = scanModeMap.keyAt(i); boolean adapterServiceSupportsCoded = mAdapterService.isLeCodedPhySupported(); int expectedScanMode = scanModeMap.get(ScanMode); int expectedScanMode = scanModeMap.get(ScanMode); int expectedPhy; int expectedPhy = PHY_LE_1M_MASK; if (adapterServiceSupportsCoded) expectedPhy = PHY_LE_1M_MASK | PHY_LE_CODED_MASK; Log.d(TAG, "ScanMode: " + ScanMode + " expectedScanMode: " + expectedScanMode); else expectedPhy = PHY_LE_1M_MASK; Log.d( TAG, "ScanMode: " + String.valueOf(ScanMode) + " expectedScanMode: " + String.valueOf(expectedScanMode)); // Turn on screen // Turn on screen sendMessageWaitForProcessed(createScreenOnOffMessage(true)); sendMessageWaitForProcessed(createScreenOnOffMessage(true)); Loading