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

Commit c0322ecd authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Clear ident when obtaining provider across users.

When calling getContentProvider() across user boundaries, and
creating the provider for the first time, we need to clear caller
identity.  (We could have torn down the provider while the system
was under memory pressure.)

Bug: 17409650
Change-Id: I67713a03e5f7106f5e8fcf33fe3fdae81ce644ec
parent 51a400eb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -9349,6 +9349,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                checkTime(startTime, "getContentProviderImpl: after getProviderByClass");
                final boolean firstClass = cpr == null;
                if (firstClass) {
                    final long ident = Binder.clearCallingIdentity();
                    try {
                        checkTime(startTime, "getContentProviderImpl: before getApplicationInfo");
                        ApplicationInfo ai =
@@ -9366,6 +9367,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                        cpr = new ContentProviderRecord(this, cpi, ai, comp, singleton);
                    } catch (RemoteException ex) {
                        // pm is in same process, this will never happen.
                    } finally {
                        Binder.restoreCallingIdentity(ident);
                    }
                }