Merge "Deliver onNewIntent before onResume when launching recents."
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 51787b0..a9025bd 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -393,7 +393,7 @@
}
mTouchExcludeRegion.op(mTmpRect, Region.Op.DIFFERENCE);
}
- if (task.isDockedInEffect() && !task.isResizeable()) {
+ if (task.isTwoFingerScrollMode()) {
stack.getBounds(mTmpRect);
mNonResizeableRegion.op(mTmpRect, Region.Op.UNION);
break;
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 47a4936..6bb3e20 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -571,6 +571,10 @@
return inDockedWorkspace() || isResizeableByDockedStack();
}
+ boolean isTwoFingerScrollMode() {
+ return isDockedInEffect() && !isResizeable();
+ }
+
WindowState getTopVisibleAppMainWindow() {
final AppWindowToken token = getTopVisibleAppToken();
return token != null ? token.findMainWindow() : null;
diff --git a/services/core/java/com/android/server/wm/TaskStack.java b/services/core/java/com/android/server/wm/TaskStack.java
index 369cc65..e75780f 100644
--- a/services/core/java/com/android/server/wm/TaskStack.java
+++ b/services/core/java/com/android/server/wm/TaskStack.java
@@ -130,7 +130,7 @@
Configuration config = configs.get(task.mTaskId);
if (config != null) {
Rect bounds = taskBounds.get(task.mTaskId);
- if (!task.isResizeable() && task.isDockedInEffect()) {
+ if (task.isTwoFingerScrollMode()) {
// This is a non-resizeable task that's docked (or side-by-side to the docked
// stack). It might have been scrolled previously, and after the stack resizing,
// it might no longer fully cover the stack area.
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index b96cbfb..685df25 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -1990,6 +1990,10 @@
}
}
+ // If the window is being added to a task that's docked but non-resizeable,
+ // we need to update this new window's scroll position when it's added.
+ win.applyScrollIfNeeded();
+
if (type == TYPE_DOCK_DIVIDER) {
getDefaultDisplayContentLocked().getDockedDividerController().setWindow(win);
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index b7fd60f..058fa67 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -1458,15 +1458,24 @@
}
boolean inDockedWorkspace() {
- Task task = getTask();
+ final Task task = getTask();
return task != null && task.inDockedWorkspace();
}
boolean isDockedInEffect() {
- Task task = getTask();
+ final Task task = getTask();
return task != null && task.isDockedInEffect();
}
+ void applyScrollIfNeeded() {
+ final Task task = getTask();
+ if (task != null && task.isTwoFingerScrollMode()) {
+ task.getDimBounds(mTmpRect);
+ mXOffset = mTmpRect.left;
+ mYOffset = mTmpRect.top;
+ }
+ }
+
int getTouchableRegion(Region region, int flags) {
final boolean modal = (flags & (FLAG_NOT_TOUCH_MODAL | FLAG_NOT_FOCUSABLE)) == 0;
if (modal && mAppToken != null) {