diff options
author | Alex Salo <asalo@google.com> | 2020-04-13 20:39:58 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-04-13 20:39:58 +0000 |
commit | f9551ba4e1a07deba4e172844782e0a3a3acbfe7 (patch) | |
tree | a40037d5e81b847f182465cc38eb671c5da5ecb1 | |
parent | a13956797ea2d2fb3619006e621ef444a692a7d9 (diff) | |
parent | e0d25ed36f65175a39d459ff65b67dbc5db42749 (diff) |
Merge "Fix adaptive_sleep resetting after reboot" into rvc-dev
-rw-r--r-- | services/core/java/com/android/server/attention/AttentionManagerService.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/attention/AttentionManagerService.java b/services/core/java/com/android/server/attention/AttentionManagerService.java index 50ec0400a729..e8acbd493180 100644 --- a/services/core/java/com/android/server/attention/AttentionManagerService.java +++ b/services/core/java/com/android/server/attention/AttentionManagerService.java @@ -165,7 +165,7 @@ public class AttentionManagerService extends SystemService { * Returns {@code true} if attention service is supported on this device. */ private boolean isAttentionServiceSupported() { - return isServiceEnabled() && isServiceAvailable(); + return isServiceEnabled() && isServiceConfigured(mContext); } @VisibleForTesting @@ -210,6 +210,11 @@ public class AttentionManagerService extends SystemService { return false; } + if (!isServiceAvailable()) { + Slog.w(LOG_TAG, "Service is not available at this moment."); + return false; + } + // don't allow attention check in screen off state if (!mPowerManager.isInteractive()) { return false; |