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

Commit fffe1c28 authored by Adam Bookatz's avatar Adam Bookatz
Browse files

Annotate UserInfo.isCommunalProfile as FlaggedApi

This TestApi was introduced before flagging, so adding a FlaggedApi now.

Bug: 303726468
Test: still compiles
Change-Id: I417ee69bee1de370b53eba02a8aa2db792456e77
parent 0ccfa40a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1074,7 +1074,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);
    }