History log of /frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
01011c3d7ce4f76c1a76b33a04fc63da784ddbea 21-Feb-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6037252: Screen shifts after all apps are upgraded

Two things: (1) make sure the boot message is always positioned within
the entire unrestricted display, and (2) allow the dim background to go
on top of the nav bar when being used for the boot message (this latter
is really a hack that should be more generally fixed in the future).

Change-Id: I7261b044eb802a39cadff931b50a679ff18781d6
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
a486a53a02392c5d5de5a3d0856433a25e56b110 24-Jan-2012 Dianne Hackborn <hackbod@google.com> Fix issue #5906017: Missing menu entries in portrait when in compatibility mode

This was a bug only when the status bar was hidden, the screen space for
the nav bar would not be correctly removed for all frames used in layout
computation.

This code really $*#&^!! needs to be cleaned up, the whole "status bar
is the system bar when on a tablet so it should take space from apps,
but status bar doesn't do that on phones but on phones there is a nav
bar that does the same thing" thing is whacked.

Proof that evolution DOESN'T WORK!!!!!!!!!!

Change-Id: I24e4994328480820cb638e7a40aa0b65b7ae2003
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
cfbf7dedaddd825b608e87d3dcf46adf80a46976 12-Jan-2012 Dianne Hackborn <hackbod@google.com> Fix issue #5823276 again: home repaints after full-screen app is exited

Don't consider a window as a candidate for the top fullscreen window
if it is not going to be a candiate for layout.

This fix does not include the change to ignore app tokens that are
hidden. This causes problems in some dialogs that stay hidden until
their app is ready to display, but need to perform a series of relayouts
during that time to get to the right size. Dropping this part of
the change still (mostly?) seems to allow us to avoid the bad states.

Change-Id: Ic052cb1499d3287f47e9ffeac5cd2470ee5a308c
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
170997a519ce79e93e4f6984e9663232475ce92c 19-Jan-2012 Justin Ho <justinho@google.com> DO NOT MERGE Revert "Fix issue #5823276: home repaints after full-screen app is exited"

This reverts commit 01b02a734d2988c22b00f5df6346ad03d8bf52b6.

Change-Id: I848c01fc44eb9a51ead1116b2647ed838ec1825f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
230a709285abc5dfd92f05d91a8997d52a59d3c7 19-Jan-2012 Jim Miller <jaggies@google.com> Merge "Fix 5863053: Add method to lock screen immediately." into ics-mr1
93c518e4f8abd98f87cda1712b30a5a86cfa60dd 18-Jan-2012 Jim Miller <jaggies@google.com> Fix 5863053: Add method to lock screen immediately.

This fixes a bug where the device fails to lock when DevicePolicyManagerService
requests the device to be locked and the screen was off because the user hit
the power button.

The change allows DPMS to directly invoke screen lock, bypasssing the screen state.

Change-Id: Iecdda6fc61e9c519119de495be23c69c3b983921
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
01b02a734d2988c22b00f5df6346ad03d8bf52b6 12-Jan-2012 Dianne Hackborn <hackbod@google.com> Fix issue #5823276: home repaints after full-screen app is exited

Don't consider a window as a candidate for the top fullscreen window
if it is not going to be a candiate for layout.

Also don't consider windows a candidate for layout if their app token
is hidden. This fixes a transient state where we are preparing to
unhide the window but have not done so yet.

Change-Id: Ife5299ffa003c1df1a4f787b7a2809cbf614ec16
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
73ab6a49db2b834ce1d56c7a1164938b409ee6fc 13-Dec-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5755172: Soft menu key disappears when menu is open

We need to work more like before in determining whether the menu
key is needed -- in some cases look back in the window list to
determine this if we don't know the value from the current window.

This requires adding a new private flag indicating whether the
compat menu state is known for a window, which is set by
PhoneWindow as part of its existing process of computing the flag
for its own windows.

Now we can have a new API on WindowState to determine the value
of this flag for a window, which if needed walks back in the window list
to find a window the value is known for (or stops at what the policy
has determined is the top full-screen window, so we stop like we used
to at things like the lock screen or the bottom of an application).

Change-Id: I829de6d629b5af8bcb422cb85249ee4041c7205e
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
e0e9fd981ca71aeaa45c888485c11788456bd838 08-Dec-2011 Jeff Brown <jeffbrown@google.com> Merge "Fix system hotkey handling." into ics-mr1
68b909d8acd92343fa0b1dff2f77fcd9d9991f9f 08-Dec-2011 Jeff Brown <jeffbrown@google.com> Fix system hotkey handling.

Fixed a problem where the key up for the ALT or META key was not
delivered to the task switcher dialog because it was deemed
to be inconsistent with the window's observed state. Consequently
the dialog would not be dismissed when the key was released.

Moved global hotkey handling for META+* shortcuts and ALT/META-TAB
into the window manager policy's interceptKeyBeforeDispatching
method. This change prevents applications from hijacking these
keys.

The original idea was that these shortcuts would be handled only
if the application did not handle them itself. That way certain
applications, such as remote desktop tools, could deliberately
override some of these less important system shortcuts.
Unfortunately, that does make the behavior inconsistent across
applications. What's more, bugs in the onKeyDown handler of
applications can cause the shortcuts to not work at all, for
no good reason.

Perhaps we can add an opt-in feature later to enable specific
applications to repurpose these keys when it makes sense.

Bug: 5720358
Change-Id: I22bf17606d12dbea6549c60d20763e6608576cf7
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
0e385ee4de901f4c509374fad5bc040a2ac80721 08-Dec-2011 Dianne Hackborn <hackbod@google.com> am b32785c6: Merge "More fixing for issue #5366535: Lockscreen has wrong layout..." into ics-mr0

* commit 'b32785c6e893743956e28b285b8e6f6fc7aa8edb':
More fixing for issue #5366535: Lockscreen has wrong layout...
d9efb95a0e3ffa06232aeaaeedadfcca2ab93603 07-Dec-2011 Dianne Hackborn <hackbod@google.com> More fixing for issue #5366535: Lockscreen has wrong layout...

...but corrects itself

Change upgrade window to not allow the device to rotate while it is shown.

Change-Id: I75b126ab8806b84a0351e2706ebea10570bde575
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
eb3e4b98a45722d5d1ea73e45d86c119d678bb05 07-Dec-2011 Jeff Brown <jeffbrown@google.com> Make the dock orientation override the HDMI orientation.

Bug: 5714422
Change-Id: I5a229f987fb88a25d2e49d0c73184f556ffc1114
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
f5b8671c340f189c50b41c53622f979b6d5e0a57 06-Dec-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5714517: App shortcuts can result in bad task intents

New API to let you build an Intent whose base configuration is correct,
but has an additional "selector" to pick out the specific app that you
would like launched.

Change-Id: Ide9db6dc60e2844b7696cfe09b28337fe7dd63db
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
2a40d0d92b208021b492e9af3d944720cbf269fc 01-Dec-2011 Daniel Sandler <dsandler@android.com> Merge "Put screensavers back in the icebox for now. DO NOT MERGE." into ics-mr1
e0f085d4b8f313179825f2b051cb403736a7d01a 01-Dec-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5433192 and maybe #5433192

5433192: Factory reset device: compatibility screen is the first...
...screen before setup wizard

Don't show compat mode dialog if compat mode is unknown (which happens
early in boot before an activity is shown for example). Also make sure
to update status any time the current focus app token changes, so we
correctly update every time switching apps.

5651152 [Stingray] change zoom/strech setting icon won't go away

This is probably also fixed by updating when the app token changes.

Change-Id: Ibe9bd6277166230d5d96689741b78325ea099d57
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
d2b22a885a79d537c79e98257647cc120bde2998 30-Nov-2011 Daniel Sandler <dsandler@android.com> Put screensavers back in the icebox for now. DO NOT MERGE.

Bug: 5689684
Change-Id: I3a5291c3520bb43e35d55714f1522e4ae7f6e63c
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
be6ab576ff0e3bf2a8dc3feee6f476061afbda30 29-Nov-2011 Jeff Brown <jeffbrown@google.com> Merge "Fix application launch shortcuts." into ics-mr1
50b2042502bc459b40430fe3b3b83d7d61e5daf9 29-Nov-2011 Dianne Hackborn <hackbod@google.com> Merge "Another attempt at getting OOM reports to batch." into ics-mr1
672342c30903fa6b70a3e8e1977bb34210aede14 29-Nov-2011 Dianne Hackborn <hackbod@google.com> Another attempt at getting OOM reports to batch.

We now generate a stack-trace looking thing at the top of the report.

Also fix a bug I hit where the phone window manager was sending a
broadcast before the boot had completed.

Change-Id: I0cee16180e4d05c9bd3fe715212a28f504ec91ac
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
6651a638348c15e89e265b0a53c775cac9beafa2 28-Nov-2011 Jeff Brown <jeffbrown@google.com> Fix application launch shortcuts.

Improved quick launch bookmarks to support category-based shortcuts
instead of hardcoding package and class names for all apps.

Added a set of Intent categories for typical applications on the
platform.

Added support for some of the HID application launch usages to
reduce reliance on quick launch for special purpose keys. Some
keyboard vendors have hardcoded launch keys that synthesize
"Search + X" type key combos. The goal is to encourage them
to stop doing this by implementing more of HID.

Bug: 5674723
Change-Id: I79f1147c65a208efc3f67228c9f0fa5cd050c593
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
7d46c613f6bfeb6638c6aafb52eab417ad8eef52 23-Nov-2011 Daniel Sandler <dsandler@android.com> Quick fix for bug 5646217 blocking automation tests

The screen saver knows to avoid running when applications
are holding wake locks via window flags, but other wake
locks are invisible to the window manager and therefore to
the screen saver activation code.

The correct thing to do is move the screen saver to the
power manager to give it access to all wakelock information.
In the meantime, this fix checks for the user's
STAY_ON_WHILE_PLUGGED_IN setting and disables the screen
saver in this case.

Bug: 5646217
Change-Id: Ia2286a8c3745267871901f7a0b7df94ec344a456
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
5207d9c94b31cd2da1c4a52c2ae7f9c1f50ccad1 18-Nov-2011 Daniel Sandler <dsandler@android.com> Dismiss system windows when screen savers start.

Also add a couple more flags to the intent:
- NO_HISTORY (finish activity on suspend)
- FLAG_FROM_BACKGROUND

Bug: 5578434
Change-Id: I97b965175a27760b819dc29ddb57865c5f4754d6
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
2d54536d08a59680078f78bc6301379563df4c85 17-Nov-2011 Daniel Sandler <dsandler@android.com> Dreams (now Screen Candy) development.

- support for global "disable" setting
- renamed settings provider keys to remove "DREAM"

Bug: 5591015
Change-Id: I31f31b3ca6001fec1e0032a49cdf0d10df7b0ec7
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
7e37df5d1f77a8cb3119b9bc66198d467ce57b22 17-Nov-2011 Daniel Sandler <dsandler@android.com> Tie screen saver to the screen off timeout.

The window manager now monitors the plug state; the screen
saver will never be automatically started if the device is
running off battery.

Change-Id: Ib1064d9cdd540238957df3ba7020303b0f6943c2
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
d5decdccc64c59ad62de86c70dbe9ead12150cdc 17-Nov-2011 Daniel Sandler <dsandler@android.com> Merge "Disable desk dock apps." into ics-mr1
f52a4482dd3ca336f84fc6c533ea4a99a72b23dd 17-Nov-2011 Daniel Sandler <dsandler@android.com> Merge "Add a default Dreams component." into ics-mr1
11ddf533a2165ca68002d3b48e312271b3d0dedb 16-Nov-2011 Daniel Sandler <dsandler@android.com> Disable desk dock apps.

When a device is attached to a desk dock, the
CATEGORY_DESK_DOCK intent will no longer be fired.
As a side effect, the "dock home" behavior (which captures
the home key for the dock app as long as the device is
docked) is now disabled for desk docks.

Car docks are unchanged.

Bug: 5591015
Change-Id: I7884f655913c31cf53b88cb2e2b371987be27f64
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
c224f76303b3124c76768761c544410b86b732f8 16-Nov-2011 Daniel Sandler <dsandler@android.com> Add a default Dreams component.

