Skip to content

Commit b902cae

Browse files
ponces3EleVen
authored andcommitted
SystemUI: Fix Wakelock issue
Prevent SystemUI crash due to "WakeLock under-locked Doze" (issue MoKee#12) by only releasing a wakelock that was not already released Change-Id: I1419c371953de648f580d2b5447b1d3a87ef5903
1 parent 87c97bc commit b902cae

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • packages/SystemUI/src/com/android/systemui/util/wakelock

packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ public void release(String why) {
109109
} else {
110110
mActiveClients.put(why, count - 1);
111111
}
112-
inner.release();
112+
if (inner.isHeld()) {
113+
inner.release();
114+
}
113115
}
114116

115117
/** @see PowerManager.WakeLock#wrap(Runnable) */

0 commit comments

Comments
 (0)