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

Commit 1c574d5e authored by Adam Bookatz's avatar Adam Bookatz
Browse files

Fix a few annotation nits from ag/27086435

This cl just fixes a few annotation-related nits from
Icaf26c17de32aaf63b985d69dd6902b1112a4a75.

Test: N/A (just annotation changes)
Flag: ACONFIG android.multiuser.enable_private_space_features NEXTFOOD
Bug: 329551064
Change-Id: I376b332c79634a64f4a6bdeb88ace1250412f218
parent 3aa93508
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -5957,19 +5957,22 @@ public class UserManager {
    /**
     * Returns the string used to represent the profile associated with the given userId. This
     * string typically includes the profile name used by accessibility services like TalkBack.
     * @hide
     *
     * @return String representing the accessibility label for the given profile user.
     *
     * @throws android.content.res.Resources.NotFoundException if the user does not have a label
     * defined.
     *
     * @see #getBadgedLabelForUser(CharSequence, UserHandle)
     *
     * @hide
     */
    @UserHandleAware(
            requiresAnyOfPermissionsIfNotCallerProfileGroup = {
                    Manifest.permission.MANAGE_USERS,
                    Manifest.permission.QUERY_USERS,
                    Manifest.permission.INTERACT_ACROSS_USERS})
    public String getProfileAccessibilityString(int userId) {
    public String getProfileAccessibilityString(@UserIdInt int userId) {
        if (isManagedProfile(mUserId)) {
            DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class);
            dpm.getResources().getString(
@@ -5979,7 +5982,7 @@ public class UserManager {
        return getProfileAccessibilityLabel(userId);
    }

    private String getProfileAccessibilityLabel(int userId) {
    private String getProfileAccessibilityLabel(@UserIdInt int userId) {
        try {
            final int resourceId = mService.getProfileAccessibilityLabelResId(userId);
            return Resources.getSystem().getString(resourceId);
+1 −1
Original line number Diff line number Diff line
@@ -2326,7 +2326,7 @@ public class UserManagerService extends IUserManager.Stub {
    }

    @Override
    public @NonNull int getProfileAccessibilityLabelResId(@UserIdInt int userId) {
    public @StringRes int getProfileAccessibilityLabelResId(@UserIdInt int userId) {
        checkQueryOrInteractPermissionIfCallerInOtherProfileGroup(userId,
                "getProfileAccessibilityLabelResId");
        final UserInfo userInfo = getUserInfoNoChecks(userId);
+2 −2
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ public final class UserTypeDetails {
     * Resource ID ({@link StringRes}) of the accessibility string that describes the user type.
     * This is used by accessibility services like Talkback.
     */
    private final @Nullable int mAccessibilityString;
    private final @StringRes int mAccessibilityString;

    /**
     * The default {@link UserProperties} for the user type.
@@ -183,7 +183,7 @@ public final class UserTypeDetails {
            @Nullable Bundle defaultSystemSettings,
            @Nullable Bundle defaultSecureSettings,
            @Nullable List<DefaultCrossProfileIntentFilter> defaultCrossProfileIntentFilters,
            @Nullable int accessibilityString,
            @StringRes int accessibilityString,
            @NonNull UserProperties defaultUserProperties) {
        this.mName = name;
        this.mEnabled = enabled;