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

Commit 1de0267b authored by Jing Ji's avatar Jing Ji
Browse files

Fix NPE in getContentProviderImpl

Bug: 148377974
Test: manual
Change-Id: I73f41fc9527dd24d2e349351bd8550c152ef51e4
parent 374ba3fc
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -6843,7 +6843,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                    cpi = cpr.info;
                    if (isSingleton(cpi.processName, cpi.applicationInfo,
                            cpi.name, cpi.flags)
                            && isValidSingletonCall(r.uid, cpi.applicationInfo.uid)) {
                            && isValidSingletonCall(r == null ? callingUid : r.uid,
                                    cpi.applicationInfo.uid)) {
                        userId = UserHandle.USER_SYSTEM;
                        checkCrossUser = false;
                    } else {
@@ -6931,7 +6932,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                conn = incProviderCountLocked(r, cpr, token, callingUid, callingPackage, callingTag,
                        stable);
                if (conn != null && (conn.stableCount+conn.unstableCount) == 1) {
                    if (cpr.proc != null && r.setAdj <= ProcessList.PERCEPTIBLE_LOW_APP_ADJ) {
                    if (cpr.proc != null
                            && r != null && r.setAdj <= ProcessList.PERCEPTIBLE_LOW_APP_ADJ) {
                        // If this is a perceptible app accessing the provider,
                        // make sure to count it as being accessed and thus
                        // back up on the LRU list.  This is good because
@@ -7003,7 +7005,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                // Then allow connecting to the singleton provider
                boolean singleton = isSingleton(cpi.processName, cpi.applicationInfo,
                        cpi.name, cpi.flags)
                        && isValidSingletonCall(r.uid, cpi.applicationInfo.uid);
                        && isValidSingletonCall(r == null ? callingUid : r.uid,
                                cpi.applicationInfo.uid);
                if (singleton) {
                    userId = UserHandle.USER_SYSTEM;
                }
+3 −0
Original line number Diff line number Diff line
@@ -3271,6 +3271,9 @@ public final class ProcessList {
    }

    final ProcessRecord getLRURecordForAppLocked(IApplicationThread thread) {
        if (thread == null) {
            return null;
        }
        final IBinder threadBinder = thread.asBinder();
        // Find the application record.
        for (int i = mLruProcesses.size() - 1; i >= 0; i--) {