From ed53d1c21cd055b753be212a374231d61fdc2f02 Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Thu, 5 Aug 2021 20:51:24 +0000 Subject: [PATCH] Revert "Revert "Removing workaround for battery defender"" This reverts commit f9ccf0175dc56049abfa067704dbd81af16331cc. Reason for revert: to see whether b/151613234 is fixed Test: pre-, post- submit Bug: 151613234 Change-Id: Ieda2907319d796a57494318920c22f3db4527dab --- .../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 dcb6dc1b02..0d5b9adc59 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -254,26 +254,12 @@ 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 { mLauncher.onTestStart(); - 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, which is likely caused by a crash in SysUI", TestHelpers.wait( Until.gone(By.res(SYSTEMUI_PACKAGE, "keyguard_status_view")), 60000)); - Log.d(TAG, "Keyguard is not visible"); final String launcherPackageName = mDevice.getLauncherPackageName(); try {