Go home before starting AwareActivity.

We've seen bugreports with race conditions around activity launches,
so wait until idle, get ourselves back to the home screen, and then
launch AwareActivity.

Bug: 77785099
Bug: 79932900
Bug: 136192459
Test: atest android.appsecurity.cts.DirectBootHostTest
Change-Id: Id3f5ac103a4f9bb404954cb305ee5be28e00bf26
Merged-In: Id3f5ac103a4f9bb404954cb305ee5be28e00bf26
(cherry picked from commit e0e48fae6058cf06bfd939216eeb16ddd898f0aa)
(cherry picked from commit 8bc38da9b94e88979186408b4c1c7d27374c1797)
diff --git a/hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java b/hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java
index 37744fa..6f65faf 100644
--- a/hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java
+++ b/hostsidetests/appsecurity/test-apps/EncryptionApp/src/com/android/cts/encryptionapp/EncryptionAppTest.java
@@ -172,6 +172,9 @@
         mDevice.pressMenu();
         mDevice.waitForIdle();
         enterTestPin();
+        mDevice.waitForIdle();
+        mDevice.pressHome();
+        mDevice.waitForIdle();
     }
 
     public void assertLocked() throws Exception {