From f4bb052ca076fc2fb8d6f29140252b6154c984e1 Mon Sep 17 00:00:00 2001 From: vadimt Date: Thu, 22 Oct 2020 11:14:10 -0700 Subject: [PATCH] Removing workaround for battery defender The bug is supposed to be fixed. Bug: 151613234 Change-Id: I8e803ead29e08e68fa75f61b5ad0e1198c9228ec (cherry picked from commit ff39fd3e14329db22ef34da32b9116fbe39af6f1) --- .../launcher3/ui/AbstractLauncherUiTest.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index e118481570..d3fc89e6be 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -234,25 +234,11 @@ public abstract class AbstractLauncherUiTest { return mDevice; } - private boolean hasSystemUiObject(String resId) { - return mDevice.hasObject(By.res(SYSTEMUI_PACKAGE, resId)); - } - @Before public void setUp() throws Exception { - Log.d(TAG, "Before disabling battery defender"); - mDevice.executeShellCommand("setprop vendor.battery.defender.disable 1"); - Log.d(TAG, "Before enabling stay awake"); - mDevice.executeShellCommand("settings put global stay_on_while_plugged_in 3"); - for (int i = 0; i < 10 && hasSystemUiObject("keyguard_status_view"); ++i) { - Log.d(TAG, "Before unlocking the phone"); - mDevice.executeShellCommand("input keyevent 82"); - mDevice.waitForIdle(); - } - Assert.assertTrue("Keyguard still visible", + Assert.assertTrue("Keyguard is visible", mDevice.wait( Until.gone(By.res(SYSTEMUI_PACKAGE, "keyguard_status_view")), 60000)); - Log.d(TAG, "Keyguard is not visible"); final String launcherPackageName = mDevice.getLauncherPackageName(); try {