Adding more checks around unlocking the phone

Bug: 151613234
Change-Id: I045306cce2ce85d6895c9f050ebb4d2bd15ba232
This commit is contained in:
vadimt
2020-03-20 18:55:53 -07:00
parent f946e0a5ee
commit 330fde4aaf

View File

@@ -220,7 +220,9 @@ public abstract class AbstractLauncherUiTest {
@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");
if (hasSystemUiObject("keyguard_status_view")) {
Log.d(TAG, "Before unlocking the phone");
@@ -228,6 +230,9 @@ public abstract class AbstractLauncherUiTest {
} else {
Log.d(TAG, "Phone isn't locked");
}
Assert.assertTrue("Keyguard still visible",
mDevice.wait(Until.gone(By.res(SYSTEMUI_PACKAGE, "keyguard_status_view")), 10000));
Log.d(TAG, "Keyguard is not visible");
final String launcherPackageName = mDevice.getLauncherPackageName();
try {