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

Commit cf1bd25a authored by Hai Zhang's avatar Hai Zhang
Browse files

DO NOT MERGE Add cross-user check for getDefaultSmsPackage().

Bug: 177927831
Test: atest RoleSecurityTest
Change-Id: I1254804fb72a299e782d45f938acdf979a82f904
parent dd894ae8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -662,6 +662,12 @@ public class RoleManagerService extends SystemService implements RoleUserState.C

        @Override
        public String getDefaultSmsPackage(int userId) {
            userId = handleIncomingUser(userId, false, "getDefaultSmsPackage");
            if (!mUserManagerInternal.exists(userId)) {
                Slog.e(LOG_TAG, "user " + userId + " does not exist");
                return null;
            }

            long identity = Binder.clearCallingIdentity();
            try {
                return CollectionUtils.firstOrNull(