summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-04-02 04:08:02 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-04-02 04:08:02 +0000
commit222c7e75b0bf3a44535f07f08f4a7206148e14b9 (patch)
tree52b46932b383eb8d4ddb3f00e375d0d29c1dd69d
parent1d3aad1cbcf90922fbda92a87eecddcdc33e921d (diff)
parent1e4bfc38ba3b3bd26b75a5775e31af4d04e12f54 (diff)
downloadcts-222c7e75b0bf3a44535f07f08f4a7206148e14b9.tar.gz
Merge "Snap for 8397317 from 2b5e4ded4b55cb0149c80a05c81616224585753d to android11-tests-release" into android11-tests-release
-rw-r--r--tests/app/src/android/app/cts/ActivityManagerTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/app/src/android/app/cts/ActivityManagerTest.java b/tests/app/src/android/app/cts/ActivityManagerTest.java
index 7cd71515c39..88cb7c29302 100644
--- a/tests/app/src/android/app/cts/ActivityManagerTest.java
+++ b/tests/app/src/android/app/cts/ActivityManagerTest.java
@@ -37,6 +37,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ConfigurationInfo;
+import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.SystemClock;
import android.platform.test.annotations.RestrictedBuildTest;
@@ -852,6 +853,13 @@ public class ActivityManagerTest extends InstrumentationTestCase {
assertFalse(waitUntilTrue(defaultWaitForKillTimeout, () -> isProcessGone(
proc.pid, SIMPLE_PACKAGE_NAME)));
+ if (isAtvDevice()) {
+ // On operator tier devices of AndroidTv, Activity is put behind TvLauncher
+ // after turnScreenOff by android.intent.category.HOME intent from
+ // TvRecommendation.
+ return;
+ }
+
// force device idle
toggleScreenOn(false);
triggerIdle(true);
@@ -950,4 +958,10 @@ public class ActivityManagerTest extends InstrumentationTestCase {
} while (!(result = supplier.get()) && SystemClock.uptimeMillis() < deadLine);
return result;
}
+
+ private boolean isAtvDevice() {
+ final Context context = mInstrumentation.getTargetContext();
+ return context.getPackageManager()
+ .hasSystemFeature(PackageManager.FEATURE_TELEVISION);
+ }
}