1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-24 08:36:19 +00:00
treble_evolution/patches/platform_frameworks_base/0020-Fix-Wakelock-issue.patch
2024-04-24 15:13:17 +00:00

29 lines
1.2 KiB
Diff

From e93d61a31dcf9c2af406dc7ccc78a840ff300575 Mon Sep 17 00:00:00 2001
From: Alberto Ponces <ponces26@gmail.com>
Date: Tue, 2 Feb 2021 10:20:51 +0000
Subject: [PATCH 20/51] Fix Wakelock issue
Prevent SystemUI crash due to "WakeLock under-locked Doze" (issue #12) by only releasing a wakelock that was not already released
---
.../src/com/android/systemui/util/wakelock/WakeLock.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java b/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java
index 6128feee8116..b60905b39e32 100644
--- a/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java
+++ b/packages/SystemUI/src/com/android/systemui/util/wakelock/WakeLock.java
@@ -143,7 +143,9 @@ public interface WakeLock {
if (logger != null) {
logger.logRelease(inner, why, count);
}
- inner.release();
+ if (inner.isHeld()) {
+ inner.release();
+ }
}
/** @see PowerManager.WakeLock#wrap(Runnable) */
--
2.25.1