Loading android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java +10 −10 Original line number Diff line number Diff line Loading @@ -1025,7 +1025,7 @@ public class LeAudioServiceTest { @Test public void testGetActiveDevices() { int groupId = 1; int direction = 1; int direction = 2; int snkAudioLocation = 3; int srcAudioLocation = 4; int availableContexts = 5; Loading Loading @@ -1076,8 +1076,7 @@ public class LeAudioServiceTest { mService.messageFromNative(groupStatusChangedEvent); } private void injectAudioConfChanged(int groupId, Integer availableContexts) { int direction = 1; private void injectAudioConfChanged(int groupId, Integer availableContexts, int direction) { int snkAudioLocation = 3; int srcAudioLocation = 4; int eventType = LeAudioStackEvent.EVENT_TYPE_AUDIO_CONF_CHANGED; Loading @@ -1100,7 +1099,7 @@ public class LeAudioServiceTest { doReturn(true).when(mNativeInterface).connectLeAudio(any(BluetoothDevice.class)); connectTestDevice(mSingleDevice, testGroupId); injectAudioConfChanged(testGroupId, BluetoothLeAudio.CONTEXT_TYPE_MEDIA | BluetoothLeAudio.CONTEXT_TYPE_CONVERSATIONAL); BluetoothLeAudio.CONTEXT_TYPE_CONVERSATIONAL, 3); injectGroupStatusChange(testGroupId, BluetoothLeAudio.GROUP_STATUS_ACTIVE); String action = BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED; Loading @@ -1122,7 +1121,7 @@ public class LeAudioServiceTest { String action = BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED; Integer contexts = BluetoothLeAudio.CONTEXT_TYPE_MEDIA | BluetoothLeAudio.CONTEXT_TYPE_CONVERSATIONAL; injectAudioConfChanged(testGroupId, contexts); injectAudioConfChanged(testGroupId, contexts, 3); Intent intent = TestUtils.waitForNoIntent(TIMEOUT_MS, mDeviceQueueMap.get(mSingleDevice)); assertThat(intent).isNull(); Loading @@ -1137,7 +1136,7 @@ public class LeAudioServiceTest { String action = BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED; injectAudioConfChanged(testGroupId, 0); injectAudioConfChanged(testGroupId, 0, 3); Intent intent = TestUtils.waitForNoIntent(TIMEOUT_MS, mDeviceQueueMap.get(mSingleDevice)); assertThat(intent).isNull(); } Loading Loading @@ -1183,7 +1182,7 @@ public class LeAudioServiceTest { connectTestDevice(mSingleDevice, testGroupId); injectAudioConfChanged(testGroupId, BluetoothLeAudio.CONTEXT_TYPE_MEDIA | BluetoothLeAudio.CONTEXT_TYPE_CONVERSATIONAL); BluetoothLeAudio.CONTEXT_TYPE_CONVERSATIONAL, 3); sendEventAndVerifyIntentForGroupStatusChanged(testGroupId, LeAudioStackEvent.GROUP_STATUS_ACTIVE); sendEventAndVerifyIntentForGroupStatusChanged(testGroupId, LeAudioStackEvent.GROUP_STATUS_INACTIVE); Loading Loading @@ -1276,7 +1275,7 @@ public class LeAudioServiceTest { @Test public void testLeadGroupDeviceDisconnects() { int groupId = 1; int direction = 1; int direction = 2; int snkAudioLocation = 3; int srcAudioLocation = 4; int availableContexts = 5; Loading Loading @@ -1341,7 +1340,7 @@ public class LeAudioServiceTest { @Test public void testLeadGroupDeviceReconnects() { int groupId = 1; int direction = 1; int direction = 2; int snkAudioLocation = 3; int srcAudioLocation = 4; int availableContexts = 5; Loading Loading @@ -1408,6 +1407,7 @@ public class LeAudioServiceTest { public void testVolumeCache() { int groupId = 1; int volume = 100; int direction = 2; int availableContexts = 4; doReturn(true).when(mNativeInterface).connectLeAudio(any(BluetoothDevice.class)); Loading @@ -1420,7 +1420,7 @@ public class LeAudioServiceTest { ArgumentCaptor.forClass(BluetoothProfileConnectionInfo.class); //Add location support. injectAudioConfChanged(groupId, availableContexts); injectAudioConfChanged(groupId, availableContexts, direction); doReturn(-1).when(mVolumeControlService).getAudioDeviceGroupVolume(groupId); //Set group and device as active. Loading Loading
android/app/tests/unit/src/com/android/bluetooth/le_audio/LeAudioServiceTest.java +10 −10 Original line number Diff line number Diff line Loading @@ -1025,7 +1025,7 @@ public class LeAudioServiceTest { @Test public void testGetActiveDevices() { int groupId = 1; int direction = 1; int direction = 2; int snkAudioLocation = 3; int srcAudioLocation = 4; int availableContexts = 5; Loading Loading @@ -1076,8 +1076,7 @@ public class LeAudioServiceTest { mService.messageFromNative(groupStatusChangedEvent); } private void injectAudioConfChanged(int groupId, Integer availableContexts) { int direction = 1; private void injectAudioConfChanged(int groupId, Integer availableContexts, int direction) { int snkAudioLocation = 3; int srcAudioLocation = 4; int eventType = LeAudioStackEvent.EVENT_TYPE_AUDIO_CONF_CHANGED; Loading @@ -1100,7 +1099,7 @@ public class LeAudioServiceTest { doReturn(true).when(mNativeInterface).connectLeAudio(any(BluetoothDevice.class)); connectTestDevice(mSingleDevice, testGroupId); injectAudioConfChanged(testGroupId, BluetoothLeAudio.CONTEXT_TYPE_MEDIA | BluetoothLeAudio.CONTEXT_TYPE_CONVERSATIONAL); BluetoothLeAudio.CONTEXT_TYPE_CONVERSATIONAL, 3); injectGroupStatusChange(testGroupId, BluetoothLeAudio.GROUP_STATUS_ACTIVE); String action = BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED; Loading @@ -1122,7 +1121,7 @@ public class LeAudioServiceTest { String action = BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED; Integer contexts = BluetoothLeAudio.CONTEXT_TYPE_MEDIA | BluetoothLeAudio.CONTEXT_TYPE_CONVERSATIONAL; injectAudioConfChanged(testGroupId, contexts); injectAudioConfChanged(testGroupId, contexts, 3); Intent intent = TestUtils.waitForNoIntent(TIMEOUT_MS, mDeviceQueueMap.get(mSingleDevice)); assertThat(intent).isNull(); Loading @@ -1137,7 +1136,7 @@ public class LeAudioServiceTest { String action = BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED; injectAudioConfChanged(testGroupId, 0); injectAudioConfChanged(testGroupId, 0, 3); Intent intent = TestUtils.waitForNoIntent(TIMEOUT_MS, mDeviceQueueMap.get(mSingleDevice)); assertThat(intent).isNull(); } Loading Loading @@ -1183,7 +1182,7 @@ public class LeAudioServiceTest { connectTestDevice(mSingleDevice, testGroupId); injectAudioConfChanged(testGroupId, BluetoothLeAudio.CONTEXT_TYPE_MEDIA | BluetoothLeAudio.CONTEXT_TYPE_CONVERSATIONAL); BluetoothLeAudio.CONTEXT_TYPE_CONVERSATIONAL, 3); sendEventAndVerifyIntentForGroupStatusChanged(testGroupId, LeAudioStackEvent.GROUP_STATUS_ACTIVE); sendEventAndVerifyIntentForGroupStatusChanged(testGroupId, LeAudioStackEvent.GROUP_STATUS_INACTIVE); Loading Loading @@ -1276,7 +1275,7 @@ public class LeAudioServiceTest { @Test public void testLeadGroupDeviceDisconnects() { int groupId = 1; int direction = 1; int direction = 2; int snkAudioLocation = 3; int srcAudioLocation = 4; int availableContexts = 5; Loading Loading @@ -1341,7 +1340,7 @@ public class LeAudioServiceTest { @Test public void testLeadGroupDeviceReconnects() { int groupId = 1; int direction = 1; int direction = 2; int snkAudioLocation = 3; int srcAudioLocation = 4; int availableContexts = 5; Loading Loading @@ -1408,6 +1407,7 @@ public class LeAudioServiceTest { public void testVolumeCache() { int groupId = 1; int volume = 100; int direction = 2; int availableContexts = 4; doReturn(true).when(mNativeInterface).connectLeAudio(any(BluetoothDevice.class)); Loading @@ -1420,7 +1420,7 @@ public class LeAudioServiceTest { ArgumentCaptor.forClass(BluetoothProfileConnectionInfo.class); //Add location support. injectAudioConfChanged(groupId, availableContexts); injectAudioConfChanged(groupId, availableContexts, direction); doReturn(-1).when(mVolumeControlService).getAudioDeviceGroupVolume(groupId); //Set group and device as active. Loading