summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chong Zhang <chz@google.com> 2016-08-17 18:22:10 +0000
committer android-build-merger <android-build-merger@google.com> 2016-08-17 18:22:10 +0000
commit9391bc557c0d27932c503991edc5b51e13481f11 (patch)
tree144995a2ced98f66edcf9eb8fbddcbc800cf2861
parent9deac0323777e1e6a6a83a50d6d3c3e511d74de1 (diff)
parent5e09ceb6419ec03758881bb0df6615840d8e0f5c (diff)
Add new window type TYPE_DRAWN_APPLICATION am: fea963edee
am: 5e09ceb641 Change-Id: I955b985c47ca10a17dec6921af0277d1d6a7431d
-rw-r--r--api/current.txt1
-rw-r--r--api/system-current.txt1
-rw-r--r--api/test-current.txt1
-rw-r--r--core/java/android/view/WindowManager.java9
-rw-r--r--core/java/com/android/internal/policy/DecorView.java3
-rw-r--r--services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java1
-rw-r--r--services/core/java/com/android/server/wm/AccessibilityController.java1
-rw-r--r--services/core/java/com/android/server/wm/Task.java4
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java4
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java15
10 files changed, 30 insertions, 10 deletions
diff --git a/api/current.txt b/api/current.txt
index bf6196c00151..7fe82020d8d2 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -43916,6 +43916,7 @@ package android.view {
field public static final int TYPE_APPLICATION_SUB_PANEL = 1002; // 0x3ea
field public static final int TYPE_BASE_APPLICATION = 1; // 0x1
field public static final int TYPE_CHANGED = 2; // 0x2
+ field public static final int TYPE_DRAWN_APPLICATION = 4; // 0x4
field public static final int TYPE_INPUT_METHOD = 2011; // 0x7db
field public static final int TYPE_INPUT_METHOD_DIALOG = 2012; // 0x7dc
field public static final int TYPE_KEYGUARD_DIALOG = 2009; // 0x7d9
diff --git a/api/system-current.txt b/api/system-current.txt
index ee525b81f749..5a807f6e18cf 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -47096,6 +47096,7 @@ package android.view {
field public static final int TYPE_APPLICATION_SUB_PANEL = 1002; // 0x3ea
field public static final int TYPE_BASE_APPLICATION = 1; // 0x1
field public static final int TYPE_CHANGED = 2; // 0x2
+ field public static final int TYPE_DRAWN_APPLICATION = 4; // 0x4
field public static final int TYPE_INPUT_METHOD = 2011; // 0x7db
field public static final int TYPE_INPUT_METHOD_DIALOG = 2012; // 0x7dc
field public static final int TYPE_KEYGUARD_DIALOG = 2009; // 0x7d9
diff --git a/api/test-current.txt b/api/test-current.txt
index 312cfe2107e4..fb03571a8c57 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -43997,6 +43997,7 @@ package android.view {
field public static final int TYPE_APPLICATION_SUB_PANEL = 1002; // 0x3ea
field public static final int TYPE_BASE_APPLICATION = 1; // 0x1
field public static final int TYPE_CHANGED = 2; // 0x2
+ field public static final int TYPE_DRAWN_APPLICATION = 4; // 0x4
field public static final int TYPE_INPUT_METHOD = 2011; // 0x7db
field public static final int TYPE_INPUT_METHOD_DIALOG = 2012; // 0x7dc
field public static final int TYPE_KEYGUARD_DIALOG = 2009; // 0x7d9
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index eb6b17e08f46..0dbf00dd75aa 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -221,6 +221,7 @@ public interface WindowManager extends ViewManager {
* @see #TYPE_BASE_APPLICATION
* @see #TYPE_APPLICATION
* @see #TYPE_APPLICATION_STARTING
+ * @see #TYPE_DRAWN_APPLICATION
* @see #TYPE_APPLICATION_PANEL
* @see #TYPE_APPLICATION_MEDIA
* @see #TYPE_APPLICATION_SUB_PANEL
@@ -244,6 +245,7 @@ public interface WindowManager extends ViewManager {
@ViewDebug.IntToString(from = TYPE_BASE_APPLICATION, to = "TYPE_BASE_APPLICATION"),
@ViewDebug.IntToString(from = TYPE_APPLICATION, to = "TYPE_APPLICATION"),
@ViewDebug.IntToString(from = TYPE_APPLICATION_STARTING, to = "TYPE_APPLICATION_STARTING"),
+ @ViewDebug.IntToString(from = TYPE_DRAWN_APPLICATION, to = "TYPE_DRAWN_APPLICATION"),
@ViewDebug.IntToString(from = TYPE_APPLICATION_PANEL, to = "TYPE_APPLICATION_PANEL"),
@ViewDebug.IntToString(from = TYPE_APPLICATION_MEDIA, to = "TYPE_APPLICATION_MEDIA"),
@ViewDebug.IntToString(from = TYPE_APPLICATION_SUB_PANEL, to = "TYPE_APPLICATION_SUB_PANEL"),
@@ -315,6 +317,13 @@ public interface WindowManager extends ViewManager {
public static final int TYPE_APPLICATION_STARTING = 3;
/**
+ * Window type: a variation on TYPE_APPLICATION that ensures the window
+ * manager will wait for this window to be drawn before the app is shown.
+ * In multiuser systems shows only on the owning user's window.
+ */
+ public static final int TYPE_DRAWN_APPLICATION = 4;
+
+ /**
* End of types of application windows.
*/
public static final int LAST_APPLICATION_WINDOW = 99;
diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java
index 366fc1a7dd5b..92ab3246e354 100644
--- a/core/java/com/android/internal/policy/DecorView.java
+++ b/core/java/com/android/internal/policy/DecorView.java
@@ -101,6 +101,7 @@ import static android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATIO
import static android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
+import static android.view.WindowManager.LayoutParams.TYPE_DRAWN_APPLICATION;
import static com.android.internal.policy.PhoneWindow.FEATURE_OPTIONS_PANEL;
/** @hide */
@@ -1860,7 +1861,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
}
final WindowManager.LayoutParams attrs = mWindow.getAttributes();
final boolean isApplication = attrs.type == TYPE_BASE_APPLICATION ||
- attrs.type == TYPE_APPLICATION;
+ attrs.type == TYPE_APPLICATION || attrs.type == TYPE_DRAWN_APPLICATION;
// Only a non floating application window on one of the allowed workspaces can get a caption
if (!mWindow.isFloating() && isApplication && StackId.hasWindowDecor(mStackId)) {
// Dependent on the brightness of the used title we either use the
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index 99f14d7c4c00..65af958b0181 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -3568,6 +3568,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
case WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL:
case WindowManager.LayoutParams.TYPE_APPLICATION_ABOVE_SUB_PANEL:
case WindowManager.LayoutParams.TYPE_BASE_APPLICATION:
+ case WindowManager.LayoutParams.TYPE_DRAWN_APPLICATION:
case WindowManager.LayoutParams.TYPE_PHONE:
case WindowManager.LayoutParams.TYPE_PRIORITY_PHONE:
case WindowManager.LayoutParams.TYPE_TOAST:
diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java
index d2d5c2878889..e5e2175fb616 100644
--- a/services/core/java/com/android/server/wm/AccessibilityController.java
+++ b/services/core/java/com/android/server/wm/AccessibilityController.java
@@ -348,6 +348,7 @@ final class AccessibilityController {
}
switch (type) {
case WindowManager.LayoutParams.TYPE_APPLICATION:
+ case WindowManager.LayoutParams.TYPE_DRAWN_APPLICATION:
case WindowManager.LayoutParams.TYPE_APPLICATION_PANEL:
case WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA:
case WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL:
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index b4387b98e6d7..1dcada6729fc 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -624,8 +624,8 @@ class Task implements DimLayer.DimLayerUser {
//
// As we use this flag as a hint to freeze surface boundary updates,
// we'd like to only apply this to TYPE_BASE_APPLICATION,
- // windows of TYPE_APPLICATION like dialogs, could appear
- // to not be drag resizing while they resize, but we'd
+ // windows of TYPE_APPLICATION (or TYPE_DRAWN_APPLICATION) like dialogs,
+ // could appear to not be drag resizing while they resize, but we'd
// still like to manipulate their frame to update crop, etc...
//
// Anyway we don't need to synchronize position and content updates for these
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index c0b2d336b33c..f2f85bf184cf 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -191,6 +191,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
+import static android.view.WindowManager.LayoutParams.TYPE_DRAWN_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_BOOT_PROGRESS;
import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
import static android.view.WindowManager.LayoutParams.TYPE_DREAM;
@@ -5886,7 +5887,8 @@ public class WindowManagerService extends IWindowManager.Stub
if (w.isDrawnLw()) {
if (w.mAttrs.type == TYPE_BOOT_PROGRESS) {
haveBootMsg = true;
- } else if (w.mAttrs.type == TYPE_APPLICATION) {
+ } else if (w.mAttrs.type == TYPE_APPLICATION
+ || w.mAttrs.type == TYPE_DRAWN_APPLICATION) {
haveApp = true;
} else if (w.mAttrs.type == TYPE_WALLPAPER) {
haveWallpaper = true;
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 81545b6c1991..54f60ef6a8a7 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -87,6 +87,7 @@ import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
+import static android.view.WindowManager.LayoutParams.TYPE_DRAWN_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG;
@@ -1289,7 +1290,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
final boolean isViewVisible = (mAppToken == null || !mAppToken.clientHidden)
&& (mViewVisibility == View.VISIBLE) && !mWindowRemovalAllowed;
return (isOnScreenIgnoringKeyguard() && (!visibleOnly || isViewVisible)
- || mWinAnimator.mAttrType == TYPE_BASE_APPLICATION)
+ || mWinAnimator.mAttrType == TYPE_BASE_APPLICATION
+ || mWinAnimator.mAttrType == TYPE_DRAWN_APPLICATION)
&& !mAnimatingExit && !mDestroying;
}
@@ -2925,12 +2927,13 @@ final class WindowState implements WindowManagerPolicy.WindowState {
// for only child windows (as the main window is handled by window preservation)
// and the big surface.
//
- // Though windows of TYPE_APPLICATION (as opposed to TYPE_BASE_APPLICATION)
- // are not children in the sense of an attached window, we also want to replace
- // them at such phases, as they won't be covered by window preservation,
- // and in general we expect them to return following relaunch.
+ // Though windows of TYPE_APPLICATION or TYPE_DRAWN_APPLICATION (as opposed to
+ // TYPE_BASE_APPLICATION) are not children in the sense of an attached window,
+ // we also want to replace them at such phases, as they won't be covered by window
+ // preservation, and in general we expect them to return following relaunch.
boolean shouldBeReplacedWithChildren() {
- return isChildWindow() || mAttrs.type == TYPE_APPLICATION;
+ return isChildWindow() || mAttrs.type == TYPE_APPLICATION
+ || mAttrs.type == TYPE_DRAWN_APPLICATION;
}
public int getRotationAnimationHint() {