CTS: Dismiss error dialog after running DeviceAndProfileOwnerTest.testAccountManagement

Send a home intent to dismiss the dialog.

Bug: 23514846
Change-Id: Icb86634baffbb93203ae2d18a4a6565d0902c856
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAndProfileOwnerTest.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAndProfileOwnerTest.java
index 36dab2c..5bedd25 100644
--- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAndProfileOwnerTest.java
+++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/DeviceAndProfileOwnerTest.java
@@ -16,6 +16,10 @@
 
 package com.android.cts.devicepolicy;
 
+import com.android.ddmlib.Log.LogLevel;
+import com.android.tradefed.device.DeviceNotAvailableException;
+import com.android.tradefed.log.LogUtil.CLog;
+
 /**
  * Set of tests for usecases that apply to profile and device owner.
  * This class is the base class of MixedProfileOwnerTest and MixedDeviceOwnerTest and is abstract
@@ -166,6 +170,11 @@
         }
 
         executeDeviceTestClass(".AccountManagementTest");
+
+        // Send a home intent to dismiss an error dialog.
+        String command = "am start -a android.intent.action.MAIN -c android.intent.category.HOME";
+        CLog.logAndDisplay(LogLevel.INFO, "Output for command " + command + ": "
+                + getDevice().executeShellCommand(command));
     }
 
     protected void executeDeviceTestClass(String className) throws Exception {