Skip to content
Commit 221c72de authored by Riddle Hsu's avatar Riddle Hsu
Browse files

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
parent 038fd80c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment