Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6000e21 authored by Will Leshner's avatar Will Leshner
Browse files

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
parent 1f9eb488
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;
            }