Loading packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +7 −4 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static com.android.keyguard.KeyguardClockSwitch.SMALL; import android.app.WallpaperManager; import android.content.res.Resources; import android.database.ContentObserver; import android.os.UserHandle; import android.provider.Settings; import android.text.TextUtils; import android.view.View; Loading Loading @@ -264,10 +265,11 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mKeyguardUnlockAnimationController.setLockscreenSmartspace(mSmartspaceView); } mSecureSettings.registerContentObserver( mSecureSettings.registerContentObserverForUser( Settings.Secure.getUriFor(Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK), false, /* notifyForDescendants */ mDoubleLineClockObserver mDoubleLineClockObserver, UserHandle.USER_ALL ); updateDoubleLineClock(); Loading Loading @@ -476,8 +478,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS } private void updateDoubleLineClock() { mCanShowDoubleLineClock = mSecureSettings.getInt( Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, 1) != 0; mCanShowDoubleLineClock = mSecureSettings.getIntForUser( Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, 1, UserHandle.USER_CURRENT) != 0; if (!mCanShowDoubleLineClock) { mUiExecutor.execute(() -> displayClock(KeyguardClockSwitch.SMALL, /* animate */ true)); Loading packages/SystemUI/src/com/android/systemui/controls/dagger/ControlsComponent.kt +6 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.controls.dagger import android.content.ContentResolver import android.content.Context import android.database.ContentObserver import android.os.UserHandle import android.provider.Settings import com.android.systemui.controls.controller.ControlsController import com.android.systemui.controls.management.ControlsListingController Loading Loading @@ -73,10 +74,11 @@ class ControlsComponent @Inject constructor( init { if (featureEnabled) { secureSettings.registerContentObserver( secureSettings.registerContentObserverForUser( Settings.Secure.getUriFor(Settings.Secure.LOCKSCREEN_SHOW_CONTROLS), false, /* notifyForDescendants */ showWhileLockedObserver showWhileLockedObserver, UserHandle.USER_ALL ) updateShowWhileLocked() } Loading Loading @@ -123,8 +125,8 @@ class ControlsComponent @Inject constructor( } private fun updateShowWhileLocked() { canShowWhileLockedSetting = secureSettings.getInt( Settings.Secure.LOCKSCREEN_SHOW_CONTROLS, 0) != 0 canShowWhileLockedSetting = secureSettings.getIntForUser( Settings.Secure.LOCKSCREEN_SHOW_CONTROLS, 0, UserHandle.USER_CURRENT) != 0 } enum class Visibility { Loading packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt +20 −14 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.pm.ResolveInfo import android.database.ContentObserver import android.net.Uri import android.os.Handler import android.os.UserHandle import android.os.VibrationEffect import android.provider.Settings.Secure import android.service.controls.Control Loading Loading @@ -74,10 +75,10 @@ class ControlActionCoordinatorImpl @Inject constructor( private var actionsInProgress = mutableSetOf<String>() private val isLocked: Boolean get() = !keyguardStateController.isUnlocked() private var mAllowTrivialControls: Boolean = secureSettings.getInt( Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 0) != 0 private var mShowDeviceControlsInLockscreen: Boolean = secureSettings.getInt( Secure.LOCKSCREEN_SHOW_CONTROLS, 0) != 0 private var mAllowTrivialControls: Boolean = secureSettings.getIntForUser( Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 0, UserHandle.USER_CURRENT) != 0 private var mShowDeviceControlsInLockscreen: Boolean = secureSettings.getIntForUser( Secure.LOCKSCREEN_SHOW_CONTROLS, 0, UserHandle.USER_CURRENT) != 0 override lateinit var activityContext: Context companion object { Loading @@ -95,23 +96,25 @@ class ControlActionCoordinatorImpl @Inject constructor( super.onChange(selfChange, uri) when (uri) { lockScreenShowControlsUri -> { mAllowTrivialControls = secureSettings.getInt( Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 0) != 0 mAllowTrivialControls = secureSettings.getIntForUser( Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 0, UserHandle.USER_CURRENT) != 0 } showControlsUri -> { mShowDeviceControlsInLockscreen = secureSettings .getInt(Secure.LOCKSCREEN_SHOW_CONTROLS, 0) != 0 .getIntForUser(Secure.LOCKSCREEN_SHOW_CONTROLS, 0, UserHandle.USER_CURRENT) != 0 } } } } secureSettings.registerContentObserver( secureSettings.registerContentObserverForUser( lockScreenShowControlsUri, false /* notifyForDescendants */, controlsContentObserver false /* notifyForDescendants */, controlsContentObserver, UserHandle.USER_ALL ) secureSettings.registerContentObserver( secureSettings.registerContentObserverForUser( showControlsUri, false /* notifyForDescendants */, controlsContentObserver false /* notifyForDescendants */, controlsContentObserver, UserHandle.USER_ALL ) } Loading Loading @@ -311,7 +314,8 @@ class ControlActionCoordinatorImpl @Inject constructor( MAX_NUMBER_ATTEMPTS_CONTROLS_DIALOG) .commit() } secureSettings.putInt(Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 1) secureSettings.putIntForUser(Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 1, UserHandle.USER_CURRENT) true } .create() Loading @@ -325,8 +329,10 @@ class ControlActionCoordinatorImpl @Inject constructor( MAX_NUMBER_ATTEMPTS_CONTROLS_DIALOG) .commit() } secureSettings.putInt(Secure.LOCKSCREEN_SHOW_CONTROLS, 1) secureSettings.putInt(Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 1) secureSettings.putIntForUser(Secure.LOCKSCREEN_SHOW_CONTROLS, 1, UserHandle.USER_CURRENT) secureSettings.putIntForUser(Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 1, UserHandle.USER_CURRENT) true } .create() Loading packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebug.java +5 −2 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.content.IntentFilter; import android.content.res.Resources; import android.os.Bundle; import android.os.RemoteException; import android.os.UserHandle; import android.util.Log; import androidx.annotation.NonNull; Loading Loading @@ -210,7 +211,8 @@ public class FeatureFlagsDebug implements FeatureFlags, Dumpable { Log.w(TAG, "Failed to set id " + id + " to " + value); return; } mSecureSettings.putString(mFlagManager.idToSettingsKey(id), data); mSecureSettings.putStringForUser(mFlagManager.idToSettingsKey(id), data, UserHandle.USER_CURRENT); Log.i(TAG, "Set id " + id + " to " + value); removeFromCache(id); mFlagManager.dispatchListenersAndMaybeRestart(id, this::restartSystemUI); Loading Loading @@ -238,7 +240,8 @@ public class FeatureFlagsDebug implements FeatureFlags, Dumpable { /** Works just like {@link #eraseFlag(int)} except that it doesn't restart SystemUI. */ private void eraseInternal(int id) { // We can't actually "erase" things from sysprops, but we can set them to empty! mSecureSettings.putString(mFlagManager.idToSettingsKey(id), ""); mSecureSettings.putStringForUser(mFlagManager.idToSettingsKey(id), "", UserHandle.USER_CURRENT); Log.i(TAG, "Erase id " + id); } Loading packages/SystemUI/src/com/android/systemui/hdmi/HdmiCecSetMenuLanguageHelper.java +5 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.hdmi; import android.os.UserHandle; import android.provider.Settings; import com.android.internal.app.LocalePicker; Loading Loading @@ -50,8 +51,8 @@ public class HdmiCecSetMenuLanguageHelper { SecureSettings secureSettings) { mBackgroundExecutor = executor; mSecureSettings = secureSettings; String denylist = mSecureSettings.getString( Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST); String denylist = mSecureSettings.getStringForUser( Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, UserHandle.USER_CURRENT); mDenylist = new HashSet<>(denylist == null ? Collections.EMPTY_SET : Arrays.asList(denylist.split(SEPARATOR))); Loading Loading @@ -91,7 +92,7 @@ public class HdmiCecSetMenuLanguageHelper { */ public void declineLocale() { mDenylist.add(mLocale.toLanguageTag()); mSecureSettings.putString(Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, String.join(SEPARATOR, mDenylist)); mSecureSettings.putStringForUser(Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, String.join(SEPARATOR, mDenylist), UserHandle.USER_CURRENT); } } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +7 −4 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static com.android.keyguard.KeyguardClockSwitch.SMALL; import android.app.WallpaperManager; import android.content.res.Resources; import android.database.ContentObserver; import android.os.UserHandle; import android.provider.Settings; import android.text.TextUtils; import android.view.View; Loading Loading @@ -264,10 +265,11 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mKeyguardUnlockAnimationController.setLockscreenSmartspace(mSmartspaceView); } mSecureSettings.registerContentObserver( mSecureSettings.registerContentObserverForUser( Settings.Secure.getUriFor(Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK), false, /* notifyForDescendants */ mDoubleLineClockObserver mDoubleLineClockObserver, UserHandle.USER_ALL ); updateDoubleLineClock(); Loading Loading @@ -476,8 +478,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS } private void updateDoubleLineClock() { mCanShowDoubleLineClock = mSecureSettings.getInt( Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, 1) != 0; mCanShowDoubleLineClock = mSecureSettings.getIntForUser( Settings.Secure.LOCKSCREEN_USE_DOUBLE_LINE_CLOCK, 1, UserHandle.USER_CURRENT) != 0; if (!mCanShowDoubleLineClock) { mUiExecutor.execute(() -> displayClock(KeyguardClockSwitch.SMALL, /* animate */ true)); Loading
packages/SystemUI/src/com/android/systemui/controls/dagger/ControlsComponent.kt +6 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.controls.dagger import android.content.ContentResolver import android.content.Context import android.database.ContentObserver import android.os.UserHandle import android.provider.Settings import com.android.systemui.controls.controller.ControlsController import com.android.systemui.controls.management.ControlsListingController Loading Loading @@ -73,10 +74,11 @@ class ControlsComponent @Inject constructor( init { if (featureEnabled) { secureSettings.registerContentObserver( secureSettings.registerContentObserverForUser( Settings.Secure.getUriFor(Settings.Secure.LOCKSCREEN_SHOW_CONTROLS), false, /* notifyForDescendants */ showWhileLockedObserver showWhileLockedObserver, UserHandle.USER_ALL ) updateShowWhileLocked() } Loading Loading @@ -123,8 +125,8 @@ class ControlsComponent @Inject constructor( } private fun updateShowWhileLocked() { canShowWhileLockedSetting = secureSettings.getInt( Settings.Secure.LOCKSCREEN_SHOW_CONTROLS, 0) != 0 canShowWhileLockedSetting = secureSettings.getIntForUser( Settings.Secure.LOCKSCREEN_SHOW_CONTROLS, 0, UserHandle.USER_CURRENT) != 0 } enum class Visibility { Loading
packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt +20 −14 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.pm.ResolveInfo import android.database.ContentObserver import android.net.Uri import android.os.Handler import android.os.UserHandle import android.os.VibrationEffect import android.provider.Settings.Secure import android.service.controls.Control Loading Loading @@ -74,10 +75,10 @@ class ControlActionCoordinatorImpl @Inject constructor( private var actionsInProgress = mutableSetOf<String>() private val isLocked: Boolean get() = !keyguardStateController.isUnlocked() private var mAllowTrivialControls: Boolean = secureSettings.getInt( Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 0) != 0 private var mShowDeviceControlsInLockscreen: Boolean = secureSettings.getInt( Secure.LOCKSCREEN_SHOW_CONTROLS, 0) != 0 private var mAllowTrivialControls: Boolean = secureSettings.getIntForUser( Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 0, UserHandle.USER_CURRENT) != 0 private var mShowDeviceControlsInLockscreen: Boolean = secureSettings.getIntForUser( Secure.LOCKSCREEN_SHOW_CONTROLS, 0, UserHandle.USER_CURRENT) != 0 override lateinit var activityContext: Context companion object { Loading @@ -95,23 +96,25 @@ class ControlActionCoordinatorImpl @Inject constructor( super.onChange(selfChange, uri) when (uri) { lockScreenShowControlsUri -> { mAllowTrivialControls = secureSettings.getInt( Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 0) != 0 mAllowTrivialControls = secureSettings.getIntForUser( Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 0, UserHandle.USER_CURRENT) != 0 } showControlsUri -> { mShowDeviceControlsInLockscreen = secureSettings .getInt(Secure.LOCKSCREEN_SHOW_CONTROLS, 0) != 0 .getIntForUser(Secure.LOCKSCREEN_SHOW_CONTROLS, 0, UserHandle.USER_CURRENT) != 0 } } } } secureSettings.registerContentObserver( secureSettings.registerContentObserverForUser( lockScreenShowControlsUri, false /* notifyForDescendants */, controlsContentObserver false /* notifyForDescendants */, controlsContentObserver, UserHandle.USER_ALL ) secureSettings.registerContentObserver( secureSettings.registerContentObserverForUser( showControlsUri, false /* notifyForDescendants */, controlsContentObserver false /* notifyForDescendants */, controlsContentObserver, UserHandle.USER_ALL ) } Loading Loading @@ -311,7 +314,8 @@ class ControlActionCoordinatorImpl @Inject constructor( MAX_NUMBER_ATTEMPTS_CONTROLS_DIALOG) .commit() } secureSettings.putInt(Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 1) secureSettings.putIntForUser(Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 1, UserHandle.USER_CURRENT) true } .create() Loading @@ -325,8 +329,10 @@ class ControlActionCoordinatorImpl @Inject constructor( MAX_NUMBER_ATTEMPTS_CONTROLS_DIALOG) .commit() } secureSettings.putInt(Secure.LOCKSCREEN_SHOW_CONTROLS, 1) secureSettings.putInt(Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 1) secureSettings.putIntForUser(Secure.LOCKSCREEN_SHOW_CONTROLS, 1, UserHandle.USER_CURRENT) secureSettings.putIntForUser(Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS, 1, UserHandle.USER_CURRENT) true } .create() Loading
packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebug.java +5 −2 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.content.IntentFilter; import android.content.res.Resources; import android.os.Bundle; import android.os.RemoteException; import android.os.UserHandle; import android.util.Log; import androidx.annotation.NonNull; Loading Loading @@ -210,7 +211,8 @@ public class FeatureFlagsDebug implements FeatureFlags, Dumpable { Log.w(TAG, "Failed to set id " + id + " to " + value); return; } mSecureSettings.putString(mFlagManager.idToSettingsKey(id), data); mSecureSettings.putStringForUser(mFlagManager.idToSettingsKey(id), data, UserHandle.USER_CURRENT); Log.i(TAG, "Set id " + id + " to " + value); removeFromCache(id); mFlagManager.dispatchListenersAndMaybeRestart(id, this::restartSystemUI); Loading Loading @@ -238,7 +240,8 @@ public class FeatureFlagsDebug implements FeatureFlags, Dumpable { /** Works just like {@link #eraseFlag(int)} except that it doesn't restart SystemUI. */ private void eraseInternal(int id) { // We can't actually "erase" things from sysprops, but we can set them to empty! mSecureSettings.putString(mFlagManager.idToSettingsKey(id), ""); mSecureSettings.putStringForUser(mFlagManager.idToSettingsKey(id), "", UserHandle.USER_CURRENT); Log.i(TAG, "Erase id " + id); } Loading
packages/SystemUI/src/com/android/systemui/hdmi/HdmiCecSetMenuLanguageHelper.java +5 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.hdmi; import android.os.UserHandle; import android.provider.Settings; import com.android.internal.app.LocalePicker; Loading Loading @@ -50,8 +51,8 @@ public class HdmiCecSetMenuLanguageHelper { SecureSettings secureSettings) { mBackgroundExecutor = executor; mSecureSettings = secureSettings; String denylist = mSecureSettings.getString( Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST); String denylist = mSecureSettings.getStringForUser( Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, UserHandle.USER_CURRENT); mDenylist = new HashSet<>(denylist == null ? Collections.EMPTY_SET : Arrays.asList(denylist.split(SEPARATOR))); Loading Loading @@ -91,7 +92,7 @@ public class HdmiCecSetMenuLanguageHelper { */ public void declineLocale() { mDenylist.add(mLocale.toLanguageTag()); mSecureSettings.putString(Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, String.join(SEPARATOR, mDenylist)); mSecureSettings.putStringForUser(Settings.Secure.HDMI_CEC_SET_MENU_LANGUAGE_DENYLIST, String.join(SEPARATOR, mDenylist), UserHandle.USER_CURRENT); } }