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

Commit cff55ed8 authored by Chandru S's avatar Chandru S Committed by Automerger Merge Worker
Browse files

Merge "Use Settings.System.getIntForUser instead of getInt to make sure user...

Merge "Use Settings.System.getIntForUser instead of getInt to make sure user specific settings are used" into udc-dev am: 5c19dbf5

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23265598



Change-Id: I1c3f2409b5cc567071d9c8dfe34b46b4ee72737b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6a79a754 5c19dbf5
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -1602,9 +1602,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
        final ContentResolver cr = mContext.getContentResolver();

        // From SecuritySettings
        final long lockAfterTimeout = Settings.Secure.getInt(cr,
        final long lockAfterTimeout = Settings.Secure.getIntForUser(cr,
                Settings.Secure.LOCK_SCREEN_LOCK_AFTER_TIMEOUT,
                KEYGUARD_LOCK_AFTER_DELAY_DEFAULT);
                KEYGUARD_LOCK_AFTER_DELAY_DEFAULT, userId);

        // From DevicePolicyAdmin
        final long policyTimeout = mLockPatternUtils.getDevicePolicyManager()
@@ -1616,8 +1616,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            timeout = lockAfterTimeout;
        } else {
            // From DisplaySettings
            long displayTimeout = Settings.System.getInt(cr, SCREEN_OFF_TIMEOUT,
                    KEYGUARD_DISPLAY_TIMEOUT_DELAY_DEFAULT);
            long displayTimeout = Settings.System.getIntForUser(cr, SCREEN_OFF_TIMEOUT,
                    KEYGUARD_DISPLAY_TIMEOUT_DELAY_DEFAULT, userId);

            // policy in effect. Make sure we don't go beyond policy limit.
            displayTimeout = Math.max(displayTimeout, 0); // ignore negative values
@@ -2469,7 +2469,10 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
    private void playSound(int soundId) {
        if (soundId == 0) return;
        final ContentResolver cr = mContext.getContentResolver();
        if (Settings.System.getInt(cr, Settings.System.LOCKSCREEN_SOUNDS_ENABLED, 1) == 1) {
        int lockscreenSoundsEnabled = Settings.System.getIntForUser(cr,
                Settings.System.LOCKSCREEN_SOUNDS_ENABLED, 1,
                KeyguardUpdateMonitor.getCurrentUser());
        if (lockscreenSoundsEnabled == 1) {

            mLockSounds.stop(mLockSoundStreamId);
            // Init mAudioManager