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

Commit a3e358cf authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Expose API needed for apps to use work profiles.

Bug: 120303361
Test: Built
Change-Id: I5e4cd1450bb284321711558a4475e872d14022ff
parent db58c205
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4305,6 +4305,7 @@ package android.os {

  public class UserManager {
    method public void clearSeedAccountData();
    method public android.os.UserHandle getProfileParent(android.os.UserHandle);
    method public java.lang.String getSeedAccountName();
    method public android.os.PersistableBundle getSeedAccountOptions();
    method public java.lang.String getSeedAccountType();
+21 −0
Original line number Diff line number Diff line
@@ -2462,6 +2462,27 @@ public class UserManager {
        }
    }

    /**
     * Get the parent of a user profile.
     *
     * @param user the handle of the user profile
     *
     * @return the parent of the user or {@code null} if the user is not profile
     *
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    public @Nullable UserHandle getProfileParent(@NonNull UserHandle user) {
        UserInfo info = getProfileParent(user.getIdentifier());

        if (info == null) {
            return null;
        }

        return UserHandle.of(info.id);
    }

    /**
     * Enables or disables quiet mode for a managed profile. If quiet mode is enabled, apps in a
     * managed profile don't run, generate notifications, or consume data or battery.