Don't allow dreaming for users that can't dream.
DreamManagerService#canStartDreaming should not return true if the current user is not allowed to dream. Bug: 261907079 Test: manually by switching to a user that can't dream and making sure that the screen turns off on power press while docked. Change-Id: Ia4a46dff5360d3565762b82fb4353e66f0b8f661
This commit is contained in:
@@ -379,6 +379,10 @@ public final class DreamManagerService extends SystemService {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!dreamsEnabledForUser(ActivityManager.getCurrentUser())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((mWhenToDream & DREAM_ON_CHARGE) == DREAM_ON_CHARGE) {
|
||||
return mIsCharging;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user