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

Commit 08d273df authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Always return null when accessing provider unavailable to instant app"

parents 05a3f9c9 610b91de
Loading
Loading
Loading
Loading
+19 −6
Original line number Diff line number Diff line
@@ -12048,14 +12048,17 @@ public class ActivityManagerService extends IActivityManager.Stub
            if (providerRunning) {
                cpi = cpr.info;
                String msg;
                checkTime(startTime, "getContentProviderImpl: before checkContentProviderPermission");
                if (r != null && cpr.canRunHere(r)) {
                    checkTime(startTime,
                            "getContentProviderImpl: before checkContentProviderPermission");
                    if ((msg = checkContentProviderPermissionLocked(cpi, r, userId, checkCrossUser))
                            != null) {
                        throw new SecurityException(msg);
                    }
                checkTime(startTime, "getContentProviderImpl: after checkContentProviderPermission");
                    checkTime(startTime,
                            "getContentProviderImpl: after checkContentProviderPermission");
                if (r != null && cpr.canRunHere(r)) {
                    // This provider has been published or is in the process
                    // of being published...  but it is also allowed to run
                    // in the caller's process, so don't make a connection
@@ -12066,6 +12069,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                    holder.provider = null;
                    return holder;
                }
                // Don't expose providers between normal apps and instant apps
                try {
                    if (AppGlobals.getPackageManager()
@@ -12075,6 +12079,15 @@ public class ActivityManagerService extends IActivityManager.Stub
                } catch (RemoteException e) {
                }
                checkTime(startTime,
                        "getContentProviderImpl: before checkContentProviderPermission");
                if ((msg = checkContentProviderPermissionLocked(cpi, r, userId, checkCrossUser))
                        != null) {
                    throw new SecurityException(msg);
                }
                checkTime(startTime,
                        "getContentProviderImpl: after checkContentProviderPermission");
                final long origId = Binder.clearCallingIdentity();
                checkTime(startTime, "getContentProviderImpl: incProviderCountLocked");