Merge "Updated CTS test for Android Security b/174495520" into rvc-dev am: 9fce077fe1 am: 28e02d2c0a am: aa3ceadb66 am: f55231eaee

Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/19967924

Change-Id: I2dc2667ad7b2f9c98961b12251a7047dd58924a7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2021_0441.java b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2021_0441.java
index 57b9a86..010cce5 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2021_0441.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2021_0441.java
@@ -16,6 +16,9 @@
 
 package android.security.cts;
 
+import static org.junit.Assume.assumeFalse;
+import static org.junit.Assume.assumeNoException;
+
 import android.platform.test.annotations.AsbSecurityTest;
 
 import com.android.sts.common.tradefed.testtype.NonRootSecurityTestCase;
@@ -34,18 +37,25 @@
 
     /**
      * b/174495520
+     * Vulnerable Module : com.google.android.mediaprovider
+     * Is Play managed   : Yes
      */
     @AsbSecurityTest(cveBugId = 174495520)
     @Test
-    public void testPocCVE_2021_0441() throws Exception {
-        ITestDevice device = getDevice();
-        uninstallPackage(device, TEST_PKG);
+    public void testPocCVE_2021_0441() {
+        try {
+            assumeFalse(moduleIsPlayManaged("com.google.android.mediaprovider"));
+            ITestDevice device = getDevice();
+            uninstallPackage(device, TEST_PKG);
 
-        AdbUtils.runCommandLine("input keyevent KEYCODE_WAKEUP", device);
-        AdbUtils.runCommandLine("input keyevent KEYCODE_MENU", device);
-        AdbUtils.runCommandLine("input keyevent KEYCODE_HOME", device);
+            AdbUtils.runCommandLine("input keyevent KEYCODE_WAKEUP", device);
+            AdbUtils.runCommandLine("input keyevent KEYCODE_MENU", device);
+            AdbUtils.runCommandLine("input keyevent KEYCODE_HOME", device);
 
-        installPackage(TEST_APP);
-        runDeviceTests(TEST_PKG, TEST_CLASS, "testCVE_2021_0441");
+            installPackage(TEST_APP);
+            runDeviceTests(TEST_PKG, TEST_CLASS, "testCVE_2021_0441");
+        } catch (Exception e) {
+            assumeNoException(e);
+        }
     }
 }