Currently set to DeskClock's screensaver, but since it's a
(private) string in f/b/c/r/r/values/config.xml any product
could overlay this.

Bug: 5611008
Change-Id: I7a4623c9c667a6cff8ed80ad600a8a4460bfafb7
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
dec6cf4f30a823a004d853915bc13c59d607f285 15-Nov-2011 Jeff Brown <jeffbrown@google.com> Override app requested orientation when docked.

Applies to docks, lid switch, HDMI and rotation lock.
We always choose a mode that is compatible with the application's
request, so if in a landscape dock, we might override a request
for seascape but we leave requests for portrait alone.

Bug: 5620454
Change-Id: Ib0c4f60f7f9e3aeafaba9c717233a950fccb8af2
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
be425ccea47c13d3f8f3d877fdbdcb3c074f7e8b 11-Nov-2011 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #5522658: Menu button shown on lock screen if app underneath requests it" into ics-mr1
4eff8d37da8f9fa24c00dc4b1fa33300b2b510c8 11-Nov-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5522658: Menu button shown on lock screen if app underneath requests it

Drive the menu button off of the currently focused window. That is, after all,
the one that is going to receive the menu key event.

Change-Id: I61cac1e274602e5ea53402ab15bd63a9cd89e9cd
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
88089ccc79ee7ba5f48ade9bb73a99cf05f6ec62 10-Nov-2011 Jeff Brown <jeffbrown@google.com> Merge "Wake on volume key when in dock. Bug: 5580373" into ics-mr1
43150bfa9377ca7a5fe0e6bfcdc04fb5807501f7 09-Nov-2011 Jeff Brown <jeffbrown@google.com> Wake on volume key when in dock.
Bug: 5580373

Change-Id: I847fb10b48c2e5e26cabefea1d630793efc32131
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
56b53b597f015fa73ca339deff62eadf287297ae 10-Nov-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5470311: Activity with android:configChanges defined...

...should not be restarted when rotating screen on xoom

This was a side-effect of a previous fix to compute the screen layout
config class based on the actual space available to the application, not
the raw display size. On a device like Xoom, the system bar causes us
to switch between LONG and NOTLONG depending on whether the system bar
is on the short or long side of the screen.

To fix this, we now compute the screen layout class the same way
"smallest width" is computed: looking at all of the possible rotations
and using the smallest of them all. In addition to preventing the device
from toggling between long and notlong on a Xoom-like screen, this will
also avoid other possible undersireable behavior like changing screen
layout size when rotating.

This does mean that Xoom is no longer considered a long screen even when
in landscape, because it is not a long screen in portrait.

Change-Id: I85f90a16294ef5a7de94d5b9231abbc6f914fe90
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
1a693182669133c57eda91a4e465e6cd55718f63 08-Nov-2011 Jeff Brown <jeffbrown@google.com> Handle EXTRA_DOCK_STATE_LE_DESK and HE_DESK.
Bug: 5569662

Change-Id: Ib8cb9fb68a1a2d3520f34f7fbf6f002dfb91809d
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
e5f2cfeb229881601e81f9afca62bccbdc8e6485 03-Nov-2011 Daniel Sandler <dsandler@android.com> Bring back Android Dreams.

Also fix bugs related to loading changes in dreams settings.

Bug: 5121105
Change-Id: I1527c3100d5219a678dd94ed5393bc478b1a1622
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ff20471b082996243224e006cad19fef8fa80d7c 26-Oct-2011 Jeff Brown <jeffbrown@google.com> Fix power key handling after volume change.
Bug: 5497716

We should only cancel the pending power key when there
actually is one pending.

Change-Id: Iab684d24a643e1be4a8abde5cf905ca1819e9aa8
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
b0994ed7ffd31d02b9d66a470decfdfaf0d6f8ee 24-Oct-2011 Xavier Ducrohet <xav@android.com> CherryPick 35530d from master to mr0. do not merge.

qemu.hw.mainkeys indicates if the device has h/w main (home/back) keys.

If it has main keys, then the navigation bar is *not* displayed.

Change-Id: Idb36a1f787360363a009463f0c016a423594a5b9
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
0c4ccff36930ff4f0292b94ad51e164c9fa060a3 19-Oct-2011 Daniel Sandler <dsandler@android.com> Add hasNavigationBar() to the window manager.

It is no longer sufficient to check the value of
internal.R.bool.config_showNavigationBar to determine if a
navigation bar (separate from the status bar) is shown on a
device, because the emulator needs to be able to override
this value (now possible by setting qemu.hw.mainkeys to "1"
or "0", for navbar or no navbar, respectively).

This logic is now contained in PhoneWindowManager, and any
clients wishing to know whether the system has a software
nav bar should consult the new hasNavigationBar() method.

Bug: 5404945
Change-Id: I119d32a8c84b88b2ef46f63244e7f11dc5de0359
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
a63bb84bbe98e72871c2138ab3eb517d0f9a80ef 17-Oct-2011 Winson Chung <winsonc@google.com> Updating screenshot animation and behaviour. (Bug: 5333706)

- Removing the second ticker text
- Adding a new animation to the status bar
- Adding a large icon to the notification

Change-Id: I8778178519fc72ffc299e8d624069b684475191d
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
05f1cdc3e9aca13ea30f77bb750d3be4340e708d 18-Oct-2011 Dianne Hackborn <hackbod@google.com> Fix stupid bug breaking touch on devices without a nav bar.

Change-Id: Id76b7ab5625470fcc72541fb2fe8845cddba523f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
e26ab70de2f80de95264990a7af07fd445637065 16-Oct-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5398675: It's (too) easy to keep the navigation bar...

...from ever becoming visible

Now there is a 1 second delay from when the user dismisses the nav bar
until when it can be re-hidden.

Also move the code for capturing touch events while nav bar is hidden
out to be used even when there is no nav bar, so this API behaves
consistently across devices whether or not they have some element of
the UI that is being hidden. On devices with a nav bar, this will
all work the same as prime (the flag is set, the app gets the callback
about the flag being set, when the user touches that touch is captured
so the app doesn't see it put does clear the flag and tell the app
about this).

Change-Id: Icb5ea0ddaf614aa3f12d2140796217f128761dee
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
38cc8960cbe09f8cb028a0cf8798c8c6fc75df33 13-Oct-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5446988: WindowManager warns BOOT TIMEOUT,...

...dev.bootcomplete flags is set before boot animation is out

Also:

- Fix crash in recent apps if the intent for an old app didn't
happen to have the new task flag set.
- Fix issue where a crash in system UI would cause the crash
dialog to be displayed below it, effectively locking the UI. Now
the crash dialog for persistent processes is shown above everything
else.

Change-Id: I0312001a92beeae5f644c7c3e5c5e19f6716df36
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
d5bb82d18cbd95bb9e751d8315b9ed0b69595033 12-Oct-2011 Jeff Brown <jeffbrown@google.com> DO NOT MERGE. Improve screenshot chord debouncing.
Bug: 5011907

Introduce a 150ms delay in handling volume down keys
while waiting to see if a power key will follow.

Don't trigger the screenshot chord if both volume up and
volume down are pressed together.

Don't trigger the long-press power menu if volume keys are
also pressed.

Require the user to press both keys in the chord within
the debounce time and continue long-pressing them in order
to trigger the screenshot action.

Change-Id: I248968d37b73c09d6d08e7f62667c443eba32da0
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
df89e65bf0fcc651d20b208c8d8d0b848fb43418 07-Oct-2011 Dianne Hackborn <hackbod@google.com> Fix how we hide and show the nav bar.

The PhoneWindowManager is now responsible for hiding and showing
the nav bar.

For hiding, it just moves it off the screen (easy way to get a
nice slide animation on and off). At the same time, we use a
new WM facility to put up a fake input window to capture all
touch events.

When a touch event is received, we force the system UI to clear
the navigation hiding bit so it will be shown again.

This removes a bunch of code from the system UI for hiding and
showing the nav bar. Also removes the code calling from userActivity()
to the system UI, which was bad. (Also no longer using userActivity()
fixes bugs around re-showing the nav bar due to key presses and
other wrong things.)

Change-Id: I8c3174873b5bcaa36a92322a51e8f7993e88e551
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
85b9edf2da0534bc53d139bb88cda8866d265afe 07-Oct-2011 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #5371530: SYSTEMUI_FLAG_HIDE_NAVIGATION reasserts itself immediately"
9a230e01a1237749a8a19a5de8d46531b0c8ca6a 06-Oct-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5371530: SYSTEMUI_FLAG_HIDE_NAVIGATION reasserts itself immediately

This cleans up how ui flags are managed between the client and window manager.
It still reports the global UI mode state to the callback, but we now only clear
certain flags when the system goes out of a state (currently this just means the
hide nav bar mode), and don't corrupt other flags in the application when the
global state changes.

Also introduces a sequence number between the app and window manager, to avoid
using bad old data coming from the app during these transitions.

Change-Id: I40bbd12d9b7b69fc0ff1c7dc0cb58a933d4dfb23
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4dfce20cac7492882d366d053006795aefad59da 05-Oct-2011 Jeff Brown <jeffbrown@google.com> Make SENSOR orientation modes trump rotation lock.
Bug: 5371750

Change-Id: I4d18b6c8ba1de0afd5929ddb8d7123272e35fbe2
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
9a41ef890dac73b8d439d9b725ec79fdad050486 27-Sep-2011 Erik Gilling <konkers@android.com> allow override of HDMI rotation

This allows kiosk/demos to be given in portrait mode. Set with:
adb shell setprop persist.demo.hdmirotation portrait

Change-Id: Ic0c858dcf6329ca34180f582d4869539dde8f69b
Signed-off-by: Erik Gilling <konkers@android.com>
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4c253119db0ce753e46ec3809b54b9e357d363db 24-Sep-2011 Jeff Brown <jeffbrown@google.com> Merge "Prevent unintended rotations. Bug: 4981385"
c0347aa19f354a8e1ff4fcd5372b134c0c7c16ad 24-Sep-2011 Jeff Brown <jeffbrown@google.com> Prevent unintended rotations.
Bug: 4981385

Changed the orientation listener to notify the policy whenever
its proposed orientation changes, and changes the window manager
to notify the orientation listener when the actual orientation
changes. This allows us to better handle the case where the
policy has rejected a given proposal at one time (because the
current application forced orientation) but might choose
to accept the same proposal at another time.

It's important that the proposal always be up to date. A proposal
becomes irrelevant as soon as the phone posture changes such
that we can no longer determine the orientation with confidence
(such as when a device is placed flat on a table).

Simplified the orientation filtering. Now we just wait 200ms
for the device to be still before issuing a proposal. The idea
is that if the device is moving around a lot, we assume that
the device is being picked up or put down or otherwise in
the process of being moved. We don't want to change the rotation
until that's all settled down. However, we do want to tolerate
a certain amount of environmental noise.

(The previous confidence algorithm was also designed along
these lines but it was less direct about waiting for things
to settle. Instead it simply made orientation changes take
longer than usual while unsettled, but the extra delay was often
too much or too little. This one should be easier to tune.)

Change-Id: I09e6befea1f0994b6b15d424f3182859c0d9a530
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
90c52de28691ca0bbbf7c039ef20f85ce46882cc 23-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5173952: Opening a Notification From Lock Screen...

...Should Skip Unsecure Lockscreen (ICS)

