summaryrefslogtreecommitdiff
path: root/core/java/android/app/WindowConfiguration.java
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2017-07-27 08:55:03 -0700
committerWale Ogunwale <ogunwale@google.com>2017-08-24 08:57:10 -0700
commit3382ab1fc7cbd45194d502f18e7ea21c2b9a04ca (patch)
tree6371d40fcbb42c3115c8fc189197593d80b8912f /core/java/android/app/WindowConfiguration.java
parent6c008738d3191624a4917b6f60682f83373abf61 (diff)
Migrated some windowing methods from StackId to WindowConfiguration
First pass at transitioning away from using stack ids for windowing mode to WindowConfiguration. Added some TODO that will require the introduction of applicationType in WindowConfiguration before additional conversation can be done. Test: bit FrameworksServicesTests:com.android.server.wm.WindowConfigurationTests Test: adb shell am instrument -w -e package com.android.server.wm com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner Test: go/wm-smoke Change-Id: I2b315623faa16445a9f942e082089123842cb5a1
Diffstat (limited to 'core/java/android/app/WindowConfiguration.java')
-rw-r--r--core/java/android/app/WindowConfiguration.java84
1 files changed, 84 insertions, 0 deletions
diff --git a/core/java/android/app/WindowConfiguration.java b/core/java/android/app/WindowConfiguration.java
index e4ec8c3b3b9c..d5d7107a6cc9 100644
--- a/core/java/android/app/WindowConfiguration.java
+++ b/core/java/android/app/WindowConfiguration.java
@@ -277,6 +277,90 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
+ " mWindowingMode=" + windowingModeToString(mWindowingMode) + "}";
}
+ /**
+ * Returns true if the activities associated with this window configuration display a shadow
+ * around their border.
+ */
+ public boolean hasWindowShadow() {
+ return tasksAreFloating();
+ }
+
+ /**
+ * Returns true if the activities associated with this window configuration display a decor
+ * view.
+ */
+ public boolean hasWindowDecorCaption() {
+ return mWindowingMode == WINDOWING_MODE_FREEFORM;
+ }
+
+ /**
+ * Returns true if the tasks associated with this window configuration can be resized
+ * independently of their parent container.
+ */
+ public boolean canResizeTask() {
+ return mWindowingMode == WINDOWING_MODE_FREEFORM;
+ }
+
+ /** Returns true if the task bounds should persist across power cycles. */
+ public boolean persistTaskBounds() {
+ return mWindowingMode == WINDOWING_MODE_FREEFORM;
+ }
+
+ /**
+ * Returns true if the tasks associated with this window configuration are floating.
+ * Floating tasks are laid out differently as they are allowed to extend past the display bounds
+ * without overscan insets.
+ */
+ public boolean tasksAreFloating() {
+ return mWindowingMode == WINDOWING_MODE_FREEFORM || mWindowingMode == WINDOWING_MODE_PINNED;
+ }
+
+ /**
+ * Returns true if the windows associated with this window configuration can receive input keys.
+ */
+ public boolean canReceiveKeys() {
+ return mWindowingMode != WINDOWING_MODE_PINNED;
+ }
+
+ /**
+ * Returns true if the container associated with this window configuration is always-on-top of
+ * its siblings.
+ */
+ public boolean isAlwaysOnTop() {
+ return mWindowingMode == WINDOWING_MODE_PINNED;
+ }
+
+ /**
+ * Returns true if any visible windows belonging to apps with this window configuration should
+ * be kept on screen when the app is killed due to something like the low memory killer.
+ */
+ public boolean keepVisibleDeadAppWindowOnScreen() {
+ return mWindowingMode != WINDOWING_MODE_PINNED;
+ }
+
+ /**
+ * Returns true if the backdrop on the client side should match the frame of the window.
+ * Returns false, if the backdrop should be fullscreen.
+ */
+ public boolean useWindowFrameForBackdrop() {
+ return mWindowingMode == WINDOWING_MODE_FREEFORM || mWindowingMode == WINDOWING_MODE_PINNED;
+ }
+
+ /**
+ * Returns true if this container may be scaled without resizing, and windows within may need
+ * to be configured as such.
+ */
+ public boolean windowsAreScaleable() {
+ return mWindowingMode == WINDOWING_MODE_PINNED;
+ }
+
+ /**
+ * Returns true if windows in this container should be given move animations by default.
+ */
+ public boolean hasMovementAnimations() {
+ return mWindowingMode == WINDOWING_MODE_PINNED;
+ }
+
private static String windowingModeToString(@WindowingMode int windowingMode) {
switch (windowingMode) {
case WINDOWING_MODE_UNDEFINED: return "undefined";