summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Filip Gruszczynski <gruszczy@google.com> 2015-10-04 16:43:48 -0700
committer Filip Gruszczynski <gruszczy@google.com> 2015-10-05 10:56:49 -0700
commit14418daa093f8cd39b7fccbc24115a6968dc8e92 (patch)
tree4f335f00ff49d9577fca72fe1a546ce0edf57628
parentd1728e7656f9e90a16c2dc407a1085f3f2eacba9 (diff)
Fix recents crashing during docked stack resize.
Whether acitvity window should be preserved during the relaunch is controlled by the activity manager and the existence of non-client-decor should not affect it. For example, docked activities will not have non-client-decor, but we would like to preserve them anyway. Bug: 24573657 Change-Id: I5d4852c3b7c26ac3ec1bbc105639f75b67d1d3ad
-rw-r--r--core/java/android/app/ActivityThread.java5
-rw-r--r--core/java/android/view/Window.java13
-rw-r--r--core/java/com/android/internal/policy/PhoneWindow.java8
3 files changed, 4 insertions, 22 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 4b8efab3e59e..9f24de8dfe65 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -3956,13 +3956,12 @@ public final class ActivityThread {
}
IBinder wtoken = v.getWindowToken();
if (r.activity.mWindowAdded) {
- boolean reuseForResize = r.window.hasNonClientDecorView() && r.mPreserveWindow;
- if (r.onlyLocalRequest || reuseForResize) {
+ if (r.onlyLocalRequest || r.mPreserveWindow) {
// Hold off on removing this until the new activity's
// window is being added.
r.mPendingRemoveWindow = r.window;
r.mPendingRemoveWindowManager = wm;
- if (reuseForResize) {
+ if (r.mPreserveWindow) {
// We can only keep the part of the view hierarchy that we control,
// everything else must be removed, because it might not be able to
// behave properly when activity is relaunching.
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index 5f4e7af9390e..135448511db3 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -28,9 +28,8 @@ import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
-import android.graphics.drawable.Drawable;
import android.graphics.PixelFormat;
-import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
import android.media.session.MediaController;
import android.net.Uri;
import android.os.Bundle;
@@ -2007,16 +2006,6 @@ public abstract class Window {
*/
public abstract void setNavigationBarColor(@ColorInt int color);
- /**
- * Get information whether the activity has non client decoration view. These views are used in
- * the multi window environment, to provide dragging handle and maximize/close buttons.
- *
- * @hide
- */
- public boolean hasNonClientDecorView() {
- return false;
- }
-
/** @hide */
public void setTheme(int resId) {
}
diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java
index c9b81190ce38..23c40473f621 100644
--- a/core/java/com/android/internal/policy/PhoneWindow.java
+++ b/core/java/com/android/internal/policy/PhoneWindow.java
@@ -488,7 +488,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
}
public void clearContentView() {
- if (mNonClientDecorView.getChildCount() > 1) {
+ if (mNonClientDecorView != null && mNonClientDecorView.getChildCount() > 1) {
mNonClientDecorView.removeViewAt(1);
}
}
@@ -5413,16 +5413,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
* @Return Returns true if the window should show a shadow.
**/
private boolean nonClientDecorHasShadow(int workspaceId) {
- // TODO(skuhne): Add side by side mode here to add a decor.
return workspaceId == FREEFORM_WORKSPACE_STACK_ID;
}
@Override
- public boolean hasNonClientDecorView() {
- return mNonClientDecorView != null;
- }
-
- @Override
public void setTheme(int resid) {
mTheme = resid;
if (mDecor != null) {