summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-09-08 18:51:14 -0700
committerJeff Brown <jeffbrown@google.com>2011-09-08 18:53:42 -0700
commitbfcb60ab0f696c8ef70830c365550e62fe2808bf (patch)
tree62501853dd40e4194e94bb689c46e1da335f6e66
parent9fefa3c716e9c8d7dfb6c851c91e37e37732a955 (diff)
downloadframeworks_base-bfcb60ab0f696c8ef70830c365550e62fe2808bf.zip
frameworks_base-bfcb60ab0f696c8ef70830c365550e62fe2808bf.tar.gz
frameworks_base-bfcb60ab0f696c8ef70830c365550e62fe2808bf.tar.bz2
Adjust layers for system overlays.
Prevent system overlays from showing above the notification bar. Allow secure system overlays to be fullscreen, for the pointer location view. Show the drag layer above the notification bar. Change-Id: Ic8d663792a243cca2cd9952d241d001e0357d551
-rw-r--r--core/java/android/view/WindowManager.java7
-rwxr-xr-xpolicy/src/com/android/internal/policy/impl/PhoneWindowManager.java28
-rw-r--r--services/input/InputWindow.h2
3 files changed, 27 insertions, 10 deletions
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index 96c1512..17a516c 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -177,7 +177,14 @@ public interface WindowManager extends ViewManager {
@ViewDebug.IntToString(from = TYPE_SYSTEM_ERROR, to = "TYPE_SYSTEM_ERROR"),
@ViewDebug.IntToString(from = TYPE_INPUT_METHOD, to = "TYPE_INPUT_METHOD"),
@ViewDebug.IntToString(from = TYPE_INPUT_METHOD_DIALOG, to = "TYPE_INPUT_METHOD_DIALOG"),
+ @ViewDebug.IntToString(from = TYPE_WALLPAPER, to = "TYPE_WALLPAPER"),
+ @ViewDebug.IntToString(from = TYPE_STATUS_BAR_PANEL, to = "TYPE_STATUS_BAR_PANEL"),
@ViewDebug.IntToString(from = TYPE_SECURE_SYSTEM_OVERLAY, to = "TYPE_SECURE_SYSTEM_OVERLAY"),
+ @ViewDebug.IntToString(from = TYPE_DRAG, to = "TYPE_DRAG"),
+ @ViewDebug.IntToString(from = TYPE_STATUS_BAR_SUB_PANEL, to = "TYPE_STATUS_BAR_SUB_PANEL"),
+ @ViewDebug.IntToString(from = TYPE_POINTER, to = "TYPE_POINTER"),
+ @ViewDebug.IntToString(from = TYPE_NAVIGATION_BAR, to = "TYPE_NAVIGATION_BAR"),
+ @ViewDebug.IntToString(from = TYPE_VOLUME_OVERLAY, to = "TYPE_VOLUME_OVERLAY"),
@ViewDebug.IntToString(from = TYPE_BOOT_PROGRESS, to = "TYPE_BOOT_PROGRESS")
})
public int type;
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 304df72..86671bd 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -189,16 +189,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
static final int STATUS_BAR_SUB_PANEL_LAYER = 14;
static final int STATUS_BAR_LAYER = 15;
static final int STATUS_BAR_PANEL_LAYER = 16;
- // the navigation bar, if available, shows atop most things
- static final int NAVIGATION_BAR_LAYER = 17;
// the on-screen volume indicator and controller shown when the user
// changes the device volume
- static final int VOLUME_OVERLAY_LAYER = 18;
+ static final int VOLUME_OVERLAY_LAYER = 17;
+ // things in here CAN NOT take focus, but are shown on top of everything else.
+ static final int SYSTEM_OVERLAY_LAYER = 18;
+ // the navigation bar, if available, shows atop most things
+ static final int NAVIGATION_BAR_LAYER = 19;
// the drag layer: input for drag-and-drop is associated with this window,
// which sits above all other focusable windows
- static final int DRAG_LAYER = 19;
- // things in here CAN NOT take focus, but are shown on top of everything else.
- static final int SYSTEM_OVERLAY_LAYER = 20;
+ static final int DRAG_LAYER = 20;
static final int SECURE_SYSTEM_OVERLAY_LAYER = 21;
static final int BOOT_PROGRESS_LAYER = 22;
// the (mouse) pointer layer
@@ -894,10 +894,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.MATCH_PARENT);
lp.type = WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY;
- lp.flags =
- WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE|
- WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE|
- WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
+ lp.flags = WindowManager.LayoutParams.FLAG_FULLSCREEN
+ | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
+ | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
+ | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
lp.format = PixelFormat.TRANSLUCENT;
lp.setTitle("PointerLocation");
WindowManager wm = (WindowManager)
@@ -995,6 +995,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// These types of windows can't receive input events.
attrs.flags |= WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
+ attrs.flags &= ~WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
break;
}
}
@@ -1993,6 +1994,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
"Laying out navigation bar window: (%d,%d - %d,%d)",
pf.left, pf.top, pf.right, pf.bottom));
}
+ } else if (attrs.type == TYPE_SECURE_SYSTEM_OVERLAY
+ && ((fl & FLAG_FULLSCREEN) != 0)) {
+ // Fullscreen secure system overlays get what they ask for.
+ pf.left = df.left = mUnrestrictedScreenLeft;
+ pf.top = df.top = mUnrestrictedScreenTop;
+ pf.right = df.right = mUnrestrictedScreenLeft+mUnrestrictedScreenWidth;
+ pf.bottom = df.bottom = mUnrestrictedScreenTop+mUnrestrictedScreenHeight;
} else {
pf.left = df.left = cf.left = mRestrictedScreenLeft;
pf.top = df.top = cf.top = mRestrictedScreenTop;
diff --git a/services/input/InputWindow.h b/services/input/InputWindow.h
index 8861bee..38968f9 100644
--- a/services/input/InputWindow.h
+++ b/services/input/InputWindow.h
@@ -103,6 +103,8 @@ struct InputWindowInfo {
TYPE_STATUS_BAR_SUB_PANEL = FIRST_SYSTEM_WINDOW+17,
TYPE_POINTER = FIRST_SYSTEM_WINDOW+18,
TYPE_NAVIGATION_BAR = FIRST_SYSTEM_WINDOW+19,
+ TYPE_VOLUME_OVERLAY = FIRST_SYSTEM_WINDOW+20,
+ TYPE_BOOT_PROGRESS = FIRST_SYSTEM_WINDOW+21,
LAST_SYSTEM_WINDOW = 2999,
};