Remove process association if it is known to be dead
Otherwise because ActivityRecord#launchFailed is set to true on first failure and other places still try to resume/start it by the existing process, which causes 2nd failure and then removes the activity record. The case can happen when the binder buffer of the app is full or the process becomes zombie state. Because the argument knownToBeDead will request to kill the existing process and start a new one. With removing the record of window process controller, it won't resume the died app again. While the old process is died and new process is attached, the activity record on top can still become alive again. Bug: 220859166 Test: Add below test code at the beginning of ClientLifecycleManager#scheduleTransaction ActivityRecord a = ActivityRecord.forTokenLocked( transaction.getActivityToken()); if (a != null && a.app != null && a.app.getPid() == SystemProperties.getInt("p", -1)) { throw new RemoteException("test"); } Use "adb shell setprop p $pid" for a background activity. After starting it again to resume it, the old process will be killed and the activity can be launched successfully with new process. Change-Id: I30cbd8386ea3a4c4c3c76426b5d0966ea6d67575
Loading
Please register or sign in to comment