[RESTRICT AUTOMERGE]: Add STS annotations to EphemeralTest
Test: sts-tradefed run sts-engbuild-no-spl-lock -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Bug: 168718431
Change-Id: Id2bd63aadc90d4182785f59407faf9e55b46df67
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/EphemeralTest.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/EphemeralTest.java
index a89c4fe..b786486 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/EphemeralTest.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/EphemeralTest.java
@@ -21,6 +21,8 @@
import static org.junit.Assert.fail;
import android.platform.test.annotations.AppModeFull;
+import android.platform.test.annotations.SecurityTest;
+
import com.android.compatibility.common.tradefed.build.CompatibilityBuildHelper;
import com.android.tradefed.log.LogUtil.CLog;
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
@@ -371,6 +373,7 @@
}
@Test
+ @SecurityTest(minPatchLevel = "2020-11")
public void testInstallPermissionNotGrantedInPackageInfo() throws Exception {
if (mIsUnsupportedDevice) {
return;
@@ -380,6 +383,7 @@
}
@Test
+ @SecurityTest(minPatchLevel = "2020-11")
public void testInstallPermissionGrantedInPackageInfo() throws Exception {
if (mIsUnsupportedDevice) {
return;
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.bp b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.bp
index c3feef4..81d0ed2 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/Android.bp
@@ -26,12 +26,14 @@
"androidx.test.rules",
"ctsdeviceutillegacy-axt",
"ctstestrunner-axt",
+ "platform-test-annotations",
],
// tag this module as a cts test artifact
test_suites: [
"cts",
"vts",
"general-tests",
+ "sts",
],
srcs: ["src/**/*.java"],
resource_dirs: ["res"],
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/src/com/android/cts/ephemeralapp1/ClientTest.java b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/src/com/android/cts/ephemeralapp1/ClientTest.java
index 2da63fe..3d20404 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/src/com/android/cts/ephemeralapp1/ClientTest.java
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/EphemeralApp1/src/com/android/cts/ephemeralapp1/ClientTest.java
@@ -69,6 +69,7 @@
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
+import android.platform.test.annotations.SecurityTest;
import com.android.cts.util.TestResult;
@@ -1147,11 +1148,13 @@
}
@Test
+ @SecurityTest(minPatchLevel = "2020-11")
public void testInstallPermissionNotGrantedInPackageInfo() throws Exception {
assertThat(isPermissionGrantedInPackageInfo(Manifest.permission.SET_ALARM), is(false));
}
@Test
+ @SecurityTest(minPatchLevel = "2020-11")
public void testInstallPermissionGrantedInPackageInfo() throws Exception {
assertThat(isPermissionGrantedInPackageInfo(Manifest.permission.INTERNET), is(true));
}
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.bp b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.bp
index 919473b..b3771fb 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/ImplicitlyExposedApp/Android.bp
@@ -26,6 +26,7 @@
"cts",
"vts",
"general-tests",
+ "sts",
],
srcs: ["src/**/*.java"],
resource_dirs: ["res"],
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.bp b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.bp
index 21a435d..94576c1 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/NormalApp/Android.bp
@@ -27,6 +27,7 @@
"cts",
"vts",
"general-tests",
+ "sts",
],
srcs: ["src/**/*.java"],
resource_dirs: ["res"],
diff --git a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UnexposedApp/Android.bp b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UnexposedApp/Android.bp
index b87b89f..fa2b9a00 100644
--- a/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UnexposedApp/Android.bp
+++ b/hostsidetests/appsecurity/test-apps/EphemeralTestApp/UnexposedApp/Android.bp
@@ -23,6 +23,7 @@
"cts",
"vts",
"general-tests",
+ "sts",
],
resource_dirs: ["res"],
sdk_version: "current",