OSDN Git Service

Adde back check to make sure Activity.recreate() is called on main thread.
authorWale Ogunwale <ogunwale@google.com>
Thu, 17 May 2018 00:23:48 +0000 (17:23 -0700)
committerWale Ogunwale <ogunwale@google.com>
Thu, 17 May 2018 00:23:48 +0000 (17:23 -0700)
Change-Id: Id8fa7e1c17ee3d42a19c82dc8cc1fec2de1757d1
Fixes: 79703568
Test: Existing test pass.

core/java/android/app/Activity.java

index 3b62bd7..057e796 100644 (file)
@@ -5578,6 +5578,9 @@ public class Activity extends ContextThemeWrapper
         if (mParent != null) {
             throw new IllegalStateException("Can only be called on top-level activity");
         }
+        if (Looper.myLooper() != mMainThread.getLooper()) {
+            throw new IllegalStateException("Must be called from main thread");
+        }
         mMainThread.scheduleRelaunchActivity(mToken);
     }