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

Commit 51a46eb4 authored by Denis Kuznetsov's avatar Denis Kuznetsov Committed by Android (Google) Code Review
Browse files

Merge "Add configuration parameters to control user switcher behavior" into main

parents e10eee81 38a84918
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -6003,6 +6003,12 @@
    <!-- If true, show multiuser switcher by default unless the user specifically disables it. -->
    <bool name="config_showUserSwitcherByDefault">false</bool>

    <!-- If true, user can change state of multiuser switcher. -->
    <bool name="config_allowChangeUserSwitcherEnabled">true</bool>

    <!-- If true, multiuser switcher would be automatically enabled when second user is created on the device. -->
    <bool name="config_enableUserSwitcherUponUserCreation">true</bool>

    <!-- Set to true to make assistant show in front of the dream/screensaver. -->
    <bool name="config_assistantOnTopOfDream">false</bool>

+2 −0
Original line number Diff line number Diff line
@@ -4695,6 +4695,8 @@

  <!-- If true, show multiuser switcher by default unless the user specifically disables it. -->
  <java-symbol type="bool" name="config_showUserSwitcherByDefault" />
  <java-symbol type="bool" name="config_allowChangeUserSwitcherEnabled" />
  <java-symbol type="bool" name="config_enableUserSwitcherUponUserCreation" />

  <!-- Set to true to make assistant show in front of the dream/screensaver. -->
  <java-symbol type="bool" name="config_assistantOnTopOfDream"/>
+5 −2
Original line number Diff line number Diff line
@@ -6122,11 +6122,14 @@ public class UserManagerService extends IUserManager.Stub {
            // If the user switch hasn't been explicitly toggled on or off by the user, turn it on.
            if (android.provider.Settings.Global.getString(mContext.getContentResolver(),
                    android.provider.Settings.Global.USER_SWITCHER_ENABLED) == null) {
                if (Resources.getSystem().getBoolean(
                        com.android.internal.R.bool.config_enableUserSwitcherUponUserCreation)) {
                    android.provider.Settings.Global.putInt(mContext.getContentResolver(),
                            android.provider.Settings.Global.USER_SWITCHER_ENABLED, 1);
                }
            }
        }
    }

    /**
     * Gets a pre-created user for the given user type.