Work around issue #3241701: crash in ActivityThread.handleWindowVisibility
Change-Id: I9d5df3605f3d216e651e0a294409f82dea3968ad
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 43f9d52..cc94aa0 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -2592,6 +2592,12 @@
private final void handleWindowVisibility(IBinder token, boolean show) {
ActivityClientRecord r = mActivities.get(token);
+
+ if (r == null) {
+ Log.w(TAG, "handleWindowVisibility: no activity for token " + token);
+ return;
+ }
+
if (!show && !r.stopped) {
performStopActivityInner(r, null, show, false);
} else if (show && r.stopped) {