1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-24 12:06:19 +00:00
treble_evolution/patches/trebledroid/platform_frameworks_base/0020-Fix-Wakelock-issue.patch
2024-03-10 06:48:11 +00:00

29 lines
1.2 KiB
Diff

From e9112a8f5277e3b4e2954bed30d016acba8fddb0 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/56] 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