Loading android/app/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceFactoryResetTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -342,6 +342,7 @@ public class AdapterServiceFactoryResetTest { * native layer */ @Test @Ignore("b/296127545: BluetoothInstrumentationTests should not call native") public void testObfuscateBluetoothAddress_FactoryResetAndReloadNativeLayer() throws PackageManager.NameNotFoundException { byte[] metricsSalt1 = AdapterServiceTest.getMetricsSalt(mAdapterConfig); Loading android/app/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceRestartTest.java +10 −10 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ import com.android.internal.app.IBatteryStats; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading Loading @@ -256,12 +257,13 @@ public class AdapterServiceRestartTest { } /** * Test: Check if obfuscated Bluetooth address stays the same after re-initializing * {@link AdapterService} * Test: Check if obfuscated Bluetooth address stays the same after re-initializing {@link * AdapterService} */ @Test public void testObfuscateBluetoothAddress_PersistentBetweenAdapterServiceInitialization() throws PackageManager.NameNotFoundException { @Ignore("b/296127545: This is a native test") public void testObfuscateBluetoothAddress_PersistentBetweenAdapterServiceInitialization() throws PackageManager.NameNotFoundException { // Sleep needed to ensure the metrics are valid in both native and java (b/267528843) try { Thread.sleep(1_000); Loading Loading @@ -291,13 +293,11 @@ public class AdapterServiceRestartTest { assertThat(obfuscatedAddress2).isEqualTo(obfuscatedAddress1); } /** * Test: Check if id gotten stays the same after re-initializing * {@link AdapterService} */ /** Test: Check if id gotten stays the same after re-initializing {@link AdapterService} */ @Test public void testgetMetricId_PersistentBetweenAdapterServiceInitialization() throws PackageManager.NameNotFoundException { @Ignore("b/296127545: This is a native test") public void testgetMetricId_PersistentBetweenAdapterServiceInitialization() throws PackageManager.NameNotFoundException { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); BluetoothDevice device = TestUtils.getTestDevice(BluetoothAdapter.getDefaultAdapter(), 0); int initialMetricId = mAdapterService.getMetricId(device); Loading android/app/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceTest.java +15 −16 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ import libcore.util.HexEncoding; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading Loading @@ -842,10 +843,11 @@ public class AdapterServiceTest { } /** * Test: Obfuscate Bluetooth address when Bluetooth is disabled * Check whether the returned value meets expectation * Test: Obfuscate Bluetooth address when Bluetooth is disabled Check whether the returned value * meets expectation */ @Test @Ignore("b/296127545: This is a native test") public void testObfuscateBluetoothAddress_BluetoothDisabled() { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); byte[] metricsSalt = getMetricsSalt(mAdapterConfig); Loading @@ -858,10 +860,11 @@ public class AdapterServiceTest { } /** * Test: Obfuscate Bluetooth address when Bluetooth is enabled * Check whether the returned value meets expectation * Test: Obfuscate Bluetooth address when Bluetooth is enabled Check whether the returned value * meets expectation */ @Test @Ignore("b/296127545: This is a native test") public void testObfuscateBluetoothAddress_BluetoothEnabled() { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); doEnable(false); Loading @@ -875,10 +878,9 @@ public class AdapterServiceTest { assertThat(obfuscateInJava(metricsSalt, device)).isEqualTo(obfuscatedAddress); } /** * Test: Check if obfuscated Bluetooth address stays the same after toggling Bluetooth */ /** Test: Check if obfuscated Bluetooth address stays the same after toggling Bluetooth */ @Test @Ignore("b/296127545: This is a native test") public void testObfuscateBluetoothAddress_PersistentBetweenToggle() { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); byte[] metricsSalt = getMetricsSalt(mAdapterConfig); Loading Loading @@ -972,21 +974,19 @@ public class AdapterServiceTest { } /** * Test: Get id when Bluetooth is disabled * Check whether the returned value meets expectation * Test: Get id when Bluetooth is disabled Check whether the returned value meets expectation */ @Test @Ignore("b/296127545: This is a native test") public void testGetMetricId_BluetoothDisabled() { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); BluetoothDevice device = TestUtils.getTestDevice(BluetoothAdapter.getDefaultAdapter(), 0); assertThat(mAdapterService.getMetricId(device)).isGreaterThan(0); } /** * Test: Get id when Bluetooth is enabled * Check whether the returned value meets expectation */ /** Test: Get id when Bluetooth is enabled Check whether the returned value meets expectation */ @Test @Ignore("b/296127545: This is a native test") public void testGetMetricId_BluetoothEnabled() { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); doEnable(false); Loading @@ -995,10 +995,9 @@ public class AdapterServiceTest { assertThat(mAdapterService.getMetricId(device)).isGreaterThan(0); } /** * Test: Check if id gotten stays the same after toggling Bluetooth */ /** Test: Check if id gotten stays the same after toggling Bluetooth */ @Test @Ignore("b/296127545: This is a native test") public void testGetMetricId_PersistentBetweenToggle() { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); BluetoothDevice device = TestUtils.getTestDevice(BluetoothAdapter.getDefaultAdapter(), 0); Loading Loading
android/app/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceFactoryResetTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -342,6 +342,7 @@ public class AdapterServiceFactoryResetTest { * native layer */ @Test @Ignore("b/296127545: BluetoothInstrumentationTests should not call native") public void testObfuscateBluetoothAddress_FactoryResetAndReloadNativeLayer() throws PackageManager.NameNotFoundException { byte[] metricsSalt1 = AdapterServiceTest.getMetricsSalt(mAdapterConfig); Loading
android/app/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceRestartTest.java +10 −10 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ import com.android.internal.app.IBatteryStats; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading Loading @@ -256,12 +257,13 @@ public class AdapterServiceRestartTest { } /** * Test: Check if obfuscated Bluetooth address stays the same after re-initializing * {@link AdapterService} * Test: Check if obfuscated Bluetooth address stays the same after re-initializing {@link * AdapterService} */ @Test public void testObfuscateBluetoothAddress_PersistentBetweenAdapterServiceInitialization() throws PackageManager.NameNotFoundException { @Ignore("b/296127545: This is a native test") public void testObfuscateBluetoothAddress_PersistentBetweenAdapterServiceInitialization() throws PackageManager.NameNotFoundException { // Sleep needed to ensure the metrics are valid in both native and java (b/267528843) try { Thread.sleep(1_000); Loading Loading @@ -291,13 +293,11 @@ public class AdapterServiceRestartTest { assertThat(obfuscatedAddress2).isEqualTo(obfuscatedAddress1); } /** * Test: Check if id gotten stays the same after re-initializing * {@link AdapterService} */ /** Test: Check if id gotten stays the same after re-initializing {@link AdapterService} */ @Test public void testgetMetricId_PersistentBetweenAdapterServiceInitialization() throws PackageManager.NameNotFoundException { @Ignore("b/296127545: This is a native test") public void testgetMetricId_PersistentBetweenAdapterServiceInitialization() throws PackageManager.NameNotFoundException { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); BluetoothDevice device = TestUtils.getTestDevice(BluetoothAdapter.getDefaultAdapter(), 0); int initialMetricId = mAdapterService.getMetricId(device); Loading
android/app/tests/unit/src/com/android/bluetooth/btservice/AdapterServiceTest.java +15 −16 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ import libcore.util.HexEncoding; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; Loading Loading @@ -842,10 +843,11 @@ public class AdapterServiceTest { } /** * Test: Obfuscate Bluetooth address when Bluetooth is disabled * Check whether the returned value meets expectation * Test: Obfuscate Bluetooth address when Bluetooth is disabled Check whether the returned value * meets expectation */ @Test @Ignore("b/296127545: This is a native test") public void testObfuscateBluetoothAddress_BluetoothDisabled() { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); byte[] metricsSalt = getMetricsSalt(mAdapterConfig); Loading @@ -858,10 +860,11 @@ public class AdapterServiceTest { } /** * Test: Obfuscate Bluetooth address when Bluetooth is enabled * Check whether the returned value meets expectation * Test: Obfuscate Bluetooth address when Bluetooth is enabled Check whether the returned value * meets expectation */ @Test @Ignore("b/296127545: This is a native test") public void testObfuscateBluetoothAddress_BluetoothEnabled() { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); doEnable(false); Loading @@ -875,10 +878,9 @@ public class AdapterServiceTest { assertThat(obfuscateInJava(metricsSalt, device)).isEqualTo(obfuscatedAddress); } /** * Test: Check if obfuscated Bluetooth address stays the same after toggling Bluetooth */ /** Test: Check if obfuscated Bluetooth address stays the same after toggling Bluetooth */ @Test @Ignore("b/296127545: This is a native test") public void testObfuscateBluetoothAddress_PersistentBetweenToggle() { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); byte[] metricsSalt = getMetricsSalt(mAdapterConfig); Loading Loading @@ -972,21 +974,19 @@ public class AdapterServiceTest { } /** * Test: Get id when Bluetooth is disabled * Check whether the returned value meets expectation * Test: Get id when Bluetooth is disabled Check whether the returned value meets expectation */ @Test @Ignore("b/296127545: This is a native test") public void testGetMetricId_BluetoothDisabled() { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); BluetoothDevice device = TestUtils.getTestDevice(BluetoothAdapter.getDefaultAdapter(), 0); assertThat(mAdapterService.getMetricId(device)).isGreaterThan(0); } /** * Test: Get id when Bluetooth is enabled * Check whether the returned value meets expectation */ /** Test: Get id when Bluetooth is enabled Check whether the returned value meets expectation */ @Test @Ignore("b/296127545: This is a native test") public void testGetMetricId_BluetoothEnabled() { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); doEnable(false); Loading @@ -995,10 +995,9 @@ public class AdapterServiceTest { assertThat(mAdapterService.getMetricId(device)).isGreaterThan(0); } /** * Test: Check if id gotten stays the same after toggling Bluetooth */ /** Test: Check if id gotten stays the same after toggling Bluetooth */ @Test @Ignore("b/296127545: This is a native test") public void testGetMetricId_PersistentBetweenToggle() { assertThat(mAdapterService.getState()).isEqualTo(STATE_OFF); BluetoothDevice device = TestUtils.getTestDevice(BluetoothAdapter.getDefaultAdapter(), 0); Loading