Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4bb052c authored by vadimt's avatar vadimt Committed by Vadim Tryshev
Browse files

Removing workaround for battery defender

The bug is supposed to be fixed.

Bug: 151613234
Change-Id: I8e803ead29e08e68fa75f61b5ad0e1198c9228ec
(cherry picked from commit ff39fd3e)
parent 5fa687dd
Loading
Loading
Loading
Loading
+1 −15
Original line number Original line Diff line number Diff line
@@ -234,25 +234,11 @@ public abstract class AbstractLauncherUiTest {
        return mDevice;
        return mDevice;
    }
    }


    private boolean hasSystemUiObject(String resId) {
        return mDevice.hasObject(By.res(SYSTEMUI_PACKAGE, resId));
    }

    @Before
    @Before
    public void setUp() throws Exception {
    public void setUp() throws Exception {
        Log.d(TAG, "Before disabling battery defender");
        Assert.assertTrue("Keyguard is visible",
        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",
                mDevice.wait(
                mDevice.wait(
                        Until.gone(By.res(SYSTEMUI_PACKAGE, "keyguard_status_view")), 60000));
                        Until.gone(By.res(SYSTEMUI_PACKAGE, "keyguard_status_view")), 60000));
        Log.d(TAG, "Keyguard is not visible");


        final String launcherPackageName = mDevice.getLauncherPackageName();
        final String launcherPackageName = mDevice.getLauncherPackageName();
        try {
        try {