From 23f50b66665e4dd2bad2f4a7ef4dabb9d63cdae9 Mon Sep 17 00:00:00 2001 From: Alex Salo Date: Mon, 5 Oct 2020 17:56:10 -0700 Subject: [PATCH] Fix lock contention in Attention Call checkAttention() sits in the critical path inside the PowerManager. To avoid the lock contention, don't call into the PackageManager. Specifically, checking the configuration with the PackageManager is redundant since it's already done by SystemServer - it won't start the AttentionManagerService if it's not configured. Bug: 169427927 Test: manually Change-Id: I46ca7a6ce01d2229521f1fe12a80440024465c67 --- .../com/android/server/attention/AttentionManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/attention/AttentionManagerService.java b/services/core/java/com/android/server/attention/AttentionManagerService.java index e128d993ab63f..dbfaffe2a5f1e 100644 --- a/services/core/java/com/android/server/attention/AttentionManagerService.java +++ b/services/core/java/com/android/server/attention/AttentionManagerService.java @@ -172,7 +172,7 @@ public class AttentionManagerService extends SystemService { */ @VisibleForTesting protected boolean isAttentionServiceSupported() { - return isServiceEnabled() && isServiceConfigured(mContext); + return isServiceEnabled(); } private boolean isServiceEnabled() {