From 1dda1196d9d5d840caae24864df6df9c7b367fe4 Mon Sep 17 00:00:00 2001 From: Chen Bai Date: Mon, 21 Nov 2022 16:49:20 -0800 Subject: DCL: disable DynamicCodeLoggerIntegrationTests for watch - DynamicCodeLoggingService doesn't run on watch, therefore disable its related tests. BUG: 253517106 Change-Id: I07cc3d7e7f58b01c0a8bd1a30fbf1e66a78ce7a2 (cherry picked from commit 9a18b568e3bf69f855cb231b488767967f904ea8) (cherry picked from commit 1339078c8e590c29762560c65caf502e648f0a6f) --- .../server/pm/dex/DynamicCodeLoggerIntegrationTests.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests/DynamicCodeLoggerIntegrationTests/src') diff --git a/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java b/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java index 5430dee5ca31..cfebf3462b57 100644 --- a/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java +++ b/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/DynamicCodeLoggerIntegrationTests.java @@ -19,8 +19,11 @@ package com.android.server.pm.dex; import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.Assume.assumeFalse; + import android.app.UiAutomation; import android.content.Context; +import android.content.pm.PackageManager; import android.os.Build; import android.os.ParcelFileDescriptor; import android.os.SystemClock; @@ -96,7 +99,12 @@ public final class DynamicCodeLoggerIntegrationTests { } @Before - public void primeEventLog() { + public void setup() { + assumeFalse(sContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)); + primeEventLog(); + } + + private void primeEventLog() { // Force a round trip to logd to make sure everything is up to date. // Without this the first test passes and others don't - we don't see new events in the // log. The exact reason is unclear. -- cgit v1.2.3-59-g8ed1b