Some fingerprint devices need double-confirmation.

A new flow was recently added for fingerprints, so we might need to
pick the "none" option twice in order to clear the PIN set by earlier
tests.

Test: cts-tradefed run cts-dev --module CtsAppSecurityHostTestCases --test android.appsecurity.cts.DirectBootHostTest
Bug: 31160946
Change-Id: I3c63cb687bc90653bf78802e0da7ebee7b2e907e
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 531511c..f00592f 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
@@ -161,6 +161,14 @@
         view.click();
         mDevice.waitForIdle();
 
+        // Yes, we really want "none" if prompted again
+        view = new UiObject(new UiSelector()
+                .resourceId("com.android.settings:id/lock_none"));
+        if (view.waitForExists(TIMEOUT)) {
+            view.click();
+            mDevice.waitForIdle();
+        }
+
         // Yes, we really want to
         view = new UiObject(new UiSelector()
                 .resourceId("android:id/button1"));