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

Commit bd531227 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

ActivityManager: Fix monkey tests

Change I30e38c6c27d339d55a8f9a0f4106185356a9b9a0 (adding ordered
broadcast prioritization) adds the assumption that every broadcast
generator has a full-fledged caller app, which isn't true for
monkey-created tests. Make sure the caller is a full app before
checking if it is AID_SYSTEM to avoid an NPE

Fixes com.android.cts.monkey.*

Change-Id: Ide0dd046c6c5eb10ab4acb504237b58cbbbd8cfa
parent 31dc7aff
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -13219,7 +13219,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                        + " was previously registered for user " + rl.userId);
            }
            BroadcastFilter bf = new BroadcastFilter(filter, rl, callerPackage,
                    permission, callingUid, userId, (callerApp.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0);
                    permission, callingUid, userId,
                    (callerApp != null && callerApp.info != null && (callerApp.info.flags & ApplicationInfo.FLAG_SYSTEM) != 0));
            rl.add(bf);
            if (!bf.debugCheck()) {
                Slog.w(TAG, "==> For Dynamic broadast");