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

Commit 90007f74 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #10876433: java.lang.IllegalStateException in...

...ActivityManagerService.updateLruProcessInternalLocked on bluetooth

Don't try to move process records associated with dead service
connections.

Technically we should probably be clearing the binding/service's
app entry so we don't get into this case, but the least intrusive
change for now is this check.

Change-Id: I6683e692eb5a8fa4f8ec1fa31bd63ec3d7f878ef
parent 4bf0fcef
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2241,8 +2241,9 @@ public final class ActivityManagerService extends ActivityManagerNative
        int lrui = mLruProcesses.lastIndexOf(app);
        if (lrui < 0) {
            throw new IllegalStateException("Adding dependent process " + app
                    + " not on LRU list: " + what + obj + " from " + srcApp);
            Log.wtf(TAG, "Adding dependent process " + app + " not on LRU list: "
                    + what + " " + obj + " from " + srcApp);
            return index;
        }
        if (lrui >= mLruProcessActivityStart) {
@@ -2307,7 +2308,7 @@ public final class ActivityManagerService extends ActivityManagerNative
        // bump those processes as well.
        for (int j=app.connections.size()-1; j>=0; j--) {
            ConnectionRecord cr = app.connections.valueAt(j);
            if (cr.binding != null && cr.binding.service != null
            if (cr.binding != null && !cr.serviceDead && cr.binding.service != null
                    && cr.binding.service.app != null
                    && cr.binding.service.app.lruSeq != mLruSeq) {
                nextIndex = updateLruProcessInternalLocked(cr.binding.service.app, now, nextIndex,