OSDN Git Service

Fix issue #17789629: PopupWindow overlaps with navigation bar.
authorWale Ogunwale <ogunwale@google.com>
Sat, 18 Oct 2014 23:22:01 +0000 (16:22 -0700)
committerWale Ogunwale <ogunwale@google.com>
Tue, 21 Oct 2014 19:45:53 +0000 (12:45 -0700)
commit393b1c1e88cbdd0f65c8f217c495dbbe8de9125d
tree890ac0f1a0ad574604c3c44c83dbfbe9be1ffb25
parenta9a550dd8e87b33979670cf856838ba227500547
Fix issue #17789629: PopupWindow overlaps with navigation bar.

The Lollipop release introduced a feature that allowed
apps to extend under the navigation bar. This also means
any popup window that is anchored to the bottom of its
parent window will overlap with the navigation bar if the
parent window is extending underneath the navigation bar.

This change introduces a new window flag
(FLAG_LAYOUT_ATTACHED_IN_DECOR) that allows the app to
specify if the popup window should be attached to the decor
frame of the parent window thereby avoiding an overlap
with the screen decorations.

By default the flag is set on SDK version LOLLIPOP_MR1 or
greater and cleared on lesser SDK versions.

Also, replaced flags FLAG_NEEDS_MENU_KEY and
PRIVATE_FLAG_NEEDS_MENU_KEY_SET with needsMenuKey state
variable to make room for the new
FLAG_LAYOUT_ATTACHED_IN_DECOR flag.

Bug: 17789629
Change-Id: I2150e0c6ac688c966c0e8f7e54d42fd20285bea6
api/current.txt
core/java/android/view/Window.java
core/java/android/view/WindowManager.java
core/java/android/widget/PopupWindow.java
policy/src/com/android/internal/policy/impl/PhoneWindow.java
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
services/core/java/com/android/server/statusbar/StatusBarManagerService.java
services/core/java/com/android/server/wm/WindowState.java