Merge "Skip running restore default network monitor on instant mode." into main am: 63488f4798 am: 0d7cad3362
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3228665
Change-Id: Ic14a86b973c4c6cddeaaba4b33956200db60db54
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/staticlibs/testutils/devicetests/com/android/testutils/DevSdkIgnoreRunner.kt b/staticlibs/testutils/devicetests/com/android/testutils/DevSdkIgnoreRunner.kt
index a014834..d00ae52 100644
--- a/staticlibs/testutils/devicetests/com/android/testutils/DevSdkIgnoreRunner.kt
+++ b/staticlibs/testutils/devicetests/com/android/testutils/DevSdkIgnoreRunner.kt
@@ -61,8 +61,10 @@
private val shouldThreadLeakFailTest = klass.isAnnotationPresent(MonitorThreadLeak::class.java)
private val restoreDefaultNetworkDesc =
Description.createTestDescription(klass, "RestoreDefaultNetwork")
- private val restoreDefaultNetwork = klass.isAnnotationPresent(RestoreDefaultNetwork::class.java)
val ctx = ApplicationProvider.getApplicationContext<Context>()
+ private val restoreDefaultNetwork =
+ klass.isAnnotationPresent(RestoreDefaultNetwork::class.java) &&
+ !ctx.applicationInfo.isInstantApp()
// Inference correctly infers Runner & Filterable & Sortable for |baseRunner|, but the
// Java bytecode doesn't have a way to express this. Give this type a name by wrapping it.