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

Commit 71c4049f authored by Felipe Leme's avatar Felipe Leme Committed by Android (Google) Code Review
Browse files

Merge "Makes DPM.getLogoutUser() and clearLogoutUser() system APIs."

parents eb2e42c4 cbc67df4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -63,6 +63,8 @@ package android.app.admin {

  public class DevicePolicyManager {
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void acknowledgeNewUserDisclaimer();
    method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void clearLogoutUser();
    method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public android.os.UserHandle getLogoutUser();
    field public static final String ACTION_SHOW_NEW_USER_DISCLAIMER = "android.app.action.SHOW_NEW_USER_DISCLAIMER";
  }

+8 −3
Original line number Diff line number Diff line
@@ -10019,14 +10019,17 @@ public class DevicePolicyManager {
    /**
     * Gets the user a {@link #logoutUser(ComponentName)} call would switch to,
     * or {@link UserHandle#USER_NULL} if the current user is not in a session.
     * or {@code null} if the current user is not in a session.
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    public @UserIdInt int getLogoutUserId() {
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public @Nullable UserHandle getLogoutUser() {
        // TODO(b/214336184): add CTS test
        try {
            return mService.getLogoutUserId();
            int userId = mService.getLogoutUserId();
            return userId == UserHandle.USER_NULL ? null : UserHandle.of(userId);
        } catch (RemoteException re) {
            throw re.rethrowFromSystemServer();
        }
@@ -10040,7 +10043,9 @@ public class DevicePolicyManager {
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public void clearLogoutUser() {
        // TODO(b/214336184): add CTS test
        try {
            mService.clearLogoutUser();
        } catch (RemoteException re) {