Merge "@TemporaryIgnoreOnHeadlessSystemUserMode changes:" into sc-dev
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAdminFeaturesCheckerRule.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAdminFeaturesCheckerRule.java
index e75056f..b66099e 100644
--- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAdminFeaturesCheckerRule.java
+++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAdminFeaturesCheckerRule.java
@@ -206,5 +206,7 @@
     @Retention(RetentionPolicy.RUNTIME)
     @Target({ElementType.METHOD})
     public static @interface TemporaryIgnoreOnHeadlessSystemUserMode {
+        String bugId();
+        String reason();
     }
 }
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java
index 0177cf3..e4957dd 100644
--- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java
+++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceOwnerTest.java
@@ -31,7 +31,6 @@
 
 import com.android.compatibility.common.tradefed.build.CompatibilityBuildHelper;
 import com.android.cts.devicepolicy.DeviceAdminFeaturesCheckerRule.RequiresAdditionalFeatures;
-import com.android.cts.devicepolicy.DeviceAdminFeaturesCheckerRule.TemporaryIgnoreOnHeadlessSystemUserMode;
 import com.android.cts.devicepolicy.metrics.DevicePolicyEventWrapper;
 import com.android.tradefed.log.LogUtil.CLog;
 
@@ -100,13 +99,11 @@
     }
 
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testProxyStaticProxyTest() throws Exception {
         executeDeviceOwnerTest("proxy.StaticProxyTest");
     }
 
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testProxyPacProxyTest() throws Exception {
         executeDeviceOwnerTest("proxy.PacProxyTest");
     }
@@ -453,7 +450,6 @@
 
     @FlakyTest(bugId = 127101449)
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testWifiConfigLockdown() throws Exception {
         assumeHasWifiFeature();
 
@@ -470,7 +466,6 @@
      * Execute WifiSetHttpProxyTest as device owner.
      */
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testWifiSetHttpProxyTest() throws Exception {
         assumeHasWifiFeature();
         try (LocationModeSetter locationModeSetter = new LocationModeSetter(getDevice())) {
@@ -501,7 +496,6 @@
 
     // Execute HardwarePropertiesManagerTest as a device owner.
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testHardwarePropertiesManagerAsDeviceOwner() throws Exception {
 
         executeDeviceTestMethod(".HardwarePropertiesManagerTest", "testHardwarePropertiesManager");
@@ -533,7 +527,6 @@
 
     @FlakyTest(bugId = 137096267)
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testAdminActionBookkeeping() throws Exception {
         executeDeviceOwnerTest("AdminActionBookkeepingTest");
         assertMetricsLogged(getDevice(), () -> {
@@ -552,7 +545,6 @@
     }
 
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testBluetoothRestriction() throws Exception {
         executeDeviceOwnerTest("BluetoothRestrictionTest");
     }
@@ -563,7 +555,6 @@
     }
 
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testSetLocationEnabled() throws Exception {
         executeDeviceOwnerTest("SetLocationEnabledTest");
     }
@@ -579,7 +570,6 @@
     }
 
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testDisallowFactoryReset() throws Exception {
         int adminVersion = 24;
         changeUserRestrictionOrFail("no_factory_reset", true, mPrimaryUserId,
@@ -608,7 +598,6 @@
     }
 
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testDeviceOwnerCanGetDeviceIdentifiers() throws Exception {
         // The Device Owner should have access to all device identifiers.
         executeDeviceTestMethod(".DeviceIdentifiersTest",
@@ -616,7 +605,6 @@
     }
 
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testPackageInstallCache() throws Exception {
         CompatibilityBuildHelper buildHelper = new CompatibilityBuildHelper(getBuild());
         final File apk = buildHelper.getTestFile(TEST_APP_APK);
@@ -727,7 +715,6 @@
 
     @FlakyTest(bugId = 134487729)
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testPrivateDnsPolicy() throws Exception {
         executeDeviceOwnerTest("PrivateDnsPolicyTest");
     }
@@ -767,7 +754,6 @@
     }
 
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     public void testNoHiddenActivityFoundTest() throws Exception {
         try {
             // Install app to primary user
@@ -913,7 +899,6 @@
                 "testListForegroundAffiliatedUsers_onlyForegroundUser");
     }
 
-    @TemporaryIgnoreOnHeadlessSystemUserMode
     @Test
     public void testWifiNetworkConfigurationWithoutFineLocationPermission() throws Exception {
         getDevice().executeShellCommand(String.format(
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ProfileOwnerTest.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ProfileOwnerTest.java
index b2f93d8..eae5c48 100644
--- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ProfileOwnerTest.java
+++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ProfileOwnerTest.java
@@ -57,19 +57,22 @@
     }
 
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode // TODO(b/183020176): decide if it's needed or fix it
+    @TemporaryIgnoreOnHeadlessSystemUserMode(bugId = "183020176",
+            reason = "decide if it's needed or fix it")
     public void testManagement() throws Exception {
         executeProfileOwnerTest("ManagementTest");
     }
 
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode // TODO(b/183020176): decide if it's needed or fix it
+    @TemporaryIgnoreOnHeadlessSystemUserMode(bugId = "183020176",
+            reason = "decide if it's needed or fix it")
     public void testAdminActionBookkeeping() throws Exception {
         executeProfileOwnerTest("AdminActionBookkeepingTest");
     }
 
     @Test
-    @TemporaryIgnoreOnHeadlessSystemUserMode // TODO(b/183020176): decide if it's needed or fix it
+    @TemporaryIgnoreOnHeadlessSystemUserMode(bugId = "183020176",
+            reason = "decide if it's needed or fix it")
     public void testAppUsageObserver() throws Exception {
         executeProfileOwnerTest("AppUsageObserverTest");
     }