STS test for Android Security CVE-2021-0306

Test: sts-tradefed run sts-engbuild-no-spl-lock -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.PermissionsHostTest#testNoPermissionEscalationAfterReboot
Bug: 173531291
Bug: 154505240
Bug: 173530931
Bug: 168319670
Change-Id: I9b6a1a7434b6196375894462aeed5c770fb10af6
Merged-In: I9b6a1a7434b6196375894462aeed5c770fb10af6
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/PermissionsHostTest.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/PermissionsHostTest.java
index d0c5b4d..d4abeeb 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/PermissionsHostTest.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/PermissionsHostTest.java
@@ -16,6 +16,7 @@
 
 package android.appsecurity.cts;
 
+import android.platform.test.annotations.SecurityTest;
 import com.android.compatibility.common.tradefed.build.CompatibilityBuildHelper;
 import com.android.tradefed.build.IBuildInfo;
 import com.android.tradefed.device.DeviceNotAvailableException;
@@ -304,6 +305,7 @@
                 "testCannotEscalateNonRuntimePermissionsToRuntime");
     }
 
+    @SecurityTest
     public void testNoPermissionEscalationAfterReboot() throws Exception {
         assertNull(getDevice().installPackage(mBuildHelper.getTestFile(
                 APK_DECLARE_NON_RUNTIME_PERMISSIONS), false, false));
diff --git a/hostsidetests/appsecurity/test-apps/DeclareNotRuntimePermissions/Android.mk b/hostsidetests/appsecurity/test-apps/DeclareNotRuntimePermissions/Android.mk
index b98ba68..c45984e 100644
--- a/hostsidetests/appsecurity/test-apps/DeclareNotRuntimePermissions/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/DeclareNotRuntimePermissions/Android.mk
@@ -22,7 +22,7 @@
 
 LOCAL_PACKAGE_NAME := CtsDeclareNonRuntimePermissions
 
-LOCAL_COMPATIBILITY_SUITE := cts
+LOCAL_COMPATIBILITY_SUITE := cts sts
 
 LOCAL_DEX_PREOPT := false
 
diff --git a/hostsidetests/appsecurity/test-apps/EscalateToRuntimePermissions/Android.mk b/hostsidetests/appsecurity/test-apps/EscalateToRuntimePermissions/Android.mk
index b1b7f83..07e4ec3 100644
--- a/hostsidetests/appsecurity/test-apps/EscalateToRuntimePermissions/Android.mk
+++ b/hostsidetests/appsecurity/test-apps/EscalateToRuntimePermissions/Android.mk
@@ -26,7 +26,7 @@
 
 LOCAL_PACKAGE_NAME := CtsEscalateToRuntimePermissions
 
-LOCAL_COMPATIBILITY_SUITE := cts
+LOCAL_COMPATIBILITY_SUITE := cts sts
 
 LOCAL_PROGUARD_ENABLED := disabled