Fix bug in removal of lock screen in test

Exception in unlocking can prevent running rest of the shell commands
needed to remove the lock screen. Unlock can fail screen is already
unlocked.

Bug: 247983024
Test: atest SdkSandboxStorageHostTest
Change-Id: I7f19e1e82ce314c22d12635f461bd6eab387fe31
diff --git a/sdksandbox/tests/hostsidetests/SdkSandboxStorageHostTest/src/com/android/tests/sdksandbox/host/SdkSandboxStorageHostTest.java b/sdksandbox/tests/hostsidetests/SdkSandboxStorageHostTest/src/com/android/tests/sdksandbox/host/SdkSandboxStorageHostTest.java
index 7bead17..2ca089d 100644
--- a/sdksandbox/tests/hostsidetests/SdkSandboxStorageHostTest/src/com/android/tests/sdksandbox/host/SdkSandboxStorageHostTest.java
+++ b/sdksandbox/tests/hostsidetests/SdkSandboxStorageHostTest/src/com/android/tests/sdksandbox/host/SdkSandboxStorageHostTest.java
@@ -1250,8 +1250,6 @@
 
         private final BaseHostJUnit4Test mTest;
 
-        private boolean mIsDeviceLocked = false;
-
         DeviceLockUtils(BaseHostJUnit4Test test) {
             mTest = test;
         }
@@ -1286,8 +1284,6 @@
                 mTest.getDevice().rebootUntilOnline();
             }
             waitForBootCompleted(mTest.getDevice());
-
-            mIsDeviceLocked = true;
         }
 
         public void clearScreenLock() throws Exception {
@@ -1312,14 +1308,13 @@
         }
 
         public void unlockDevice() throws Exception {
-            if (!mIsDeviceLocked) return;
-            assertThat(
-                            mTest.runDeviceTests(
-                                    "com.android.cts.appdataisolation.appa",
-                                    "com.android.cts.appdataisolation.appa.AppATests",
-                                    "testUnlockDevice"))
-                    .isTrue();
-            mIsDeviceLocked = false;
+            try {
+                mTest.runDeviceTests(
+                        "com.android.cts.appdataisolation.appa",
+                        "com.android.cts.appdataisolation.appa.AppATests",
+                        "testUnlockDevice");
+            } catch (Exception ignore) {
+            }
         }
 
         private boolean isFbeModeEmulated() throws Exception {