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

Commit 0533a1bf authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Release WakeLock on unaquired lock doesn't throw"

parents 187e7063 03d290ae
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.util.wakelock;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import android.os.Build;
import android.os.PowerManager;

import androidx.test.filters.SmallTest;
@@ -85,4 +86,14 @@ public class WakeLockTest extends SysuiTestCase {
        assertTrue(ran[0]);
        assertFalse(mInner.isHeld());
    }

    @Test
    public void prodBuild_wakeLock_releaseWithoutAcquire_noThrow() {
        if (Build.IS_ENG) {
            return;
        }

        // shouldn't throw an exception on production builds
        mWakeLock.release(WHY);
    }
}
 No newline at end of file