Also while I am in there, clean up logging of intent objects to include
even less sensitive information, while showing the true Intent in dump
output (since apps can't get to that).

Change-Id: I35fed714645b21e4304ba38a11ebb9c4c963538e
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
400110902e1680eebe70aed583789870e31758f6 22-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5355844: PowerManager does not call screenTurningOn after boot.

Be more explicit about initialization -- power manager never sends
screen update when first initializing, phone window manager retreives
current screen state and applies that itself when initializing.

Change-Id: I8294ed36d700e186c1637754df8c8183721c15dd
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
d3187e39b04c79810630bed30940ad39847aadab 22-Sep-2011 Jeff Brown <jeffbrown@google.com> Disallow 180 rotation for phones.
Bug: 4981385

Change-Id: Icaed9cfe4ee9771ca5951abcd1173024d87a024b
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
01a98ddbdfbaf1f0d2bc602537e6e314364902a3 21-Sep-2011 Jeff Brown <jeffbrown@google.com> Handle orientation changes more systematically.
Bug: 4981385

Simplify the orientation changing code path in the
WindowManager. Instead of the policy calling setRotation()
when the sensor determined orientation changes, it calls
updateRotation(), which figures everything out. For the most
part, the rotation actually passed to setRotation() was
more or less ignored and just added confusion, particularly
when handling deferred orientation changes.

Ensure that 180 degree rotations are disallowed even when
the application specifies SCREEN_ORIENTATION_SENSOR_*.
These rotations are only enabled when docked upside-down for
some reason or when the application specifies
SCREEN_ORIENTATION_FULL_SENSOR.

Ensure that special modes like HDMI connected, lid switch,
dock and rotation lock all cause the sensor to be ignored
even when the application asks for sensor-based orientation
changes. The sensor is not relevant in these modes because
some external factor (or the user) is determining the
preferred rotation.

Currently, applications can still override the preferred
rotation even when there are special modes in play that
might say otherwise. We could tweak this so that some
special modes trump application choices completely
(resulting in a letter-boxed application, perhaps).
I tested this sort of tweak (not included in the patch)
and it seems to work fine, including transitions between
applications with varying orientation.

Delete dead code related to animFlags.

Handle pausing/resuming orientation changes more precisely.
Ensure that a deferred orientation change is performed when
a drag completes, even if endDragLw() is not called because the
drag was aborted before the drop happened. We pause
the orientation change in register() and resume in unregister()
because those methods appear to always be called as needed.

Change-Id: If0a31de3d057251e581fdee64819f2b19e676e9a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
bc1aa7bbc753ebcd32da4507fa23215489b6d314 20-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5312624: Lock screen very flickery

The key thing was to fix isVisibleOrBehindKeyguardLw() so that it
wouldn't count a window as not visible if it was just currently
in the process of drawing due to an orientation change.

Also improve logic in deciding when to turn screen on to better ensure
the screen is in a stable state, in particular treating screen off
as a frozen screen and not allowing it to turn on until the
update of the screen due to any config change is done.

Change-Id: If82199f3773270b2d07f9c7de9da2dad8c7b28d7
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
38e29a61d0c87fe3e391d24e2eb11dd1800d107d 18-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5242779: Device not responding to touch on unlock screen

Rework how we decide when it is okay to turn on the screen by having
the policy call back to the power manager when it knows the lock screen
has been drawn.

Change-Id: Ie8f3f72111dcf7f168723e6dce24e0343b4afe5d
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ec537457cd2869e52b9b2c99e8c01dd96a9682e2 15-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5155678: Portrait > Landscape full-screen transition...

...mode cuts off screen rendering

The code for limiting application window sizes to not include the
navigation bar was dead. Now it is back.

Change-Id: Ic0bde56e3300fd0d9d225e19d8de2766d07e8780
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
1f903c3b577d20f7db7e3d5875cafe577d0d845f 14-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5283365: Rotating the device to portrait mode, hides the keyboard partly

PhoneWindowManager now takes full responsibility for deciding where the
navigation bar goes. This gets rid of a bunch of race conditions with
determining layout while the nav bar is moving itself at the same time
the window manager is computing a new configuration.

Note that this breaks the "nav bar on left" option. The current nav
bar code could also be cleaned up some more to completely drive its
behavior based on onSizeChanged() happening during relayout.

Change-Id: I1651d74c3464ba0d588aab3049e099c78420146a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
28739171f2135c1083dc5f87a3827f9212a55580 14-Sep-2011 Daniel Sandler <dsandler@android.com> Merge "When the status bar hides, close the notification panel."
98392efb24d8aac36a4cfa85106812e17d5984f9 13-Sep-2011 Jeff Brown <jeffbrown@google.com> Fix bug in KeyButtonView key injection logic.
Bug: 5299191
Bug: 5300282

Only send keys when mCode != 0.

Simplified the logic for repeating / non-repeating keys.
Key down / up are always correlated with touch down / up, the
only thing that's special is that we detect long press for
repeating keys and not for others.

Ensure that up or cancel is always sent for every key
that is generated. Previously it was possible for keys to get
stuck down if touch moved out of the button's active area.

Removed the funky HOME long press timer. We don't need it
since we can rely on the long-press flag instead. Since the
system UI is in direct control of key repeating and long-press
behavior for the keys it inject, this eliminates the need for
special hacks to circumvent the timer.

Ensure that the same haptic feedback is provided for all keys,
including the recent apps key. Previously this only worked
because the code was injecting a bogus key with code 0.

Don't generate repeated haptic feedback for virtual keys
even when those keys are injected. This doesn't happen
for virtual keys synthesized by the InputReader because it
never injects repeats itself (the InputDispatcher synthesizes
them), but it is an issue for the KeyButtonView.

Change-Id: I8b3615dde738af28e76898d161d6ce9a883b59ec
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
9c00d5b8e7390799cc63d7c8d073de5802463250 13-Sep-2011 Daniel Sandler <dsandler@android.com> When the status bar hides, close the notification panel.

Bug: 5087130
Change-Id: I8a63f424158faa3266f6904c0a57ac352a0555e4
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
bfcb60ab0f696c8ef70830c365550e62fe2808bf 09-Sep-2011 Jeff Brown <jeffbrown@google.com> 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
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
5d927c2d8e832fcfcb0154c8741f896001141ef4 02-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5150899: Call activity takes 15MB we never get back.

Persistent process can no longer use hardware acclerated drawing
when running on a low-memory device.

Change-Id: I3110335617af1c98fcede9bf41f4a1d0c20d0e87
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ba24e4d8bbeb60e96d74f05e21691dad61ce497e 01-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5229575: Youtube link shared through messaging is not...

...opening after selecting option "Youtube" as a luncher.

Also:

* Tweak window animations so that the wallpaper exist animations do not
stop too early (causing the wallpaper to suddenly disappear).
* Make sure no input is being processed while booting, to avoid
accidentally doing things especially in the upgrade dialog.
* Some other small cleanup.

Change-Id: I40a6b53731991d4e31ac4502e3d85f0e47507481
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
d040edbae968d826aa2c82d382345811a45c646b 31-Aug-2011 Dianne Hackborn <hackbod@google.com> Use floating point window positions.

Gets rid of gapps between windows during animations.

Change-Id: I17d2ef0af214008f0eabd7eb19268f145fe83b39
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
cc4f7db698f88b633a286d8ab1105b28a474cd09 31-Aug-2011 Jeff Brown <jeffbrown@google.com> Fix input channel leak.
Bug: 5156144

Input channels could leak or simply live longer than they should
in some cases.

1. Monitor channels (used by the pointer location overlay) are never
unregistered, so they would leak.

Added code to handle failures in the receive callback by closing
the input channel.

2. The DragState held onto its input window and application handles
even after the input channel was disposed.

Added code to null these handles out when they are no longer needed.

3. Input channels previously used as input event targets would stick
around until the targets were cleared (usually on the next
event).

Added code to detect when the input dispatcher is in
an idle state and to proactively clear the targets then
to ensure that resources are released promptly.

4. Native input window handles held onto the input channel even
after the input window was removed from the input dispatcher.
Consequently, the input channel would not be disposed until
the input window handle itself was freed. Since the input
window handle is held from managed code, this meant that the
window's input channel could stick around until the next GC.

Refactored the input window handle to separate the properties
(info) and identify (handle) state into different objects.
Then modified the dispatcher to release the properties (info)
when no longer needed, including the input channel.

7. The pointer location overlay does not actually use its
standard input channel, only the monitor input channel.

Added INPUT_FEATURE_NO_INPUT_CHANNEL to allow windows to
request that they not be provided with an input channel
at all.

Improved some of the error handling logic to emit the status
code as part of the exception message.

Change-Id: I01988d4391a70c6678c8b0e936ca051af680b1a5
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
295e3c27e4e3762a002382fc1657f5f0070a3410 25-Aug-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5214105 and work on issue #5109947.

Change-Id: Iff2cfec5280a314989d915aa830c16124f921611
5214105: taking a screenshot while "Android is upgrading..." crashes device
5109947: Race condition between retrieving a content provider and updating its oom adj
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
29aae6f36e565b8f2a99f2193597b964bb800ee8 19-Aug-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4279860: previous UI flashes before showing lock screen...

...(when turning display on after recently turning it off)

Also clean up when we decide to turn the screen on to improve that
transition. There are still problems here with turning it on
before the wallpaper gets dispayed.

Change-Id: I2bc56c12e5ad75a1ce5a0546f43a845bf0823e66
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
661cd52e0e1d527132eb1cae604d3e64da7ec0cb 22-Aug-2011 Dianne Hackborn <hackbod@google.com> Add progress dialog for booting after an upgrade.

This introduces a new facility for code during the boot process
to display messages to the user through a progress dialog. This
is only for use when performing longer-than-usual post-upgrade
operations such as running dexopt on applications or upgrading
databases.

Change-Id: I0e78439ccec3850fb67872c22f235bf12a158dae
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
c0e3f2453cd8fcb9f587070bc41590b59e9f1e30 19-Aug-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5186318: Can't take multiple screenshots

Locking good. Races bad.

Change-Id: I59dd0ec2de47973c38fd646c2f441dd174eba444
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
fc8fa638617efb5695a1f89ea75375faebbe2a40 18-Aug-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5128639: SystemUI grows by 10MB after taking a screenshot

We now do the screenshot in a separate process.

Also change the recents panel to not use hardware acceleration
on lower-end devices. And improve how it gets shown to not
load all data up-front which results in a long delay when you have
lots of recents.

Change-Id: Ia309a90f9939e5405758621b3f7114597bd0c02a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
bb04b678cdc19119c98d1edfdbb732983e490e66 17-Aug-2011 Erik Gilling <konkers@android.com> Merge "Set rotation to landscape on HDMI instead of 0"
10a058c96b20aad06066f40f7f4fcd6a7b8aa0b7 17-Aug-2011 Erik Gilling <konkers@android.com> Set rotation to landscape on HDMI instead of 0

When the native orientation of the device is not landscape HDMI display
will be wrong.

Change-Id: Ie1d4f6b7247e0a43ff13b5318b644ec7cff293f2
Signed-off-by: Erik Gilling <konkers@android.com>
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
62f20ecf492d2b29881bba307c79ff55e68760e6 16-Aug-2011 Dianne Hackborn <hackbod@google.com> Add new am option to profile the launching of an activity.

Change-Id: Ie71a8043eafe41f53a0b3dbb5170276d87acbc9b
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
36412a7e7c4929bdac1221b7ced9e73d0d204691 04-Aug-2011 Daniel Sandler <dsandler@google.com> Subtract the navigation bar from DisplayMetrics.

Its region is now treated like the system bar: inaccessible
to applications and therefore not worth reporting as part of
the display.

(Note that using setSystemUiVisibility you can gain
temporary access to the navigation bar region, unlike the
sempiternal system bar.)

The navigation bar is now considerably less in control of
its own behavior (the window manager assumes it will be a
certain size and in a certain position in landscape and
portrait). This change also fixes the navbar so that it
becomes GONE instead of merely INVISIBLE (allowing
underlying windows to expand in size accordingly).

Bug: 5052456 // the feature
Bug: 5067627 // notification shade falling behind the navbar
Bug: 4959805 // fix third-party apps relying on DisplayMetrics
Change-Id: I60257fc5c858e0edcaba8cfc1f8d58dd99a68258
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
e0018cc79089e8d0093ba8437d6370d414badb00 04-Aug-2011 Daniel Sandler <dsandler@google.com> Merge "Crushing Dreams."
e8ecde10b33b1d050d2b63b3f4cd20e8bb7c96d4 04-Aug-2011 Dianne Hackborn <hackbod@google.com> Whoops also need to move notification shade above lock screen.

And this requires making a new layer for the volume toast.

Change-Id: I4f272d56c87cf3b6bf886774b0fb02e610ab9164
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ee91d94e4bc9ae63bd2728dd0a3ba989554af5a0 03-Aug-2011 Daniel Sandler <dsandler@google.com> Crushing Dreams.

Bug: 4988983
Change-Id: I9874497fede77cad6644c21cb93a236c16376fb6
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
d859fa399133da32705415e138c897f263ae99ad 22-Jul-2011 Winson Chung <winsonc@google.com> Preventing screenshots when waking from sleep.

- Fixing crash in SystemUI when trying to access external storage while it is not mounted

Change-Id: I3d9a05c155b83a2cc39915caebad4b7016025d09
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
44b578aa4aadb964f85acedda6e691abf36700b0 22-Jul-2011 Daniel Sandler <dsandler@android.com> Merge "Subtract the navbar's bounds from fullscreen windows."
71baf1d82db71de5b0f123752e8724dd5fec528d 22-Jul-2011 Dianne Hackborn <hackbod@google.com> Move status bar above keyguard.

This is to make it possible to pull down the notification shade
while in the keyguard.

I tried a quick test and I don't see anything horrendously broken,
but who knows what kind of subtle layering issues may result.

Change-Id: I70107a18588fd3e61dd17dec407911c2f6c9e585
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
8e8b415bbdd2f30b1fcfdf799e70f076d4de81b0 21-Jul-2011 Daniel Sandler <dsandler@android.com> Subtract the navbar's bounds from fullscreen windows.

Bug: 4959805
Change-Id: I56743429077ab0cdefcc0062f45aa0bb1c7e60ce
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
9112ec3039dda4186c6f957981237c0691db2269 27-Jun-2011 Winson Chung <winsonc@google.com> Binding Pwr+VolDown to take screenshot.

Change-Id: I77b018538f6bc870f59df0b5336ba95f4582beec
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
3b1fc47d004f6b29af8f40d181baa3460b1e3b15 13-Jun-2011 Michael Jurka <mikejurka@google.com> Port recent apps from tablet to phone

- wire up to long press on home
- remove unused recents activity
- remove duplicate recents resources in -large directories (using -sw600dp instead)
- fix issue with zoom/scale translation when recents was brought up

Change-Id: I45538ccaff49b46ac3659c4828f9e2b0cd075241
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
3fe9cc5ea6a9e1acd52144c8ae6cb0492dba34ba 15-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of e95c07bd to master

Change-Id: I9af0c08a9f1c1f68661efe051a66835e850b76f6
7d04932ef5c001769ccef244f551b75773f1666b 15-Jun-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4603422: Compatibility mode button doesn't always update

We now tell the system bar every time the top activity has changed for
it to re-evaluate its UI state.

Also fix issue #: 4607102 Low rider notifications. It turns out this
was due to the change in the dialog asset; the notification UI was relying
on this having a lot of padding to make it sit above the status bar.
Now we have an explicitly mechanism to set how much it overlaps (or doesn't)
the status bar.

Change-Id: Iab5ebd86e620ff4fc4cd77206e18af962ec2830e
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
f741e679c496f7345304a6543f01d7048e31d1a7 10-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of e2aa0490 to master

Change-Id: Id0448a1598fc93aca0652b29253e02586e35a067
5fd2169eabd77e6bfafaf456e58051a3bafb2bca 07-Jun-2011 Dianne Hackborn <hackbod@google.com> Work on issue #4518815: Compatibility mode introduces compatibility regression...

...for Market App iRunner

There were a lot of serious issues with how we updated (or often didn't update)
the display and resource state when switching compatibility mode in conjunction
with restarting and updating application components. This addresses everything
I could find.

Unfortunately it does *not* fix this particular app. I am starting to think this
is just an issue in the app. This change does fix a number of other problems
I could repro, such as switching the compatibility mode of an IME.

Also a few changes here and there to get rid of $#*&^!! debug logs.

Change-Id: Ib15572eac9ec93b4b9966ddcbbc830ce9dec1317
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
678d344bcb5c7981b5033cdf8070c58783ded01b 03-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of b9e2f68b to master

Change-Id: Icb68aee4c68170f0e7cd7854dbaa61656a349142
50469db07167e3a837e10f215baa4eacb1319604 03-Jun-2011 Dianne Hackborn <hackbod@google.com> am 7322e557: am a4cfcf10: am 75d6b3c2: Merge "Fix issue #4502672: Wrong xml resources used for homescreen widgets." into honeycomb-mr2

* commit '7322e557cfe42da42779625d69ced2db74a9df90':
Fix issue #4502672: Wrong xml resources used for homescreen widgets.
b4b44bd32983e154f2ad61b99809ed6cedd46d47 03-Jun-2011 Daniel Sandler <dsandler@google.com> DO NOT MERGE. Restore status bar on phones.

Bug: 4529373
Change-Id: Ie08522dbf762e80ac077ce403ff83312cec907f7
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
631cb3d591c3f28ac989375d9ae689790a31236d 03-Jun-2011 Daniel Sandler <dsandler@google.com> Restore status bar on phones.

Bug: 4529373
Change-Id: I669774e734cb5f40c8944ffb5161c3b4bf7b2996
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ed60f81940c5f2125518c7c31ad4f61b8a9baf3e 02-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 76450622 to master

Change-Id: I26ccd8f264e65f100d894f43cf597a781552db83
a239c84525795ffc1828b545aa8069af88d26a71 01-Jun-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4500511: Holo effect background doesn't reach top of screen anymore

Change-Id: Iebefe924e71206f3e6388eaee64f7b1416bc3239
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
2f0b17573d4324832f7a20402a3d2b5920bc4866 01-Jun-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4502672: Wrong xml resources used for homescreen widgets.

There was a race in the system process between applying the initial
configuration and executing code in higher-level system services
like the app widget service that relies on the config. For some
reason it starting showing up more after my code changes; it should
now be completely fixed.

Also fix the activity starting window to run in compatibility mode
if its application is going to be in compatibility mode.

And some various cleanup and small fixes.

Change-Id: I0566933bf1bbb4259c1d99a60c0a3c19af1542e5
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
81e56d535c853d73ff537357da5b935f51cb779d 26-May-2011 Dianne Hackborn <hackbod@google.com> Rework how we decide whether to use system or status bar.

The PhoneWindowManager is now responsible for determing this,
since it needs to do this before we can generate the configuration
since we need to take into account the system bar size we will use.

Also the Display should now report the screen height without
including the system bar.

Change-Id: I82dfcc5e327e4d13d82c373c6c870f557a99b757
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
8c1132e3ceed8e1a8c696e2afe0e6fe456ccd7ef 26-May-2011 Daniel Sandler <dsandler@android.com> Merge "Framework support for Android Dreams."
d0132e8e187ebf69bf4d2d6d0ef0027ff3f7a727 07-Apr-2011 Jeff Brown <jeffbrown@google.com> Minor Alt-TAB / Recent Apps Dialog improvements. (DO NOT MERGE)

Alt-TAB should have different semantics from the APP_SWITCH key
or long-press on HOME. Accordingly, remove the fallback action
for Alt-TAB and initiate the task switching behavior directly
in the policy.

Modified RecentApplicationsDialog to be more precise about the
initial modifiers that it considers to be holding the dialog.

The dialog is now dismissed by a second press on the APP_SWITCH
key or by a second long press on HOME.

Change-Id: I07e72dc4e1f3cd8edaf357c1d49e79f60d6d1604
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
eea0aa25870d49e381567f09abbfb41de52a5a32 30-Mar-2011 Jeff Brown <jeffbrown@google.com> Support primitive ALT-TAB style navigation using Recent Apps. (DO NOT MERGE)

Change-Id: I0296a09519ba9417c208d197ebd996b586ee3daa
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
524ee64b91bc123e1ccfc881a0f1a1e84722251d 30-Mar-2011 Jeff Brown <jeffbrown@google.com> Support chorded fallback keys. (DO NOT MERGE)

Also be more careful about canceling fallback keys during focus
transitions, when the application handles the key, or when the
policy decides to do something different.

Fixed a crash due to JNI CallObjectMethod returning an undefined
value (not null) when an exception is thrown.

Fixed a crash due to the policy trying to create a Dialog for
recent apps on the dispatcher thread. It should happen on the
policy's Looper instead.

Bug: 4187302
Change-Id: I043f82913830f411b3bb4018d6422467b6ca454f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
0601eb7953cbf77d92826bef3ca37e208d922de7 13-Apr-2011 Daniel Sandler <dsandler@android.com> Framework support for Android Dreams.

A Dream is an activity that is launched by the window
manager after a specified idle time. You might think of this
as a "screen saver", but with the same capacity for
interactivity as any other application.

The window manager maintains a timer (like the screen lock
timer) that is reset on userActivity; the timer is suspended
during wakelocks and when the screen is off.

When the timer elapses, the user's preferred dream module is
launched (by reading Settings.Secure.DREAM_COMPONENT, which
is configured through the Settings app UI).

Like a dock app, the user can install new dreams and a
single application package may contain multiple dream
activities. Unlike the dock mode, however, there is no
"screensaver mode" for the system to manage. This allows us
to offer the user the ability to run a dream at any time, in
addition to making the overall mechanism quite simple.

There is no public API for this facility.

There is, however, a useful/recommended base class for dream
activities in the support library (change I4559a958).

Change-Id: Ied691856f88cfa38a7aca496d015f9a595da72f2
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
161e67ff3ba26408eea09221734ad2e29a1eed11 20-May-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 06a8ceac to master

Change-Id: Id51574c825affddfac14ad7214c5496d6a3d6e69
69cb87576ba163b61bb0e6477a3b7c57a9b11d40 20-May-2011 Dianne Hackborn <hackbod@google.com> Add new "-swNNNdp" resource qualifier.

Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
68066c2f38e47b56f0510c56eafd827731a0dc08 22-Apr-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE. From main -- Start work on simulating landscape/portrait when orientation is locked.

Not yet working, so turned off.

Also fix a bug where the display size configuration became inconsistent
after a configuration change -- we now figure out everything about the
display size when computing a new configuration.

Change-Id: Id155f133c0bf108508a225ef64ed3ca398a90a58
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
29735689cea7bf52998c1911542dcfdd1c1d9628 22-Apr-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE: From master -- Fix bug in deciding which rotation to use for an orientation.

Change-Id: Ie271123271a662f3f753f381ce4c43ad7904dc4a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
01defe403f3705ac5802e392ee18a78737c51fcb 11-May-2011 Daniel Sandler <dsandler@google.com> Merge changes I21e9629e,I535ed3ba

* changes:
Create an XML config flag to turn the navbar off.
It's lights out for you, navigation bar!
0129b31ff493bb0aa10b778cbeacbec5964644f8 11-May-2011 Daniel Sandler <dsandler@google.com> Create an XML config flag to turn the navbar off.

This will eventually be replaced by something else, probably
in Configuration, that allows the WM to tell everyone
(including the status bar) whether there exist hardware
home/back/etc. keys.

Change-Id: I21e9629ed43de4a944ad75e5b9d6d4ada8aba23f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
1d4d30aebd2c22627131819cabfe95f97def2c83 28-Apr-2011 Daniel Sandler <dsandler@google.com> It's lights out for you, navigation bar!

Views requesting lights out mode will cause the navbar to
disappear (this is useful for viewing videos/photos/etc
using every pixel of the screen).

But there's a catch: any user activity at all will cause the
lights to come back on and the navbar to return.

Change-Id: I535ed3ba9ae7fab3282c402be256add765395b6f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
aa9d84c37e05f696ec158dac98ce38cf41e18314 10-May-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 05be6d6f to master

Change-Id: Ic6a6c5bb300f6f1d43f9ed550b284282b4f16212
e2515eebf42c763c0a2d9f873a153711778cfc17 28-Apr-2011 Dianne Hackborn <hackbod@google.com> Better compat mode part one: start scaling windows.

First step of improving app screen size compatibility mode. When
running in compat mode, an application's windows are scaled up on
the screen rather than being small with 1:1 pixels.

Currently we scale the application to fill the entire screen, so
don't use an even pixel scaling. Though this may have some
negative impact on the appearance (it looks okay to me), it has a
big benefit of allowing us to now treat these apps as normal
full-screens apps and do the normal transition animations as you
move in and out and around in them.

This introduces fun stuff in the input system to take care of
modifying pointer coordinates to account for the app window
surface scaling. The input dispatcher is told about the scale
that is being applied to each window and, when there is one,
adjusts pointer events appropriately as they are being sent
to the transport.

Also modified is CompatibilityInfo, which has been greatly
simplified to not be so insane and incomprehendible. It is
now simple -- when constructed it determines if the given app
is compatible with the current screen size and density, and
that is that.

There are new APIs on ActivityManagerService to put applications
that we would traditionally consider compatible with larger screens
in compatibility mode. This is the start of a facility to have
a UI affordance for a user to switch apps in and out of
compatibility.

To test switching of modes, there is a new variation of the "am"
command to do this: am screen-compat [on|off] [package]

This mode switching has the fundamentals of restarting activities
when it is changed, though the state still needs to be persisted
and the overall mode switch cleaned up.

For the few small apps I have tested, things mostly seem to be
working well. I know of one problem with the text selection
handles being drawn at the wrong position because at some point
the window offset is being scaled incorrectly. There are
probably other similar issues around the interaction between
two windows because the different window coordinate spaces are
done in a hacky way instead of being formally integrated into
the window manager layout process.

Change-Id: Ie038e3746b448135117bd860859d74e360938557
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
7ba631f8b7ba823e943bdda623f7262b342e2c60 05-May-2011 Joe Onorato <joeo@google.com> If there is no hdmi available, still record that hdmi is not plugged in.

Bug: 4321927
Change-Id: I583b75477914f6ec0d6cb8c3d6775063202e1dbe
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
8956dbbc5f292d8b79072ae73b25f2114c8c7479 22-Apr-2011 Daniel Sandler <dsandler@android.com> On-screen navigation bar (separate from the status bar).

In Honeycomb we introduced navigation controls in the status
bar, for xlarge devices without physical buttons. What about
phones? The status bar is pretty cramped already, and
besides, it's at the top of the display most of the time,
not at the bottom where your thumb is likely to be.

Enter the navigation bar. It's a new window type that
appears atop almost everything (including the keyguard); the
window manager subtracts its rectangle from the default
visible rectangle of other windows (including the status bar
and notification shade).

However, it behaves (on phones) like the status bar in that
applications that request fullscreen windows can get access
to those pixels. Well, almost; they need cooperation from
the navigation bar implementation to make the navbar
disappear, just like the status bar.

The current SystemUI implementation of the navigation bar on
phones is still rough, but it has the basics:

+ back, home, and menu keys (NB: we're showing menu all the
time right now because checking the api level of the
package owning the top window is currently a poor
indicator of whether the app requires the menu key)
+ it tries to stick to the same physical end of the device,
regardless of device orientation (on a phone, this is
the strip of land closest to the microphone)

Change-Id: Ic613a3351220af0bbfbdef63e1d99cbefd5ed1c2
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
dacea8ce503369e7b82ff1c0e1a5a8a48863a25a 22-Apr-2011 Dianne Hackborn <hackbod@google.com> Start work on simulating landscape/portrait when orientation is locked.

Not yet working, so turned off.

Also fix a bug where the display size configuration became inconsistent
after a configuration change -- we now figure out everything about the
display size when computing a new configuration.
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
9d13264f6b5818812e61d66baaada599b8ad1faf 22-Apr-2011 Dianne Hackborn <hackbod@google.com> Fix bug in deciding which rotation to use for an orientation.

Change-Id: Icc928c2188a5865035cafcdab2efd5bae3132b1f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
43a17654cf4bfe7f1ec22bd8b7b32daccdf27c09 07-Apr-2011 Joe Onorato <joeo@google.com> Remove the deprecated things from Config.java. These haven't been working since before 1.0.

Change-Id: Ic2e8fa68797ea9d486f4117f3d82c98233cdab1e
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
fbfb3dafd90515235ad6ac88d9599e43dadd780a 07-Apr-2011 Jeff Brown <jeffbrown@google.com> Merge "Minor Alt-TAB / Recent Apps Dialog improvements."
5487500cf3d9f6d7703ce0704cb91837aa95d716 07-Apr-2011 Jeff Brown <jeffbrown@google.com> Minor Alt-TAB / Recent Apps Dialog improvements.

Alt-TAB should have different semantics from the APP_SWITCH key
or long-press on HOME. Accordingly, remove the fallback action
for Alt-TAB and initiate the task switching behavior directly
in the policy.

Modified RecentApplicationsDialog to be more precise about the
initial modifiers that it considers to be holding the dialog.

The dialog is now dismissed by a second press on the APP_SWITCH
key or by a second long press on HOME.

Change-Id: Idf4d803f51103819057cb655ff3b770b7729e4be
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ea495d4c1f6e0aefe145a9a6c75a2aab4daf2037 06-Apr-2011 Joe Onorato <joeo@google.com> Move around the HDMI switch detection so we don't try to get the status if we can't listen to it.

Change-Id: I46f4e92923ba010f68109b6d043c817e25dfe650
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
8c769cb9cc02fe0496c16b51bc555729accf70c4 30-Mar-2011 Jeff Brown <jeffbrown@google.com> Support primitive ALT-TAB style navigation using Recent Apps.

Change-Id: I6dc774326c971826d160c82126fb39acb5b9124b
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
da3d5a91b6b311ed77f2707d4456c1f18b84d73b 30-Mar-2011 Jeff Brown <jeffbrown@google.com> Support chorded fallback keys.

Also be more careful about canceling fallback keys during focus
transitions, when the application handles the key, or when the
policy decides to do something different.

Fixed a crash due to JNI CallObjectMethod returning an undefined
value (not null) when an exception is thrown.

Fixed a crash due to the policy trying to create a Dialog for
recent apps on the dispatcher thread. It should happen on the
policy's Looper instead.

Bug: 4187302
Change-Id: I659a3fd1bd2325ed36d965f9beb75dacb89790c9
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
56194ebec6212e229f4ccdaa4b187166d20013ef 03-Mar-2011 Jeff Brown <jeffbrown@google.com> Wake screen from external HID peripherals.

Added some plumbing to enable the policy to intercept motion
events when the screen is off to handle wakeup if needed.

Added a basic concept of an external device to limit the scope
of the wakeup policy to external devices only. The wakeup policy
for internal devices should be based on explicit rules such as
policy flags in key layout files.

Moved isTouchEvent to native.

Ensure the dispatcher sends the right event type to userActivity
for non-touch pointer events like HOVER_MOVE and SCROLL.

Bug: 3193114
Change-Id: I15dbd48a16810dfaf226ff7ad117d46908ca4f86
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
33bbfd2232ea9eaae9a9d87a05a95a430f09bd83 25-Feb-2011 Jeff Brown <jeffbrown@google.com> Add support for mouse hover and scroll wheel.

Dispatch ACTION_HOVER_MOVE and ACTION_SCROLL through the View
hierarchy as onGenericTouchEvent. Pointer events dispatched
this way are delivered to the view under the pointer. Non-pointer
events continue to be delivered to the focused view.

Added scroll wheel support to AbsListView, ScrollView,
HorizontalScrollView and WebView. Shift+VSCROLL is translated
to HSCROLL as appropriate.

Added logging of new pointer events in PointerLocationView.

Fixed a problem in EventHub when a USB device is removed that
resulted in a long stream of ENODEV errors being logged until INotify
noticed the device was gone.

Note that the new events are not supported by wallpapers at this time
because the wallpaper engine only delivers touch events.

Make all mouse buttons behave identically. (Effectively we only
support one button.)

Change-Id: I9ab445ffb63c813fcb07db6693987b02475f3756
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ece945291e04ea8493895349ed95a2ab46b51c93 24-Feb-2011 Patrick Dubroy <dubroy@google.com> Fix 3272590: Long-press on home & menu should be same as click

Change-Id: I151571900f4bb63910ccfb77fc64c8be9676a224
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ad788884de1dcac2c979efc57f12c58de156e801 23-Feb-2011 Daniel Sandler <dsandler@google.com> Merge "Rotation lock fix for sensor{Landscape,Portrait} activities."
1815c0275e9714c9ba0263b652c8576dd1059cb1 23-Feb-2011 Jeff Brown <jeffbrown@google.com> Merge "Be more precise about tracking fallback keys."
bfaf3b91709ef35e0d5901b186edd7c2a9729161 23-Feb-2011 Jeff Brown <jeffbrown@google.com> Be more precise about tracking fallback keys.

Only initiate fallback key handling if the first key down was
not handled and there is no other fallback key already in progress.
This prevents spurious fallbacks from being generated when
applications handle the initial down but not repeated downs or the up.

Change-Id: I8a513896cf96b16dc502cd72291926d5532aa2ab
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
3c85a4e6396dabf7f0061ff2c6e9f9b35793eadd 22-Feb-2011 Mike Lockwood <lockwood@android.com> Merge "KeyguardManager: Add isKeyguardLocked() and isKeyguardSecure()"
e7e5ac250ca6e682edc850a5148b6c46c4d2e060 22-Feb-2011 Daniel Sandler <dsandler@google.com> Rotation lock fix for sensor{Landscape,Portrait} activities.

E.g. if an app is sensorLandscape and the device rotation is
locked to landscape, the activity should not be allowed to
flip to seascape even if the device is inverted.

If the rotation is locked 90° from the activity's
supported orientations, we must override the lock as before,
but we now suppress the sensor input (confining the activity
to one of its two orientations). This best preserves the
spirit of the rotation lock while still allowing the
activity to run in a supported configuration.

Bug: 3453407
Change-Id: I8ee255e0250ba7e4534f4622ac37b82d31cf9936
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
2ed6ad6aeca5f9829ea7dad4e092064ee4baad47 22-Feb-2011 Daniel Sandler <dsandler@google.com> Fix the flipping orientation lock.

We were setting ACCELEROMETER_ROTATION to 0 before putting
in the proper USER_ROTATION value, and PhoneWindowManager's
content observer would eagerly rotate the screen to the last
locked orientation before re-rotating to the updated locked
rotation.

Now we set USER_ROTATION first. Additionally, the
content observer is now the only place we set
mUserRotation{,Mode} (previously we would race with it in
setUserRotationMode()).

Bug: 3425657
Change-Id: I04ba1a3631c6d985c2e406c4d148c39fb5c36216
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
cc0c159e9b3dd4e0f48da0ce3e33d2c68a651413 19-Feb-2011 Jeff Brown <jeffbrown@google.com> Add new hover move action and scroll wheel plumbing.

Added support for tracking the mouse position even when the mouse button
is not pressed. To avoid confusing existing applications, mouse movements
are reported using the new ACTION_HOVER_MOVE action when the mouse button
is not pressed.

Added some more plumbing for the scroll wheel axes. The values are
reported to Views but they are not yet handled by the framework.

Change-Id: I1706be850d25cf34e5adf880bbed5cc3265cf4b1
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
6f2fba428ca5e77a26d991ad728e346cc47609ee 19-Feb-2011 Jeff Brown <jeffbrown@google.com> Add new axes for joysticks and mouse wheels.

Added API on InputDevice to query the set of axes available.
Added API on KeyEvent and MotionEvent to convert keycodes and axes
to symbolic name strings for diagnostic purposes.
Added API on KeyEvent to query if a given key code is a gamepad button.
Added a new "axis" element to key layout files to specify the
mapping between raw absolute axis values and motion axis ids.
Expanded the axis bitfield to 64bits to allow for future growth.
Modified the Makefile for keyboard prebuilts to run the keymap
validation tool during the build.
Added layouts for two game controllers.
Added default actions for game pad button keys.
Added more tests.
Fixed a bunch of bugs.

Change-Id: I73f9166c3b3c5bcf4970845b58088ad467525525
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
520d8bc1d840966b5519195aaa514597a662c053 18-Feb-2011 Mike Lockwood <lockwood@android.com> KeyguardManager: Add isKeyguardLocked() and isKeyguardSecure()

BUG: 3402847

Change-Id: I725838c9d96617dd4497f9c80417cd623eceb846
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
f0a3cc5a5f3646c34c6dfd58a42368dfd5807e16 27-Jan-2011 Jeff Brown <jeffbrown@google.com> Handle ActivityNotFoundException in the WM policy.

When invoking a registered shortcut for which the activity was not
found, the startActivity throws ActivityNotFoundException. If this
exception is not caught and handled, then the shortcut key is
dispatched to the application instead of being suppressed as it
should have been.

Found while fixing Bug: 3396233

Change-Id: I0e8e9e3ba09dd403a901d5eae12839734be467ed
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
14782f705e94d4e563a48efc85fd25129fd38a7d 26-Jan-2011 Joe Onorato <joeo@google.com> Expose the window flags for lights out mode.

I hadn't wanted to do this, but it makes porting the FLAG_FULLSCREEN
stuff over to this simpler because you don't have to go find a view
to proxy through.

This change also clears the flag everywhere when the window manager
notifies the views that the change has come back.

Change-Id: I48392c7550925bcca50c5bb9e1f263e99de6c7bc
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
644f9c3ad93f6674abff4143b78404cd222b5e30 25-Jan-2011 Joe Onorato <joeo@google.com> Make FLAG_FULLSCREEN not go into lights out mode anymore.

Change-Id: I4a0aa8789f537717f82df4efb6a35108e1ab1784
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4519f07e9c6b993fbe7a3d3df24d71d9450a54f1 23-Jan-2011 Jeff Brown <jeffbrown@google.com> New orientation listener.

The objective in this listener is to be more careful about the
signal processing to prevent spurious orientation changes
and to make all of the tweakable factors physically meaningful.

The calibration is defined in terms of time constants and
does not assume a particular discrete sampling rate. This is
useful because it allows us to change the accelerometer sampling
interval if desired without having to change the calibration.
Moreover, the accelerometer sampling interval can vary +/- 20ms
from one sample to the next even in normal circumstances.

Proposed orientation changes are weighted by confidence factors
that vary exponentially in relation to how close the device
is to the ideal orientation change posture (screen is vertical,
angle is exactly at the midpoint of the orientation quadrant,
and no external acceleration beside gravity). When not in an ideal
posture, the device takes proportionally longer to settle into a
new orientation state.

Added a little tool to plot the log output of the
WindowOrientationListener. Check the README for more information
about how to use it.

Change-Id: I787f02d03582ff26367df65eda8d9ce85c5cb343
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4c541b1303b0ee2b9b0d19bee85d3780c5c4c110 24-Jan-2011 Joe Onorato <joeo@google.com> Merge "visibility ("lights out") API." into honeycomb
664644d9e012aa2a28ac96f305b1ce6499ec8806 24-Jan-2011 Joe Onorato <joeo@google.com> visibility ("lights out") API.

1. Views may setSystemUiVisibility() to recommend that
the system chrome (status bar or other UI) show or hide
itself. (This functionality was previously available only
via the FLAG_FULLSCREEN window flag for some SystemUI
implementations.)

2. Views may register a OnSystemUiVisibilityChangedListener
on a view, and find out when the system UI actually
appears or disappears, allowing apps to coordinate the
appearance of their own UI if desired.

Bug: 3241144
Change-Id: Ia1758d94099182d49a1e3688ea2738ae4995b829
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
892bd76881e2df9b4915a30144efc5428f7ab5a3 23-Jan-2011 Jeff Brown <jeffbrown@google.com> Fix SENSOR_LANDSCAPE and SENSOR_PORTRAIT

Fixed a bug in the handling of SENSOR_LANDSCAPE and SENSOR_PORTAIT
on devices that have a natural landscape orientation. The old code
was disabling 180 degree orientation detection when it shouldn't have.

Change-Id: I484a0aa44b3b8267a7d3b74bdf39c296faa7c6e3
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
08121bca5bb875707974853b57820804a9e7cd3a 18-Jan-2011 Dianne Hackborn <hackbod@google.com> Fix issue #3362666 Activities launched from ongoing notifications don't animate

The phone-oriented code for turning off animations when the screen is entirely
covered by the status bar was not appropriate for the tablet.

Change-Id: Ica3e0db989f16b9187eacd6ecf4ac3d17661dd6d
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
d04a88cb8e9e8c32a2964ca1ce29984a12f3db71 16-Jan-2011 Jeff Brown <jeffbrown@google.com> Fix keyboard hidden states.

Bug: 3355957
Change-Id: I7ff8f83421ebd89bacd3ba472e23eeba99732cb1
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
06bc9721d8f5db053b51e1c536e746833ad46036 15-Jan-2011 Jeff Brown <jeffbrown@google.com> Merge "Disable soft keyboard when keyboard attached." into honeycomb
4aed78b5056560f499e5953f659fa90a06ecc38a 15-Jan-2011 Jeff Brown <jeffbrown@google.com> Disable soft keyboard when keyboard attached.

Also hide menu shortcuts everywhere until we can get around to
redesigning the menu UI to be more consistent.

Bug: 3306545
Bug: 3330748
Change-Id: I4d4e19525cdfc93d9aae0dcaa1e6266fb552c5bc
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
b09abc1dd271d0eb4ba4050d8bf9670802a7d0fe 14-Jan-2011 Jeff Brown <jeffbrown@google.com> Add volume down as a safe mode key for Stingray.

Fixed a race condition during startup. We need to wait for the input
devices to actually be ready before trying to detect safe mode.

Fixed a problem during safe mode activation where we would try to add
the overlay window but the display was not initialized. Now we do it
after the system is ready.

Bug: 3134825
Change-Id: I4c043c142ae6bf0d865c79d266d36154eaf00709
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
f99f9c5f92dbcdf5f6e9c93847a5dae4c35a817e 13-Jan-2011 Dianne Hackborn <hackbod@google.com> Fix issue #3153930: orphan window left on screen

The problem is that if a window containing children is removed
before the children are, the children may be lost. This change
(amongst the huge amount of new debugging code) now ensures at
this point that all children windows are removed when the parent
is.

Note that this results in a bunch of error messages now as the
client app tries to continue to do things with that child window.
This is correct, it shouldn't be doing that, and needs to be
fixed to stop it. But at least it now can't cause the window
manager to leak surfaces.

Change-Id: I7b80dd89ff9de7cb5af1dc759cfa4b31ac29cddc
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
dc10030581d6eec1c96acd62ed511f91d25d73a1 12-Jan-2011 Joe Onorato <joeo@google.com> The status bar half of making the status bar resize when hdmi is plugged in.

Change-Id: Ia349413774ba709fb3242780671c7b459850f4a4
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
247fe74c934cb3fba85aae7e051a8044f460fb11 09-Jan-2011 Dianne Hackborn <hackbod@google.com> Implement issue # 3255887 could CursorLoader offer...

...to throttle contentobserver-based requeries

Why yes, I guess it could.

This also reworks AsyncTaskLoader to not generate multiple
concurrent tasks if it is getting change notifications before
the last background task is complete.

And removes some of the old APIs that had been deprecated but
need to be gone for final release.

And fixes a few little problems with applying the wrong theme
in system code.

Change-Id: Ic7a665b666d0fb9d348e5f23595532191065884f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ad7fa7fa77318d416ed338ede6aae582c239f822 07-Jan-2011 Dianne Hackborn <hackbod@google.com> WM part of #3293405: Screen needs to be redrawn when HDMI is plugged in

Change-Id: If5ceb28073c6abf14165871bd99cb481b31a863b
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
83c09685f2e62bc3cf7e71bc61d903f4b9ccaeb4 24-Dec-2010 Jeff Brown <jeffbrown@google.com> Add initial support for cursor-based pointing devices.

Some parts stubbed out but you can plug in a mouse and move
a green cursor around to interact with the UI.

Change-Id: I80d597a7f11d3bd92041890f74b3c77326975e6e
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
07f3d6649703ee21001ae1590bfd58282a447365 22-Dec-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3194697: default orientation for portrait-mode apps on stingray is backward?

Change-Id: Ia01963d1dcdda12ef1b4c56af2bd389e5dadbce1
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
caab4d0a509a5283b65d7c44e66b0dc7b89a6d7c 10-Dec-2010 Jeff Brown <jeffbrown@google.com> Update shortcuts.

Also modified the shortcut key handling so that it drops chorded
Search+X keys when even if no shortcut was found. Without this
change, pressing an unhandled shortcut causes the Search widget to
pop up and the character to be typed.

Bug: 3022227
Change-Id: Ic0921428bd1270604ca28caf1f8493727127f4ed
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
c1fb48d77ce2db2ca3af1dd2eeb91dc1b0f81b46 09-Dec-2010 Jeff Brown <jeffbrown@google.com> Improve shortcut handling.

Shortcut keys invoked using Meta are handled as fallback actions instead
so applications can handle Meta however they like.

Change-Id: I28955bac5bba9a399eed2fc6c9b73bba3f4bf383
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
49ed71db425c5054e3ad9526496a7e116c89556b 07-Dec-2010 Jeff Brown <jeffbrown@google.com> Add support for fallback keycodes.

This change enables the framework to synthesize key events to implement
default behavior when an application does not handle a key.
For example, this change enables numeric keypad keys to perform
their associated special function when numlock is off.

The application is informed that it is processing a fallback keypress
so it can choose to ignore it.

Added a new keycode for switching applications.

Added ALT key deadkeys.

New default key mappings:
- ESC -> BACK
- Meta+ESC -> HOME
- Alt+ESC -> MENU
- Meta+Space -> SEARCH
- Meta+Tab -> APP_SWITCH

Fixed some comments.
Fixed some tests.

Change-Id: Id7f3b6645f3a350275e624547822f72652f3defe
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
59485d7442a175551fcb5eeee71820432df4ea7b 02-Dec-2010 Daniel Sandler <dsandler@google.com> Do not allow lights out mode for old apps.

Legacy applications using FLAG_FULLSCREEN do so principally
to get as much screen real estate as possible; reducing
clutter is usually a secondary concern. The new UI style
takes care of the latter for the most part, and the former
is irrelevant because the xlarge system bar never goes away.

Lights out---and with it the disappearance of important
systemwide navigation controls---is probably *not* something
these apps are expecting! Consider a game: it might want
FLAG_FULLSCREEN on phone to take over your entire display,
but might also rely on menu (to pause the game or bring up
options) and home (to allow you to exit). Lights out makes
these tasks much harder on the user because those buttons
aren't visible anymore.

So, to mitigate this potentially confusing situation, we now
disable lights out for fullscreen legacy apps.

[Hack, er, cleverness alert: We use NEEDS_MENU_KEY as a
shorthand for "legacy app." This flag is set by
pre-Honeycomb apps by default, but even an app built against
the current API can request this flag; be forewarned that if
you do, you won't get lights out mode in this particular
system bar implementation when you use FLAG_FULLSCREEN.]

Change-Id: If90d8354114ba45f9485b935b87ee575a30b9f87
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
1f2451007c660091b7b090c1ea332f9044515d2d 19-Nov-2010 Jeff Brown <jeffbrown@google.com> Ensure the ShortcutManager uses the correct key character map.

The ShortcutManager used to only receive the key code of the key event
that triggered the shortcut. This change now provides the shortcut
manager with the whole key event so it can look up the associated
character using the correct key character map.

To make this more efficient, added a mechanism for recycling
key events. At the moment it is only used by key events owned by the
system process, since clients of the existing API (such as Views)
might continue to hold on to key events after dispatch has finished so
they would break if the key event were recycled by the framework.

Deprecated KeyCharacterMap.BUILT_IN_KEYBOARD.

Change-Id: I4313725dd63f2be01c350c005a41c7fde9bc67e8
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
50262e587ccd4b2fb0aa28c3b2f779b536825639 26-Nov-2010 Joe Onorato <joeo@google.com> Long press on home shouldn't open recents

Change-Id: Iafb8205878768b74a833528532ab399d44b04263
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
a111187a5b4dc5d287e29ced7d65e8d20edca140 24-Nov-2010 Dianne Hackborn <hackbod@google.com> Change rotation freeze to all be implemented in window manager.

Lots of work for no visible change in behavior, but now we can
do some fancier stuff...

Also allow rotation in all 4 directions.

Change-Id: I7e5e9537c5e359f69b83c10f65cc1ce95f371461
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
29fc2c9705e1bb8ae098fca016032d2325031587 24-Nov-2010 Joe Onorato <joeo@google.com> Allow status bar panels to be on top of the status bar.

Change-Id: I3c74ece5f7042e6302717f4263746d59d5447ec9
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
46b0d6861ce01b5644433e8f9ed9fcb2ae3a66bd 23-Nov-2010 Joe Onorato <joeo@google.com> Turn off the long press on home action

Change-Id: I8b083e9e9b8bde4751264de18e5400434b315848
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
8e11ef0d949a52fec15359ec35557b2e773b093d 19-Nov-2010 Dianne Hackborn <hackbod@google.com> Some work on issue #3201795: Improve transition when keyboard comes up

Now try to slide dialogs if they end up moving due to the IME (or
other system things) showing/hiding. Pretty hackish, but seems to
work.

Change-Id: Icd297e941cf847fa920c9605145c46be63043d52
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
6b53e8daa69cba1a2a5a7c95a01e37ce9c53226c 11-Nov-2010 Jeff Brown <jeffbrown@google.com> Added support for full PC-style keyboards.

BREAKING CHANGE: Redesigned the key character map format to
accomodate full keyboards with more comprehensive suite of modifiers.
Old key character maps will not work anymore and must be updated.
The new format is plain text only and it not compiled to a binary
file (so the "kcm" tool will be removed in a subsequent check-in).

Added FULL keyboard type to support full PC-style keyboards.

Added SPECIAL_FUNCTION keyboard type to support special function
keypads that do not have any printable keys suitable for typing
and only have keys like HOME and POWER

Added a special VIRTUAL_KEYBOARD device id convention that maps
to a virtual keyboard with a fixed known layout. This is designed
to work around issues injecting input events on devices whose
built-in keyboard does not have a useful key character map (ie.
when the built-in keyboard is a special function keyboard only.)

Modified several places where events were being synthesized
to use the virtual keyboard.

Removed support for the "qwerty" default layout.
The new default layout is "Generic". For the most part "qwerty"
was being used as a backstop in case the built-in keyboard did
not have a key character map (probably because it was a special
function keypad) and the framework needed to be able to inject
key events anyways. The latter issue is resolved by using the
special VIRTUAL_KEYBOARD device instead of BUILT_IN_KEYBOARD.

Added the concept of a key modifier behavior so that
MetaKeyKeyListener can distinguish between keyboards that use
chorded vs. toggled modifiers.

Wrote more robust key layout and key character map parsers
to enable support for new keyboard features and user installable
key maps.

Fixed a bug in InputReader generating key ups when keys
are released out of sequence.

Updated tons of documentation.

Currently QwertyKeyListener is being used for full keyboards
with autotext and capitalization disabled. This mostly works
but causes some problems with character pickers, etc.
These issues will be resolved in subsequent changes.

Change-Id: Ica48f6097a551141c215bc0d2c6f7b3fb634d354
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
dab0014acc9e010a65352a2eaa15bbed309a9c87 15-Nov-2010 Mathias Agopian <mathias@google.com> am 99866c11: am 9e291a4b: Merge "Revert "allow all 4 orientations"" into gingerbread

* commit '99866c111bd72a6cc9be17b127cd40ec9396ca7d':
Revert "allow all 4 orientations"
7eec10e6c99c30d5ee061fec08ac89ad4254ac32 13-Nov-2010 Dianne Hackborn <hackbod@google.com> Get rid of the extended themes.

We now decide whether to use a bitmap background based on whether the
window's drawing is hardware accelerated. To do this, there is a new
"state_accelerated" that state list drawables can be parameterized on,
and the standard window background uses this to select a solid color
or bitmap drawable as appropriate.

Introduces a little hackery to have wm preview windows pretend like
they are hardware accelerated even if they aren't, so the preview looks
closer to the actual app.

Also Add a DialogWhenLarge variation for the light theme.

Change-Id: I215a79d5df65ba3eed52ab363cade9d8218a6588
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
f9ce879e5cdc7e36e5f56cfcd7675036e79b3921 14-Nov-2010 Mathias Agopian <mathias@google.com> Revert "allow all 4 orientations"

This reverts commit 1d8d0159e72556ea20aba325fb27d8470282e1ba.

Change-Id: Iffd8cbad98ff7e498032df1d226f4fbc7cde95b1
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
3915bb845b032dc184dba5e60970b803390ca3ed 05-Nov-2010 Jeff Brown <jeffbrown@google.com> Tell system server whether the app handled input events.

Refactored ViewRoot, NativeActivity and related classes to tell the
dispatcher whether an input event was actually handled by the application.

This will be used to move more of the global default key processing
into the system server instead of the application.

Change-Id: If06b98b6f45c543e5ac5b1eae2b3baf9371fba28
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
d44266cec387e76b788b4eb84b28463fa3268c66 07-Nov-2010 Hiroshi Lockheimer <hiroshi@google.com> am 01128df3: am ce22d608: Merge "allow all 4 orientations" into gingerbread

* commit '01128df3c442b87f601d9c13ff2ebd54b015925d':
allow all 4 orientations
1b815d68053394463df3822c49e377308ca73cca 05-Nov-2010 Daniel Sandler <dsandler@google.com> Rotation lock bugfix.

We were using a stale version of the accelerometer rotation
setting when figuring out what the current rotation lock
state is.

Change-Id: I7780617c875a8f6c9697e829642f86f9f664df89
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
1d8d0159e72556ea20aba325fb27d8470282e1ba 05-Nov-2010 Mathias Agopian <mathias@google.com> allow all 4 orientations

Change-Id: Ia01b234d7d4e55cd4d8776e2a003ecf0cbd7d06f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
b73617de462579f7c12c25a4c2747c576f00f6a2 17-Aug-2010 Daniel Sandler <dsandler@google.com> Rotation lock.

IWindowManager now supports two new methods,
freezeRotation() and thawRotation(), that allow a caller to
temporarily stash the device's current rotation as the
default rotation (when no other constraints are present).

The system bar uses this to implement a user-accessible
rotation lock by calling freezeRotation() and then turning
off accelerometer-based display rotation; unless overridden
by an app, the display will continue to appear in the frozen
rotation until the rotation is unlocked by the user (either
via the rotation lock icon in the system bar or by checking
"rotate screen automatically" in Settings).

Bug: 2949639
Change-Id: Icd21c169d1053719590e72401f229424b254622f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
b0418da0e7594a8c2164a46985c5f1993632e010 01-Nov-2010 Jeff Brown <jeffbrown@google.com> Add plumbing for volume mute key.

Full support for the volume mute key will be implemented in a
later change.

Bug: 2912307
Change-Id: I98c27d6360f159c8b7447e04b45f442eff87b38a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4d396052deb54399cbadbeb8abd873df6f3af342 30-Oct-2010 Jeff Brown <jeffbrown@google.com> Fix policy issues when screen is off.

Rewrote interceptKeyBeforeQueueing to make the handling more systematic.
Behavior should be identical except:
- We never pass keys to applications when the screen is off and the keyguard
is not showing (the proximity sensor turned off the screen).
Previously we passed all non-wake keys through in this case which
caused a bug on Crespo where the screen would come back on if a soft key
was held at the time of power off because the resulting key up event
would sneak in just before the keyguard was shown. It would then be
passed through to the dispatcher which would poke user activity and
wake up the screen.
- We propagate the key flags when broadcasting media keys which
ensures that recipients can tell when the key is canceled.
- We ignore endcall or power if canceled (shouldn't happen anyways).

Changed the input dispatcher to not poke user activity for canceled
events since they are synthetic and should not wake the device.

Changed the lock screen so that it does not poke the wake lock when the
grab handle is released. This fixes a bug where the screen would come
back on immediately if the power went off while the user was holding
one of the grab handles because the sliding tab would receive an up
event after screen turned off and release the grab handles.

Fixed a couple of issues where media keys were being handled inconsistently
or not at all, particularly in the case of the new PAUSE, PLAY
and RECORD keys.

Bug: 3144874
Change-Id: Ie630f5fb6f128cfdf94845f9428067045f42892c
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
dea3ef7967228f0ddcc03f2455a4f1254758e584 28-Oct-2010 Dianne Hackborn <hackbod@google.com> Add new resize mode to not resize, new web input types.

Change-Id: Ib098c03793d08532c3c099b59d0cc6b567e54900
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
82de1aecd17b4f2e0113fd345d84298649f001b8 28-Oct-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3083761: windowSoftInputMode="adjustPan" ignored on stingray

The code for the new always-there status bar was a bit too brute-force,
and also impacting things like the IME. We now implement this by
actually having an explicit concept of "display size" that the status bar
can carve out from everyone else.

Change-Id: I1963d0b07f52e8d8dc3c836227da9bf5d3f2e8b9
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
a6face4d40280067c6c829c8c186fc47969e7b7b 25-Oct-2010 Marco Nelissen <marcone@google.com> Plumb KEYCODE_MEDIA_PAUSE and KEYCODE_MEDIA_PLAY up through the framework.
b/2764237

Change-Id: I9a20974fa0b7527230258f7d0bf829a031673a9d
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
3b2b354ec1ba070eae13391d004d97a3e1403050 15-Oct-2010 Jeff Brown <jeffbrown@google.com> Add support for secure system overlays.

Manual merge from Gingerbread.

This change adds a new window type for secure system overlays
created by the system itself from non-secure system overlays that
might be created by applications that have the system alert permission.
Secure views ignore the presence of secure system overlays.

Bug: 3098519
Change-Id: Id876736fd8bf332ff9a5428bde59f5268aa49c3a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
2d3f159aa9622e05a18e7f93cecd57ad673955ae 15-Oct-2010 Jeff Brown <jeffbrown@google.com> Add support for secure system overlays. (DO NOT MERGE)

This change adds a new window type for secure system overlays
created by the system itself from non-secure system overlays that
might be created by applications that have the system alert permission.
Secure views ignore the presence of secure system overlays.

Bug: 3098519
Change-Id: I8f8398f4fdeb0469e5d71124c21bedf121bd8c07
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
cd4af421ca6b102cabd2cf1ff63488e086c32c44 14-Oct-2010 Jeff Brown <jeffbrown@google.com> am 4b255a23: am 03aa28fb: Merge "Improve the input policy handling a bit." into gingerbread

Merge commit '4b255a23041225103a6870e77a236f78c2816eda'

* commit '4b255a23041225103a6870e77a236f78c2816eda':
Improve the input policy handling a bit.
e02d808abf370965c3c4e4d38af11bc69110fde2 08-Oct-2010 Daniel Sandler <dsandler@google.com> Dynamically show the menu button on the system bar.

Windows with FLAG_NEEDS_MENU_KEY (or windowNeedsMenuKey=true
in their theme) will cause the system bar to show a menu
icon. (Note that the phone's status bar currently ignores
this, but phones tend to have hardware menu keys anyway.)

Additionally, all windows whose package's SDK version is
pre-Honeycomb will have FLAG_NEEDS_MENU_KEY set by default.

Bug: 3003728

Change-Id: I2d983763a726ea4f32cd1af9b0390e30478b11d1
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
3122e4488aa0749cbec9890ace22c366e35350c3 12-Oct-2010 Jeff Brown <jeffbrown@google.com> Improve the input policy handling a bit.

Fixed some issues with Monkeys turning off their own screens. Ook ook!
Added some more comments to explain what's going on.

Change-Id: Id2bc0466161a642a73ef7ef97725d1c81e984b12
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
e20c9e0264190f94324197a8271cf03811a4ca58 11-Oct-2010 Jeff Brown <jeffbrown@google.com> Fix an event injection bug when the policy is bypassed.

Added the concept of a "trusted" event to distinguish between events from
attached input devices or trusted injectors vs. other applications.
This change enables us to move certain policy decisions out of the
dispatcher and into the policy itself where they can be handled more
systematically.

Cherry pick of b931a1b4 from gingerbread into master.

Change-Id: I700a5f07b8b227878cea9437a289a45a245c0424
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
b931a1b4183386ba840edc1bcc507eccf11b5cbe 11-Oct-2010 Jeff Brown <jeffbrown@google.com> Fix an event injection bug when the policy is bypassed.

Added the concept of a "trusted" event to distinguish between events from
attached input devices or trusted injectors vs. other applications.
This change enables us to move certain policy decisions out of the
dispatcher and into the policy itself where they can be handled more
systematically.

Change-Id: I4d56fdcdd31aaa675d452088af39a70c4e039970
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
d208e709267f8af77690cb38dba2ae8e30ab5241 08-Oct-2010 Joe Onorato <joeo@google.com> Get rid of the global actions menu on tablets.

We have the system tray for that stuff. Make long press on power
go directly to the shut down confirmation dialog. Make that dialog
auto dismiss when the screen goes off. Reword it when we're skipping
the global actions menu, because it feels too abrupt to say "The
phone will shut down" when they haven't clearly pressed a button
that says shut down.

Change-Id: I8c92a1362bd4ed242e6cd94c2dae6d9ff9c4c34d
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
38014763a2ceec005682066da01849adf95839bd 05-Oct-2010 Dianne Hackborn <hackbod@google.com> am 89230e3b: am 458fc5f5: Merge "Fix issue #3041660: Camera image flips upside down when rotating device" into gingerbread

Merge commit '89230e3b7b9ec455373e3f60b62ff65589a9c57d'

* commit '89230e3b7b9ec455373e3f60b62ff65589a9c57d':
Fix issue #3041660: Camera image flips upside down when rotating device
e5439f228f603f60febe058f633d91d5af2fff76 03-Oct-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3041660: Camera image flips upside down when rotating device

Apps now must explicitly opt in to having their rotation changed while
forcing landscape mode. Also add some new orientation constants for other
things apps may want to do.

Change-Id: If64d84b5ef54793ee717ebda9b4c76408efc9bfd
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
27dec99148c9d1cddb99269b131d8220098dc79f 02-Oct-2010 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 4d28e8c5 to master

Change-Id: I2449488a84e44b3fb5f820b50951b2b2bfa3bcbf
6493e64c2a3d5fa6adf0e6331a061d5bc67649fa 01-Oct-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3037083: Problem report for Pinball

The app was toggling between hiding and showing the status bar, because
the dialog was large enough to fill the screen but didn't set to hide
the status bar.

It turns out that the code to determine the top fullscreen window is
intrinsically unstable, since it relies on comparing a window's frame
with the screen, yet the window frame can change as a result of changes
such as hiding the status bar.

Instead, we now simplify all of this to just say that the top fillxfill
window gets to control the status bar.

Change-Id: I22913adf7235fe0d52612f6738c7c94351274e38
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
a53146c5569f8ff5f7eb55e9ad35d23ddacf2add 07-Sep-2010 Christopher Tate <ctate@google.com> Drag/drop APIs and infrastructure

A View initiates a drag-and-drop operation (hereafter just called a "drag")
by calling its startDrag(ClipData) method. Within the processing of that
call, two callbacks are made into the originating View. The first is to
onMeasureDragThumbnail(). Similarly to the core onMeasure() method, this
callback must respond by calling setDragThumbnailDimension(width, height) to
declare the size of the drag thumbnail image that should be used. Following
this, the View's onDrawDragThumbnail(canvas) method will be invoked to
actually produce the bits of the thumbnail image.

If all goes well, startDrag() will return 'true', and the drag is off and
running. (The other arguments to startDrag() provide reconciliation between
the current finger position and where the thumbnail should be placed on
the screen relative to it.)

Potential receipients of the ClipData behind the drag are notified by a
new dispatch mechanism, roughly parallel to motion event dispatch. The core
routine is the View's onDragEvent(event) callback, with the mechanics of
dispatch itself being routed through dispatchDragEvent(event) -- as in
the case of motion events, the dispatch logic is in ViewGroup, with leaf
View objects not needing to consider the dispatch flow.

Several different event 'actions' are delivered through this dispatch
mechanism:

ACTION_DRAG_STARTED: this event is propagated to every View in every window
(including windows created during the course of a drag). It serves as a
global notification that a drag has started with a payload whose matching
ClipDescription is supplied with the event. A View that is prepared to
consume the data described in this event should return 'true' from their
onDragEvent() method, and ideally will also make some visible on-screen
indication that they are a potential target of the drop.

ACTION_DRAG_ENTERED: this event is sent once when the drag point
enters the View's bounds. It is an opportunity for the View to set up
feedback that they are the one who will see the drop if the finger goes
up now.

ACTION_DRAG_LOCATION: when the drag point is over a given View, that
View will receive a stream of DRAG_LOCATION events, providing an
opportunity for the View to show visual feedback tied to the drag point.

ACTION_DRAG_EXITED: like DRAG_ENTERED, but called when the drag point
leaves the View's bounds. The View should undo any visuals meant to
emphasize their being the hovered-over target.

ACTION_DROP: when the drag ends at a given point, the View under that
point is sent this event, with the full ClipData of the payload.

ACTION_DRAG_ENDED: paralleling the DRAG_STARTED action, this is the global
broadcast that the drag has ended and all Views should return to their
normal visual state. This happens after the DROP event.

Change-Id: Ia8d0fb1516bce8c735d87ffd101af0976d7e84b6
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
04e79051dce4f7ea3b3c6ced2c03676083449267 24-Sep-2010 Steve Howard <showard@google.com> am 56d60903: am a7bfe6ad: Support "seascape" rotation for "landscape-only" apps

Merge commit '56d6090380027efc7910537a2c2b99097ca36778'

* commit '56d6090380027efc7910537a2c2b99097ca36778':
Support "seascape" rotation for "landscape-only" apps
a7bfe6ad763208942d74a15933e2de1a3e06eba0 24-Sep-2010 Steve Howard <showard@google.com> Support "seascape" rotation for "landscape-only" apps

Change-Id: Ibbbd850dc2bfb741b39c04c982fbdd98f3fa4a67
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
5bd069fe1e5208b9d41ea108a8c9ada504cae39c 23-Sep-2010 Jeff Brown <jeffbrown@google.com> am 27917946: am de04fb0a: Merge "Enforce serial ordering of MotionEvents." into gingerbread

Merge commit '279179461edccaa4217fe752a9abf6fcc2efa5a1'

* commit '279179461edccaa4217fe752a9abf6fcc2efa5a1':
Enforce serial ordering of MotionEvents.
93ed4e3052a773289c0570984801ea8f0f0849d2 23-Sep-2010 Jeff Brown <jeffbrown@google.com> Enforce serial ordering of MotionEvents.

This change modifies ViewRoot to wait until the MotionEvent has been
delivered before telling the input dispatcher that it is finished.
The serial ordering guarantee will be required by new features that
may need to transfer touch focus from one window to another.

Change-Id: I0a64d1f0c8bc3f08846f213d6e28ce48b1d48e58
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
9305647eb61bb60a1f42481a0c0d208dc9bbe965 10-Sep-2010 Joe Onorato <joeo@google.com> Plumb lights out mode through from the window manager to the status bar running in the system ui process.

Lights out mode itself isn't implemented.

Change-Id: Ieeef0eb9ae5be23000f770e74e8ee66472f4c673
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ee969aa850437c7c9b4e6e016b6ff43267c73d91 27-Aug-2010 Jim Miller <jaggies@google.com> Fix 2797185: Show 3D Recents on xlarge device

This fixes a bug where some xlarge devices weren't showing 3D recent apps.
The cause was that the config wasn't guaranteed to be loaded by
the time we reach init() in PhoneWindowManager.

The fix looks at the property on-demand, which can't happen
until after the user sees the home screen, which guarantees the
configuration is loaded.

Change-Id: Ic41196f7a15218033b831e6e9cf9d536e0712844
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
e6ad1a8ba29bdd5d61ad1c91146def582c8c0334 21-Aug-2010 Jim Miller <jaggies@google.com> Fix 2797185: Integrate 3D RecentApps View into system.

This adds 3D recents to the platform. Enabling it is a
matter of setting 'config_enableRecentApps3D' on devices
capable of supporting it (those with OGLES2.0 at the moment).

Change-Id: Ife7bfe8ca02e7657821b68f915e31b0dab50cd2c
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
dfc8cde5c865560458518dfcd178ec9f4ebede30 21-Aug-2010 Steve Howard <showard@google.com> am 1f442104: am e0c8582e: Merge "Improve orientation sensing when waking up while flat." into gingerbread

Merge commit '1f4421048206ca1745ddd6366588759c9c5c38f9'

* commit '1f4421048206ca1745ddd6366588759c9c5c38f9':
Improve orientation sensing when waking up while flat.
5eb49583e2f0b82d7a48182ffed5f409b4f85dc5 16-Aug-2010 Steve Howard <showard@google.com> Improve orientation sensing when waking up while flat.

This change makes the window manager pass the currently displayed
orientation to the WindowOrientationListener each time to calls to get
the currently sensed orientation. Now, when the
WindowOrientationListener doesn't know for sure what the orientation
of the device should be (for example, if the sensed orientation is
flat on a table), then it trusts the already-displayed orientation,
rather than trusting whatever sensors reading it most recently
received.

The main use case this addresses is:
* user uses device in portrait
* user turns off device, puts it in pocket
* while in pocket, screen gets turned on, activating orientaiton
sensor, which senses landscape orientation
* screen timed out
* user takes device out, places it on a table (or looks down at it,
holding it flat), and unlocks it

Previously, when the device was unlocked, the
WindowOrientationListener would return landscape orientation based on
its previous sensor readings. Now, it will override those previous
readings because it knows they never actually took effect and the
device is presently flat.

This change also slightly modifies the way we handle flat orientation,
now completely ignoring data when the tilt distrust is nonzero (even
if the current sensor reading shows non-tilted).

Change-Id: Ia4950a41827f8c53a80487d0c2e83b556df781b9
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
b219a83ff6278eeef981e6908abf871876a68699 12-Aug-2010 Jeff Brown <jeffbrown@google.com> am f66f8a58: am 95af0c14: Merge "Add support for the PointerLocation overlay." into gingerbread

Merge commit 'f66f8a58cc4412bd258e1d5b11cac17a617bdc58'

* commit 'f66f8a58cc4412bd258e1d5b11cac17a617bdc58':
Add support for the PointerLocation overlay.
a41ca77fabe1c7ad12ebb9b69b9e786c07d49fa0 11-Aug-2010 Jeff Brown <jeffbrown@google.com> Add support for the PointerLocation overlay.

This change involves adding a new method to IWindowManager,
monitorInput() that returns an InputChannel to receive a copy of all
input that is dispatched to applications. The caller must have
the READ_INPUT_STATE permission to make this request (similar to
other window manager methods such as getKeycodeState).

Change-Id: Icd14d810174a5b2928671ef16de73af88302aea0
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4042744bf8e5630690b479a9447bc6aff8c279fe 16-Jul-2010 Daniel Sandler <dsandler@google.com> Disable hiding of the system bar on xlarge devices.

We treat the system bar as "outside" the available screen,
so activities will never be able to draw over (or under!)
that space.

Change-Id: I287a0b1e837e415cf08fc94053c4cc14a7753848
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
1a33274d28a3174b9062ae0dcce77bf1d68cd463 09-Jul-2010 Jeff Brown <jeffbrown@google.com> resolved conflicts for merge of 167449e5 to master

Change-Id: Ib448e69a726eb45b5c9099d2574e40b8345eee67
34bcebca707187393263183aa4dab32728763f2f 08-Jul-2010 Joe Onorato <joeo@android.com> Let the window manager place the rest of the windows on screen when the status bar is at the bottom.

Change-Id: I29c43beee047bb99695a34e6b202ff3f8400c8c2
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
00fa7bdd69f0868fd17ea7c881c771d785b2fbbd 03-Jul-2010 Jeff Brown <jeffbrown@google.com> More native input dispatch work.

Removed old input dispatch code.
Refactored the policy callbacks.
Pushed a tiny bit of the power manager state down to native.
Fixed long press on MENU.
Made the virtual key detection and cancelation a bit more precise.

Change-Id: I5d8c1062f7ea0ab3b54c6fadb058c4d5f5a9e02e
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
be81f4f15dad6d690efcab1973d1e174ce3b001b 15-Jun-2010 Brett Chabot <brettchabot@android.com> Move out all framework-tests classes.

Previously tests/framework-tests contained a quarantined set of test classes
that needed access to package-private framework api. Running these tests
normally would cause the dalvik verifier to throw errors.

runtest now has support for turning off the dalvik verifier for frameworks
tests, so move this tests into their recommended location, close to the source
being tested.

Also move policy source into a 'src' folder to accommodate the tests move.

Change-Id: I62f839da185a55bc553b653bf583fd99da438512
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java