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

Commit 18396451 authored by Evan Rosky's avatar Evan Rosky
Browse files

Add support for custom user-switch UI

Given config_customUserSwitchUi, AM/UserController will not show any
UI during user-switch (no dialog or screen-freeze).

Provides a mechanism (WM.setSwitchingUser) by which a custom user-switch
UI can notify WM/Keyguard when it expects a user-switch operation to
be running.

Bug: 29329555
Change-Id: Ic903fc251d7ec3a54bc6a77906d3afa45a6a5fac
parent 5c84a4bc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -210,6 +210,9 @@ interface IWindowManager
    void dismissKeyguard();
    void keyguardGoingAway(int flags);

    // Requires INTERACT_ACROSS_USERS_FULL permission
    void setSwitchingUser(boolean switching);

    void closeSystemDialogs(String reason);

    // These can only be called with the SET_ANIMATON_SCALE permission.
+9 −0
Original line number Diff line number Diff line
@@ -1346,6 +1346,15 @@ public interface WindowManagerPolicy {
     */
    public void setCurrentUserLw(int newUserId);

    /**
     * For a given user-switch operation, this will be called once with switching=true before the
     * user-switch and once with switching=false afterwards (or if the user-switch was cancelled).
     * This gives the policy a chance to alter its behavior for the duration of a user-switch.
     *
     * @param switching true if a user-switch is in progress
     */
    void setSwitchingUser(boolean switching);

    /**
     * Print the WindowManagerPolicy's state into the given stream.
     *
+1 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ oneway interface IKeyguardService {
    void setKeyguardEnabled(boolean enabled);
    void onSystemReady();
    void doKeyguardTimeout(in Bundle options);
    void setSwitchingUser(boolean switching);
    void setCurrentUser(int userId);
    void onBootCompleted();

+5 −0
Original line number Diff line number Diff line
@@ -2540,4 +2540,9 @@

    <string name="config_networkOverLimitComponent" translatable="false">com.android.systemui/com.android.systemui.net.NetworkOverLimitActivity</string>
    <string name="config_dataUsageSummaryComponent" translatable="false">com.android.settings/com.android.settings.Settings$DataUsageSummaryActivity</string>

    <!-- Flag specifying whether user-switch operations have custom UI. When false, user-switch
         UI is handled by ActivityManagerService -->
    <bool name="config_customUserSwitchUi">false</bool>

</resources>
+1 −0
Original line number Diff line number Diff line
@@ -1482,6 +1482,7 @@
  <java-symbol type="bool" name="config_allowAllRotations" />
  <java-symbol type="bool" name="config_annoy_dianne" />
  <java-symbol type="bool" name="config_carDockEnablesAccelerometer" />
  <java-symbol type="bool" name="config_customUserSwitchUi" />
  <java-symbol type="bool" name="config_deskDockEnablesAccelerometer" />
  <java-symbol type="bool" name="config_disableMenuKeyInLockScreen" />
  <java-symbol type="bool" name="config_enableCarDockHomeLaunch" />
Loading