Fix issue #2136448: googleapps crashes while adding 2nd gmail account
Change-Id: I1dc27959650643bf0c7fd0564719856d7b3efeb1
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 65d6eb9..76a133b 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -2951,8 +2951,8 @@
// The window is now visible if it has been added, we are not
// simply finishing, and we are not starting another activity.
- if (!r.activity.mFinished && r.activity.mDecor != null
- && !r.hideForNow) {
+ if (!r.activity.mFinished && !a.mStartedActivity
+ && r.activity.mDecor != null && !r.hideForNow) {
if (r.newConfig != null) {
performConfigurationChanged(r.activity, r.newConfig);
r.newConfig = null;
@@ -2966,9 +2966,11 @@
l.softInputMode = (l.softInputMode
& (~WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION))
| forwardBit;
- ViewManager wm = a.getWindowManager();
- View decor = r.window.getDecorView();
- wm.updateViewLayout(decor, l);
+ if (r.activity.mVisibleFromClient) {
+ ViewManager wm = a.getWindowManager();
+ View decor = r.window.getDecorView();
+ wm.updateViewLayout(decor, l);
+ }
}
r.activity.mVisibleFromServer = true;
mNumVisibleActivities++;