commit | c3c807b54b0336c5b53a7c3b6960470e6d7e9fd9 | [log] [tgz] |
---|---|---|
author | Chen Wang <chenw@google.com> | Mon Jun 26 18:53:45 2023 +0000 |
committer | Android Build Cherrypicker Worker <android-build-cherrypicker-worker@google.com> | Fri Dec 08 22:36:53 2023 +0000 |
tree | 6b88256767853b0d4d6e4f0e1598f17309f81d76 | |
parent | a60ebedf584ec5c392b075171fd72521c058852d [diff] |
Fix NearbyConfigurationTest. TestAppSupported Flag can be set to true only in user-debug devices. Add conidtional testing for this test case. Bug: 285234065 Ignore-AOSP-First: nearby_not_in_aosp_yet Test: atest NearbyConfigurationTest (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:22b1e80835ec5bbacc7cb3bf88e072cfd8fcd8d9) Merged-In: I14a7947f8a9178a1f97b5ed392882ab9f200eb89 Change-Id: I14a7947f8a9178a1f97b5ed392882ab9f200eb89
diff --git a/nearby/tests/unit/src/com/android/server/nearby/NearbyConfigurationTest.java b/nearby/tests/unit/src/com/android/server/nearby/NearbyConfigurationTest.java index 5ddfed3..644e178 100644 --- a/nearby/tests/unit/src/com/android/server/nearby/NearbyConfigurationTest.java +++ b/nearby/tests/unit/src/com/android/server/nearby/NearbyConfigurationTest.java
@@ -25,6 +25,7 @@ import static com.google.common.truth.Truth.assertThat; +import android.os.Build; import android.provider.DeviceConfig; import androidx.test.platform.app.InstrumentationRegistry; @@ -68,7 +69,12 @@ "3", false); Thread.sleep(500); - assertThat(mNearbyConfiguration.isTestAppSupported()).isTrue(); + // TestAppSupported Flag can only be set to true in user-debug devices. + if (Build.isDebuggable()) { + assertThat(mNearbyConfiguration.isTestAppSupported()).isTrue(); + } else { + assertThat(mNearbyConfiguration.isTestAppSupported()).isFalse(); + } assertThat(mNearbyConfiguration.isPresenceBroadcastLegacyEnabled()).isTrue(); assertThat(mNearbyConfiguration.getNanoAppMinVersion()).isEqualTo(3); }