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

Commit 58bfc103 authored by Adam Bookatz's avatar Adam Bookatz Committed by Android (Google) Code Review
Browse files

Merge "Annotate UserInfo.isCommunalProfile as FlaggedApi" into main

parents 4831205e fffe1c28
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1082,7 +1082,7 @@ package android.content.pm {
    method public android.os.UserHandle getUserHandle();
    method public boolean isAdmin();
    method public boolean isCloneProfile();
    method public boolean isCommunalProfile();
    method @FlaggedApi("android.multiuser.support_communal_profile") public boolean isCommunalProfile();
    method public boolean isDemo();
    method public boolean isEnabled();
    method public boolean isEphemeral();
+2 −3
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package android.content.pm;

import static android.os.Flags.FLAG_ALLOW_PRIVATE_PROFILE;

import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
@@ -389,11 +387,12 @@ public class UserInfo implements Parcelable {
        return UserManager.isUserTypeCloneProfile(userType);
    }

    @FlaggedApi(android.multiuser.Flags.FLAG_SUPPORT_COMMUNAL_PROFILE)
    public boolean isCommunalProfile() {
        return UserManager.isUserTypeCommunalProfile(userType);
    }

    @FlaggedApi(FLAG_ALLOW_PRIVATE_PROFILE)
    @FlaggedApi(android.os.Flags.FLAG_ALLOW_PRIVATE_PROFILE)
    public boolean isPrivateProfile() {
        return UserManager.isUserTypePrivateProfile(userType);
    }
+3 −1
Original line number Diff line number Diff line
@@ -1282,7 +1282,9 @@ public class UserManagerService extends IUserManager.Stub {
     */
    private boolean isSameUserOrProfileGroupOrTargetIsCommunal(UserInfo asker, UserInfo target) {
        if (asker.id == target.id) return true;
        if (android.multiuser.Flags.supportCommunalProfile()) {
            if (target.isCommunalProfile()) return true;
        }
        return (asker.profileGroupId != UserInfo.NO_PROFILE_GROUP_ID
                && asker.profileGroupId == target.profileGroupId);
    }