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

Commit 4478261d authored by Christine Franks's avatar Christine Franks
Browse files

Prevent querying settings when no active user

Bug: 123527839
Test: atest FrameworksServicesTests:ColorDisplayServiceTest
Change-Id: I402a185844d7cdc50ce2fe1fb60226860cbc6ff8
parent 0304cf83
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1276,11 +1276,17 @@ public final class ColorDisplayService extends SystemService {
        }

        boolean isActivatedSetting() {
            if (mCurrentUser == UserHandle.USER_NULL) {
                return false;
            }
            return Secure.getIntForUser(getContext().getContentResolver(),
                    Secure.NIGHT_DISPLAY_ACTIVATED, 0, mCurrentUser) == 1;
        }

        int getColorTemperatureSetting() {
            if (mCurrentUser == UserHandle.USER_NULL) {
                return NOT_SET;
            }
            return clampNightDisplayColorTemperature(Secure.getIntForUser(
                    getContext().getContentResolver(), Secure.NIGHT_DISPLAY_COLOR_TEMPERATURE,
                    NOT_SET,