Loading services/core/java/com/android/server/power/AttentionDetector.java +4 −3 Original line number Original line Diff line number Diff line Loading @@ -172,12 +172,13 @@ public class AttentionDetector { public long updateUserActivity(long nextScreenDimming) { public long updateUserActivity(long nextScreenDimming) { if (nextScreenDimming == mLastActedOnNextScreenDimming if (nextScreenDimming == mLastActedOnNextScreenDimming || !mIsSettingEnabled || !mIsSettingEnabled || !isAttentionServiceSupported() || mWindowManager.isKeyguardShowingAndNotOccluded()) { || mWindowManager.isKeyguardShowingAndNotOccluded()) { return nextScreenDimming; return nextScreenDimming; } } if (!serviceHasSufficientPermissions()) { if (!isAttentionServiceSupported() || !serviceHasSufficientPermissions()) { // Turns off adaptive sleep in settings for all users if attention service is not // available. The setting itself should also be grayed out in this case. Settings.System.putInt(mContentResolver, ADAPTIVE_SLEEP, 0); Settings.System.putInt(mContentResolver, ADAPTIVE_SLEEP, 0); return nextScreenDimming; return nextScreenDimming; } } Loading Loading
services/core/java/com/android/server/power/AttentionDetector.java +4 −3 Original line number Original line Diff line number Diff line Loading @@ -172,12 +172,13 @@ public class AttentionDetector { public long updateUserActivity(long nextScreenDimming) { public long updateUserActivity(long nextScreenDimming) { if (nextScreenDimming == mLastActedOnNextScreenDimming if (nextScreenDimming == mLastActedOnNextScreenDimming || !mIsSettingEnabled || !mIsSettingEnabled || !isAttentionServiceSupported() || mWindowManager.isKeyguardShowingAndNotOccluded()) { || mWindowManager.isKeyguardShowingAndNotOccluded()) { return nextScreenDimming; return nextScreenDimming; } } if (!serviceHasSufficientPermissions()) { if (!isAttentionServiceSupported() || !serviceHasSufficientPermissions()) { // Turns off adaptive sleep in settings for all users if attention service is not // available. The setting itself should also be grayed out in this case. Settings.System.putInt(mContentResolver, ADAPTIVE_SLEEP, 0); Settings.System.putInt(mContentResolver, ADAPTIVE_SLEEP, 0); return nextScreenDimming; return nextScreenDimming; } } Loading