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
This commit is contained in:
Fabian Kozynski
2019-04-10 15:22:20 -04:00
parent f1cea95f3e
commit a52961d803

View File

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