Fixed NPE during monkey testing.

We tried to resume key dispatching for an activity after we destroyed
it and removed its container which led to an NPE.
We now resume key dispatching for an activity if it is currently paused
just before we remove its container to not leave WM in a bad state and
also avoid NPE later on.

Change-Id: I89d366c8667e621f4515df802c6b8278fa4bd322
Fixes: 34808323
Test: adb shell monkey -p ...
This commit is contained in:
Wale Ogunwale
2017-02-01 08:12:14 -08:00
parent 8e332cc54b
commit cc367f4512

View File

@@ -749,6 +749,9 @@ final class ActivityRecord implements AppWindowContainerListener {
}
void removeWindowContainer() {
// Resume key dispatching if it is currently paused before we remove the container.
resumeKeyDispatchingLocked();
mWindowContainerController.removeContainer(getDisplayId());
mWindowContainerController = null;
}