Merge "Fix adaptive_sleep resetting after reboot" into rvc-dev am: f9551ba4e1

Change-Id: I19523026f9462191562ef052e50e53653f3509bb
This commit is contained in:
Alex Salo
2020-04-13 20:48:24 +00:00
committed by Automerger Merge Worker

View File

@@ -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;