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

Commit d48f297f authored by mayankkk's avatar mayankkk Committed by Android Build Coastguard Worker
Browse files

Don't allow non-system uids to use "android" as calling package.

Bug: 310632322
Test: atest ./BroadcastsSecurityTest/src/android/app/cts/broadcasts/BroadcastRegistrationTest.java
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f9619f7ab4496bf98b42f00c622c94e60c898cd1)
Merged-In: I87517e9b116e5c6ca4ba05729139455c09a31d53
Change-Id: I87517e9b116e5c6ca4ba05729139455c09a31d53
parent 20deaf2c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -13811,8 +13811,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                return null;
            }
            if (callerApp.info.uid != SYSTEM_UID
                    && !callerApp.getPkgList().containsKey(callerPackage)
                    && !"android".equals(callerPackage)) {
                    && !callerApp.getPkgList().containsKey(callerPackage)) {
                throw new SecurityException("Given caller package " + callerPackage
                        + " is not running in process " + callerApp);
            }