Merge "Revert "Revert "Removing workaround for battery defender""" into sc-v2-dev am: b3e8d11b9f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15476265 Change-Id: If676f2d6c42beb45407961740df93ed98554b779
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user