Creates user_switcher_enabled setting to match setting

When the user enters UserSettings, the switch displays the setting as
on, but the setting is not created until the user modifies this for the
first time. This change makes sure that the setting is created when the
user enters UserSettings for the first time.

Fixes: 130270878
Test: manual, switch to second user and observe switcher icons.
Change-Id: I30bc5025c178da3668a76c828c34545c1d98b085
(cherry picked from commit a52961d803)
This commit is contained in:
Fabian Kozynski
2019-04-10 15:22:20 -04:00
committed by android-build-team Robot
parent 8d000bfeaf
commit aaa7aef984

View File

@@ -52,6 +52,8 @@ public class MultiUserSwitchBarController implements SwitchWidgetController.OnSw
mListener = listener;
mUserCapabilities = UserCapabilities.create(context);
mSwitchBar.setChecked(mUserCapabilities.mUserSwitcherEnabled);
Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.USER_SWITCHER_ENABLED, mSwitchBar.isChecked() ? 1 : 0);
if (mUserCapabilities.mDisallowSwitchUser) {
mSwitchBar.setDisabledByAdmin(RestrictedLockUtilsInternal