Remove activity from stopping list when removed from display

Organized tasks and its children were removed when systemui died.
And the activities should no longer waiting to be stopped.

Also prevent NPE if the transaction is applied to a unknown WC.

Bug: 170451499
Test: presubmit tests
Change-Id: I2fcef2ffc8c962c0dac3b56cdbea4f17e071152d
This commit is contained in:
Louis Chang
2020-10-13 13:22:42 +08:00
parent 29f12866c2
commit 42ba68ce0f
2 changed files with 2 additions and 1 deletions

View File

@@ -3222,6 +3222,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
getDisplayContent().mUnknownAppVisibilityController.appRemovedOrHidden(this);
mWmService.mTaskSnapshotController.onAppRemoved(this);
mStackSupervisor.getActivityMetricsLogger().notifyActivityRemoved(this);
mStackSupervisor.mStoppingActivities.remove(this);
waitingToShow = false;
// TODO(b/169035022): move to a more-appropriate place.

View File

@@ -207,7 +207,7 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
final Map.Entry<IBinder, WindowContainerTransaction.Change> entry =
entries.next();
final WindowContainer wc = WindowContainer.fromBinder(entry.getKey());
if (!wc.isAttached()) {
if (wc == null || !wc.isAttached()) {
Slog.e(TAG, "Attempt to operate on detached container: " + wc);
continue;
}