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

Commit c837e4bc authored by Evan Rosky's avatar Evan Rosky Committed by Android (Google) Code Review
Browse files

Merge changes Idfd40156,Ic903fc25

* changes:
  Make user-switch transitions customizable
  Add support for custom user-switch UI
parents 8c06f146 13a58a91
Loading
Loading
Loading
Loading
+19 −0
Original line number Original line Diff line number Diff line
@@ -748,6 +748,15 @@ public class UserManager {
        return SystemProperties.getBoolean("ro.fw.system_user_split", false);
        return SystemProperties.getBoolean("ro.fw.system_user_split", false);
    }
    }


    /**
     * @return Whether guest user is always ephemeral
     * @hide
     */
    public static boolean isGuestUserEphemeral() {
        return Resources.getSystem()
                .getBoolean(com.android.internal.R.bool.config_guestUserEphemeral);
    }

    /**
    /**
     * Returns whether switching users is currently allowed.
     * Returns whether switching users is currently allowed.
     * <p>For instance switching users is not allowed if the current user is in a phone call,
     * <p>For instance switching users is not allowed if the current user is in a phone call,
@@ -870,6 +879,16 @@ public class UserManager {
        }
        }
    }
    }


    /**
     * Checks if a user is a guest user.
     * @return whether user is a guest user.
     * @hide
     */
    public boolean isGuestUser(int id) {
        UserInfo user = getUserInfo(id);
        return user != null && user.isGuest();
    }

    /**
    /**
     * Checks if the calling app is running as a guest user.
     * Checks if the calling app is running as a guest user.
     * @return whether the caller is a guest user.
     * @return whether the caller is a guest user.
+13 −0
Original line number Original line Diff line number Diff line
@@ -210,6 +210,19 @@ interface IWindowManager
    void dismissKeyguard();
    void dismissKeyguard();
    void keyguardGoingAway(int flags);
    void keyguardGoingAway(int flags);


    /**
     * Called to tell WindowManager whether the keyguard is animating in. While this property
     * is true, WindowManager won't assume that the keyguard is opaque (eg. WindowAnimator won't
     * force-hide windows just because keyguard is visible and WallpaperController won't occlude
     * app windows with the system wallpaper.
     *
     * <p>Requires CONTROL_KEYGUARD permission</p>
     */
    void setKeyguardAnimatingIn(boolean animating);

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

    void closeSystemDialogs(String reason);
    void closeSystemDialogs(String reason);


    // These can only be called with the SET_ANIMATON_SCALE permission.
    // These can only be called with the SET_ANIMATON_SCALE permission.
+9 −0
Original line number Original line Diff line number Diff line
@@ -1346,6 +1346,15 @@ public interface WindowManagerPolicy {
     */
     */
    public void setCurrentUserLw(int newUserId);
    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.
     * Print the WindowManagerPolicy's state into the given stream.
     *
     *
+1 −0
Original line number Original line Diff line number Diff line
@@ -80,6 +80,7 @@ oneway interface IKeyguardService {
    void setKeyguardEnabled(boolean enabled);
    void setKeyguardEnabled(boolean enabled);
    void onSystemReady();
    void onSystemReady();
    void doKeyguardTimeout(in Bundle options);
    void doKeyguardTimeout(in Bundle options);
    void setSwitchingUser(boolean switching);
    void setCurrentUser(int userId);
    void setCurrentUser(int userId);
    void onBootCompleted();
    void onBootCompleted();


+5 −0
Original line number Original line 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_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>
    <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>
</resources>
Loading