RESTRICT AUTOMERGE: Ensure resetFakeUnpluggedState must be called

If the case DeviceIdleJobsTest#testJobsInNeverApp
or DeviceIdleJobsTest#testUidActiveBypassesStandby
which call enterFakeUnpluggedState at first failed,
resetFakeUnpluggedState will not be called,
charging state will still be unplugged.

Then the "Stay awake" will not take effects, screen will
be off, some other cases will be failed as screen off.

Use try-finally to ensure resetFakeUnpluggedState be called.

Bug: 122378965
Test: make CtsJobSchedulerTestCases
Change-Id: I5c844672d70b21ce322a9aa4fb363673dfea41e0
diff --git a/tests/JobScheduler/src/android/jobscheduler/cts/DeviceIdleJobsTest.java b/tests/JobScheduler/src/android/jobscheduler/cts/DeviceIdleJobsTest.java
index e624a62..a10b05f 100644
--- a/tests/JobScheduler/src/android/jobscheduler/cts/DeviceIdleJobsTest.java
+++ b/tests/JobScheduler/src/android/jobscheduler/cts/DeviceIdleJobsTest.java
@@ -191,23 +191,29 @@
         assumeTrue("app standby not enabled", mAppStandbyEnabled);
 
         enterFakeUnpluggedState();
-        setTestPackageStandbyBucket(Bucket.NEVER);
-        Thread.sleep(DEFAULT_WAIT_TIMEOUT);
-        sendScheduleJobBroadcast(false);
-        assertFalse("New job started in NEVER standby", awaitJobStart(3_000));
-        resetFakeUnpluggedState();
+        try {
+            setTestPackageStandbyBucket(Bucket.NEVER);
+            Thread.sleep(DEFAULT_WAIT_TIMEOUT);
+            sendScheduleJobBroadcast(false);
+            assertFalse("New job started in NEVER standby", awaitJobStart(3_000));
+        } finally {
+            resetFakeUnpluggedState();
+        }
     }
 
     @Test
     public void testUidActiveBypassesStandby() throws Exception {
         enterFakeUnpluggedState();
-        setTestPackageStandbyBucket(Bucket.NEVER);
-        tempWhitelistTestApp(6_000);
-        Thread.sleep(DEFAULT_WAIT_TIMEOUT);
-        sendScheduleJobBroadcast(false);
-        assertTrue("New job in uid-active app failed to start in NEVER standby",
-                awaitJobStart(4_000));
-        resetFakeUnpluggedState();
+        try {
+            setTestPackageStandbyBucket(Bucket.NEVER);
+            tempWhitelistTestApp(6_000);
+            Thread.sleep(DEFAULT_WAIT_TIMEOUT);
+            sendScheduleJobBroadcast(false);
+            assertTrue("New job in uid-active app failed to start in NEVER standby",
+                    awaitJobStart(4_000));
+        } finally {
+            resetFakeUnpluggedState();
+        }
     }
 
     @After