History log of /frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e62fa825794967c2067be86e8b57b83f4b82ee1c 10-Jan-2013 Dianne Hackborn <hackbod@google.com> Merge from master: fix issue #7966357: Super lights out mode vs. volume dialog

The volume panel now forces us out of the UI modes while it
is up.

Change-Id: If39fa33b1c52579bf5d376ce4722408cee3ca951
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ce479d831ad402fa57d4212908b1a9e168fb4143 29-Nov-2012 John Spurlock <jspurlock@google.com> Fix for navbar back/home appearing in keyguard (multiuser).

Clear remembered sysui visibility flags in PhoneWindowManager
when switching users. They might have been from another user.

Then reapply current window's flags to ensure contribution
makes it to the status bar.

Bug:7506446
Change-Id: I8249ba006934bdc22b952da7c16e9983d091c489
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4eeb4f664ac6b5901a8e874dcf70c0382295f792 08-Nov-2012 Jim Miller <jaggies@google.com> Add mechanism to kick keyguard to show the assistant

Fixes bug 7499778

Change-Id: Ic9ea514feb489feeee6716f40bdb9792842f9515
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
1ce804397fbd1fb9847d42f42294babea724ccf2 07-Nov-2012 Daniel Sandler <dsandler@android.com> Make dismissKeyguardLw use KeyguardViewMediator.dismiss().

It previously did some of the logic of dismiss() itself:
checking to see if the KG is secure, and if not, proceeding
to call keyguardDone() to actually hide everything. But now
that we have the "bouncer" authentication UI, the WM should
let the keyguard challenge the user to see if even a secure
keyguard should be dismissed. (Insecure keyguards should
behave exactly has they did before.)

Unless, of course, the KVM is in a "dismissable" state, in
which case it's safe to call keyguardDone() directly. (This
can happen if the user has *already* authenticated and we're
ending up in this codepath in response.)

Bug: 7458531
Change-Id: I9571acf19f9bcc16bba7a826f916da7be8ca9c33
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
34c4fe523ad96fb59cec28832b38806d04a6bebf 07-Nov-2012 John Spurlock <jspurlock@google.com> Fix remaining jank in secure add-widget transition.

Wait for activity to launch before dismissing the keyguard.
Otherwise we see launcher/last activity waiting for the
picker to start up.

Also remove camera transition workaround obviated by:
Iefee62061962625b622ff2cf9a307d9429c2ad54

Bug:7482560
Change-Id: I554ddffb7981488fa8a81933842b0c7730e775f3
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
1c2e4948a1f0e803171389427212321973ea66b8 07-Nov-2012 Jeff Brown <jeffbrown@google.com> Use a consistent policy for filtering wake keys.

Previously wake keys were filtered differently depending on whether
a keyguard was showing. If the user disables the keyguard then
no filtering was applied, which means that the volume key may
wake your device while in your pocket.

This change ensures that we use the same policy consistently
regardless of whether keyguard is showing. The behavior is
otherwise the same.

Removed the "Locked" suffix on a method that was actually
being called without a lock held and which in fact does not
require it.

Bug: 7481025
Change-Id: I704c71ca009bc5437f349f858b9de7c77ea73e4b
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
2ea9bae7121f1df5461437d7d08fa550cdf6e0b0 03-Nov-2012 Dianne Hackborn <hackbod@google.com> Fix issue #7457380: IME leaves a mark after user switching

The gnarly stuff where we keep track of the old input method
window as if it was still there was sitting around leaving things
in a stuck state. Now we clear this out at key points in the
window manager (freezing screen, user change), and the input
method manager service is less aggressive about asking the window
manager to do it.

Also fixed a problem that was causing flickers during some
wallpaper transitions -- when we are animating two things on
top of the wallpaper and one of them disappears, we need to
make sure the wallpaper target points to whatever the current
target should be (if any), not left pointing to the old target
that has gone away.

Change-Id: I2fb9600f569a5bd5e3528aaf24cde9340af56cb0
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
c1c53e56fb5222bfdd17f0a9f735efe5c1b8cb70 01-Nov-2012 Jeff Brown <jeffbrown@google.com> Merge "Fix dream/keyguard infinite layout loop." into jb-mr1-dev
c8018ebe7c6410543517a2721d0232bc5adb975e 30-Oct-2012 Jeff Brown <jeffbrown@google.com> Fix dream/keyguard infinite layout loop.

Bug: 7427191
Change-Id: If48d39cf890274607fd13cdd4d85c6c234ce5a2c
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ad09bccfe4cc0a3075e97c0911a02b329023a34a 08-Oct-2012 Craig Mautner <cmautner@google.com> Bring up unlock screen for FLAG_DISMISS_KEYGUARD.

Widgets that did not launch Activitys would not display the unlock
screens when they were tapped. Now any window that is shown with
FLAG_DISMISS_KEYGUARD set while the keyguard is locked will
cause the unlock screen to be displayed.

Bug: 7301530 fixed.
Change-Id: I90d11b52d2b63260bdb5f2b6eb7e98eb7a4d9331
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
7ad4438414de7b2d4e44798877df1700764c4472 19-Oct-2012 Dianne Hackborn <hackbod@google.com> Fix issue #7353900: Brief flash of home screen while dream starts on lock screen.

Not very clean, this has a special hack in the window manager to
redo layout when a dream window is shown. After MR1 we should clean
this up (and the various other special dream hacks).

Change-Id: Ic1a5a2b10a0a07b4a5dccdbf0736b614ec06dd4a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
8d9a1f66d9d3dbbd45a56d441a746ec11dba7645 19-Oct-2012 Jeff Sharkey <jsharkey@android.com> More migration to Global settings.

Bug: 7375796
Change-Id: I3954ce141ad30073896090a28eee743ba15fd736
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
27f1d674bf9fb53af7facdcb746912e036d5bf75 18-Oct-2012 Jeff Brown <jeffbrown@google.com> Add special mirroring modes for demonstration purposes.

Assume rotation of HDMI display is portait.
$ adb shell setprop persist.demo.hdmirotation portrait

Don't lock rotation while HDMI is plugged in.
$ adb shell setprop persist.demo.hdmirotationlock false

Hide secondary displays from apps but continue mirroring to them.
$ adb shell setprop persist.demo.singledisplay true

Bug: 7326281
Change-Id: I8f9a3b0bc19821a3a01043b0f516806dac82ce53
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
a3f4bf531f64c49b6a792368b3e5628fe7cc0e5c 11-Oct-2012 Craig Mautner <cmautner@google.com> Always layout Keyguard on config change.

Add Keyguard to list of windows that can't be hidden by keyguard.

Don't assign Configuration to window until layout has had a chance
to compare it to window's existing Configuration.

Bug: 7094175
Change-Id: I99a9fd4af9a31871fe130db7b6bdf49bd51a6092
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4fc452795f8f1ad1a9c26720037836e9d5d0db2f 11-Oct-2012 Jeff Brown <jeffbrown@google.com> Don't enable input dispatch until the screen is visible.

When we defer making the screen visible (waiting for the lock screen
to be ready) the screen may actually be on but covered by a black
surface. We need to make sure to ignore any touches on the screen
during this time until the black surface is about to be removed.

Bug: 7318962
Change-Id: I50eb7dcf05295cd276925625240996c4b80c5fe2
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
96179213ba1b2b3fc0e7d527ac606eba511bc558 10-Oct-2012 Svetoslav Ganov <svetoslavganov@google.com> No sound produced on global actions dialog pops up if no vibrator is present.

1. If the global gesture to enable accessibility is enabled there should
be a haptic or auditory feedback after the global actions dialog pops up
as a result of a long press on power. On devices with no vibrator an
attempt to vibrate was performed evne if not hardware support exists
As a result no sound was played because the it was assumed a haptic
feedback was provided.

bug:7324903

Change-Id: Ic76db232d761a2899c1ca5f59ca55ff15ae575dd
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
1cea2f3d87266a1d1df5d5f25fec2f026ca43206 09-Oct-2012 Winson Chung <winsonc@google.com> Increasing timeout for screenshot chord in keyguard. (Bug 6941775)

Change-Id: Ie846ce18878f9597e9f0cd97d78322b59042d43c
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
297d789d444626191ff6dc29eb43aeaa1f917969 08-Oct-2012 Dianne Hackborn <hackbod@google.com> More on #7296510 Transition from lock screen to dreaming is really bad

The final iteration of that change was a little too aggresive in
deciding when it turns off the dream's enter animation, so it was
doing this always instead of just when it needed to (when it is
being displayed to hide the lock screen).

This change fixes a dumb typo that was causing the dream to always
turn off its own animation (duh!) and tweaks the logic for deciding
when the dream should be able to cause the lock screen to hide to
better ensure that it is shown before the lock screen gets hidden.

Change-Id: Ie73a5be9ee597713644fb2a0202f36c32b4f1fca
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4c1e3183baf39ab69c0289c1511877a8bb0b0f75 06-Oct-2012 Dianne Hackborn <hackbod@google.com> Fix issue #7296314, issue #7296314.

7296314 Crashing dreams are stuck
7296510 Transition from lock screen to dreaming is really bad

The window layer for dreams is now moved down below the keyguard,
so that some of the expected stuff like crash and ANR dialogs can
be seen on top of them. While doing this, I reorganized how we
define the layers so the constants are just in the switch statement,
so it is much less crazy-making trying to read how things go
together.

We now have some special cases for when a dream is being shown
to turn off its animation if the keyguard is currently shown.
Since we know it will be hiding the keyguard we need it to be
shown immediately so that you don't see whatever is behind it.

Cleaned up some handling of when the lock screen is displayed
while a FLAG_SHOW_WHEN_LOCKED window is displayed, so that the
lockscreen doesn't transiently get shown and mess up the fullscreen
or system UI state. This also fixes problems with any normal
activity that is doing this.

Hid the methods on DreamService for setting lights out mode. It
doesn't make sense to have such methods on DreamService, because
you can just as well do that on your own View that is showing the
dream content, and when you can do that you can fully participate
in the (required) interactions about it such as being told when
the mode goes away.

The DreamService method for going fullscreen now uses the window
flag for doing this, which is what you want, because you want this
state to persistent on that window and not get knocked out if
something above the window tickles the system UI state.

Also fixed the problem where dreams that hid the status bar would
have a jerky animation when going away, since they were causing the
activity behind them to be layed out without the lock screen. This
is a kind-of ugly special case in the window manager right now to
just not layout windows that are behind a dream. Good enough for MR1.

Change-Id: Ied2ab86ae068b1db0ff5973882f6d17b515edbcd
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ec7131ffe3e5684eff4c19f577b324d0e5a61d33 06-Oct-2012 Jeff Brown <jeffbrown@google.com> Merge "Lock the screen while dreaming after the appropriate timeout." into jb-mr1-dev
6aaf29589b5fbe24721740e71b272c4a830b69e7 06-Oct-2012 Jeff Brown <jeffbrown@google.com> Lock the screen while dreaming after the appropriate timeout.

Bug: 7267187
Change-Id: I26ce3970a2d7cf446efe3e8c810fbbf3ddfcc47b
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
2874a54068af1e7de3c1c046cc0061412daafaf8 06-Oct-2012 Craig Mautner <cmautner@google.com> Merge "Add flag for displaying non-user's Windows to user." into jb-mr1-dev
88400d3a31139c40c4014faf86c243647087ef6c 30-Sep-2012 Craig Mautner <cmautner@google.com> Add flag for displaying non-user's Windows to user.

Created a new flag that indicates that a window should be shown
to all users. For the flag to be valid the owner of the window
must have system permissions.

Also separated system window types into those that show to all
users (e.g. StatusBar, Keyguard, ....) and those that appear only
to the owning users (e.g. Drag, ANR, TOAST, ...). Those that appear
only to their owner can override their default behavior using
the new flag (e.g. LowBattery).

Fixes bug 7211965.

Change-Id: I1fdca25d57b7b523f0c7f8bceb819af656c388d4
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
c38c9be031ddad5cf551b55458889f11e01dc5b2 04-Oct-2012 Jeff Brown <jeffbrown@google.com> Coordinate screen on with the window manager.

Bug: 7267457
Change-Id: Ic2c322253639e1f0b2e4e72a7b145025d0240f93
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
f752202bee88e31ce765483ba2efa6999ae9c9ad 04-Oct-2012 Adam Cohen <adamcohen@google.com> Plumbing to allow keyguard to be shown with user switcher (issue 7175023)

-> Also reduced calls to lockNow, and moved this call in ActivityManagerService

Change-Id: I9ba34ca902f7c0f71fa4ec302104688ca8d11f55
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
8bd206b54872d7b77110562ed535b6d1c72a1ca9 03-Oct-2012 Craig Mautner <cmautner@google.com> Don't set keyboard insets if keyboard is hidden.

Makes sense.

Bug: 7256294 fixed.
Change-Id: I435fc2e6e5acdf5c4d70b9dad1a30d7fe7c11b31
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
9c614bfe17e4e335d13ff5885a00fe8c3085fea1 03-Oct-2012 Craig Mautner <cmautner@google.com> Merge "Send masked soft input mode into method." into jb-mr1-dev
f683b56bd3bf3e89a057a5e62c1657b48fcfb732 02-Oct-2012 Craig Mautner <cmautner@google.com> Send masked soft input mode into method.

Sending the unmasked soft input mode int setAttachedWindowFrames
included the SOFT_INPUT_STATE bits and guaranteed that the adjust
test would always pass.

Bug 7256294

Change-Id: Iaf5368432c7b350fe70687d08c0a08e814b35e94
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
850c5b7ca56b04d399f45c13e6c1a0bd4162555f 02-Oct-2012 Jeff Brown <jeffbrown@google.com> Allow "factory.long_press_power_off" to be toggled at runtime.

Bug: 6847329
Change-Id: I7a303dba4482c1897d38f9064a2c49583218ffd0
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
90fc9059199cde8ff2ed3e3151070d11416e2553 01-Oct-2012 Jeff Brown <jeffbrown@google.com> Enable hardware acceleration for pointer location overlay.

Bug: 7256639
Change-Id: I790820b18365c126afc500a5ea3d222bc1ea2774
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
3dc524bc31a1578693ca958ef442dfa092b7aa7f 01-Oct-2012 Jeff Brown <jeffbrown@google.com> Use new API to override user activity timeout from keyguard.

This now replaces the internal user activity timer that
keyguard maintained. We can probably simplify things a great
deal further now.

Bug: 7165399
Change-Id: Ia0d5a156a4ff0c339bbd094380b9f7ab3cec5d9b
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
13451a25fff12c1429f9ecdc24b2aa7696359f7d 28-Sep-2012 John Spurlock <jspurlock@google.com> Status bar: Keep disabled state per user.

Bug:7165607
Change-Id: If6f7a41c2516996612aef5e013dd0d2bd23f9084
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
7c135205f2f4c192299ad0215276e9e481bccaa5 28-Sep-2012 Daniel Sandler <dsandler@android.com> Remove dock home support.

We still have dock apps and dock mode, just not home-key
capture.

Bug: 7163049
Change-Id: I8234ebf066798071517b4a586b06708b6ec0bc71
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
0dc2b81ce1400ae23faa5cc386caeef235856307 28-Sep-2012 Daniel Sandler <dsandler@android.com> Merge "Cleanup internal status bar APIs." into jb-mr1-dev
42af2ac6a340a4e46f304a59bdd842e61c02b833 28-Sep-2012 Jeff Brown <jeffbrown@google.com> Merge "Revert "Do not use last app rotation as default."" into jb-mr1-dev
0f862b432e9879790e22cab7dae18caffec0812f 28-Sep-2012 Jeff Brown <jeffbrown@google.com> Revert "Do not use last app rotation as default."

This reverts commit 4bd149ef83c8e3e2ffb61885e71f44df9a9ccfa7

This change introduced a regression in the device rotation policy. Suppose you hold the device in landscape orientation then put it flat on a table. At this time, the accelerometer has no information about which way the device is oriented so the sensor expresses no preference over the orientation. Now switch to an application that forces portrait. Then go back to the original app that auto-rotates. We should remain portrait from this point onwards unless the device is picked up and we have accelerometer information from which to establish a new preferred orientation.

Bug: 7173556
Change-Id: I3684af3369e4ea55042081e19d96773c4d4bbe76
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
7befb7deb2ac15134b3bb190520cba19165d16dd 28-Sep-2012 Svetoslav Ganov <svetoslavganov@google.com> Global gesture to toggle Accessibility system-wide.

1. This change adds a global gesture for enabling accessibility.
To enable this gesture the user has to allow it from the
accessibility settings or use the setup wizard to enable
accessibility. When the global gesture is enabled the user
can long press on power to bring the global actions dialog
and then hold with two fingers for a few seconds to enable
accessibility. The appropriate feedback is also provided.

2. The global gesture is writing directly into the settings for
the current user if performed when the keyguard is not on. If
the keygaurd is on and the current user has no accessibility
enabled, the gesture will temporary enable accessibility
for the current user, i.e. no settings are changed, to allow
the blind user to log into his account. As soon as a user
switch happens the new user settings are inherited. If no
user change happens after temporary enabling accessibility
the temporary changes will be undone when the keyguard goes
away and the device will works as expected by the current user.

bug:6171929

3. The initialization code for the owner was not executed due
to a redundant check, thus putting the accessibility layer in
an inconsistent state which breaks pretty much everything.

bug:7240414

Change-Id: Ie7d7aba80f5867b7f88d5893b848b53fb02a7537
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
5e08af03a3dffff8b8fc098790e5133589601d8f 22-Sep-2012 Christopher Tate <ctate@google.com> Respect per-user rotation lock et alia

Various per-user settings such as rotation lock are relevant to the
singleton PhoneWindowManager object. We now listen for user-switch
broadcasts and reconfigure the active state based on the newly-
active user's settings.

The RotationPolicy toolset has also been updated to do the right
thing, as has the Quick Settings UI.

Bug 7213638

Change-Id: Iee2109e48df550b4c979d3f9c91b5d2b71a6a08e
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
11cf178100e71d3f9f34ab5865e03a277c5eadaa 27-Sep-2012 Daniel Sandler <dsandler@android.com> Cleanup internal status bar APIs.

IStatusBarService.collapseQuickSettings is gone;
collapseNotifications is now collapsePanels, which does what
collapse() used to do. Similarly,
IStatusBar.animateCollapseQuickSettings is now simply
IStatusBar.animateCollapse().

Bug: 7245229
Change-Id: Id157d2fdf34926d3c85ffa8b81c741a5359aede4
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
b32e221699201cb647beae3fe0a1771fd5a41cf4 26-Sep-2012 Jeff Brown <jeffbrown@google.com> Merge changes I332f020f,I632648ac into jb-mr1-dev

* changes:
Update references to migrated global settings.
Handle user switched for settings changes.
e20a177d3f147f3011647c3bdab401f90b2c5d1d 26-Sep-2012 Svetoslav Ganov <svetoslavganov@google.com> Adding a global accessibility action to open quick settings.

1. Added APIs for opening the quick settings to the StatusBarManagerService
and the local StatausBarManager. The new APIs are protected by the old
EXPAND_STATUS_BAR permission.
Renamed the expand* and collapse* non-public APIs that are expanding
the notifications to expandNotifications* collapseNotifications* to
better convey what they do given that this change adds
expandQuickSettings* and collapseQuickSettings*.
Added a global action to the accessibility layer to expand the quick
settings which is calling into the new status bar manager APIs.

bug:7030487

Change-Id: Ic7b46e1a132f1c0d71355f18e7c5a9a2424171c3
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
bf6f6f9de72c9fd15e6bda9f228c05a9b37d6324 26-Sep-2012 Jeff Brown <jeffbrown@google.com> Update references to migrated global settings.

Fixed one setting that was migrated but not marked deprecated.

Removed a hidden setting that is no longer used by the new
power manager service.

Bug: 7231172
Change-Id: I332f020f876a18d519a1a20598a172f1c98036f7
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
f1b674197577e815040cd75ef86d611965d603ad 19-Sep-2012 Craig Mautner <cmautner@google.com> Fix deadlock in LockPatternUtils by using local id.

Activity manager now updates window manager's current user id
directly and immediately rather than waiting for a broadcast
update. Window manager passes this through policy to the
KeyguardViewMediator and into LockPatternUtils. LockPatternUtils
no longer goes to Activity to get the current user id if it finds
that its local id is non-default.

Fixes bug 7193726.

Change-Id: Id5613e7a9fe9e5b49e83c26b74504f587c3998c2
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
d888399ad4a4ec0a08e97518bf22d726a8bd4eaa 08-Sep-2012 Dianne Hackborn <hackbod@google.com> Explicitly specify current user everywhere home is started.

Change-Id: I58d86136de7f9cef1eaf72793d0e200b852d7355
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
5e03e2ca7d25b899b129baad2dd5eca6bf99d88a 06-Sep-2012 Dianne Hackborn <hackbod@google.com> More multi-user stuff:

- New (hidden) isUserRunning() API.
- Maintain LRU list of visited users.
- New FLAG_IS_DATA_ONLY for ApplicationInfo.
- Clean up pending intent records when force-stopping a user (or package).
(Also fixes bug #6880627: PendingIntent.getService() returns stale
intent of force stopped app)
- Fix force-stopping when installing an app to do the force-stop across
all users for that app.
- When selecting which processes to kill during a force stop, do this
based on the actual packages loaded in the process, not just process
name matching.
- You can now use --user option in am when starting activities, services,
and instrumentation.
- The am --user option accepts "current" and "all" as arguments.
- The pm uninstall command now uninstalls for all users, so it matches
the semantics of the install command.
- PhoneWindowManager now explicitly says to start home in the current
user.
- Activity manager call to retrieve the MIME type from a content provider
now takes a user argument, so it will direct this to the proper user.
- The package manager uninstall paths are now implemented around
PackageSetting, not PackageParser.Package. This allows them to work
even if the application's apk has been removed (in which case it only
exists as a PackageSetting, not the PackageParser.Package parsed from
the apk).

Change-Id: I3522f6fcf32603090bd6e01cc90ce70b6c5aae40
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
1cf70bbf96930662cab0e699d70b62865766ff52 06-Aug-2012 Svetoslav Ganov <svetoslavganov@google.com> Screen magnification - feature - framework.

This change is the initial check in of the screen magnification
feature. This feature enables magnification of the screen via
global gestures (assuming it has been enabled from settings)
to allow a low vision user to efficiently use an Android device.

Interaction model:

1. Triple tap toggles permanent screen magnification which is magnifying
the area around the location of the triple tap. One can think of the
location of the triple tap as the center of the magnified viewport.
For example, a triple tap when not magnified would magnify the screen
and leave it in a magnified state. A triple tapping when magnified would
clear magnification and leave the screen in a not magnified state.

2. Triple tap and hold would magnify the screen if not magnified and enable
viewport dragging mode until the finger goes up. One can think of this
mode as a way to move the magnified viewport since the area around the
moving finger will be magnified to fit the screen. For example, if the
screen was not magnified and the user triple taps and holds the screen
would magnify and the viewport will follow the user's finger. When the
finger goes up the screen will clear zoom out. If the same user interaction
is performed when the screen is magnified, the viewport movement will
be the same but when the finger goes up the screen will stay magnified.
In other words, the initial magnified state is sticky.

3. Pinching with any number of additional fingers when viewport dragging
is enabled, i.e. the user triple tapped and holds, would adjust the
magnification scale which will become the current default magnification
scale. The next time the user magnifies the same magnification scale
would be used.

4. When in a permanent magnified state the user can use two or more fingers
to pan the viewport. Note that in this mode the content is panned as
opposed to the viewport dragging mode in which the viewport is moved.

5. When in a permanent magnified state the user can use three or more
fingers to change the magnification scale which will become the current
default magnification scale. The next time the user magnifies the same
magnification scale would be used.

6. The magnification scale will be persisted in settings and in the cloud.

Note: Since two fingers are used to pan the content in a permanently magnified
state no other two finger gestures in touch exploration or applications
will work unless the uses zooms out to normal state where all gestures
works as expected. This is an intentional tradeoff to allow efficient
panning since in a permanently magnified state this would be the dominant
action to be performed.

Design:

1. The window manager exposes APIs for setting accessibility transformation
which is a scale and offsets for X and Y axis. The window manager queries
the window policy for which windows will not be magnified. For example,
the IME windows and the navigation bar are not magnified including windows
that are attached to them.

2. The accessibility features such a screen magnification and touch
exploration are now impemented as a sequence of transformations on the
event stream. The accessibility manager service may request each
of these features or both. The behavior of the features is not changed
based on the fact that another one is enabled.

3. The screen magnifier keeps a viewport of the content that is magnified
which is surrounded by a glow in a magnified state. Interactions outside
of the viewport are delegated directly to the application without
interpretation. For example, a triple tap on the letter 'a' of the IME
would type three letters instead of toggling magnified state. The viewport
is updated on screen rotation and on window transitions. For example,
when the IME pops up the viewport shrinks.

4. The glow around the viewport is implemented as a special type of window
that does not take input focus, cannot be touched, is laid out in the
screen coordiates with width and height matching these of the screen.
When the magnified region changes the root view of the window draws the
hightlight but the size of the window does not change - unless a rotation
happens. All changes in the viewport size or showing or hiding it are
animated.

5. The viewport is encapsulated in a class that knows how to show,
hide, and resize the viewport - potentially animating that.
This class uses the new animation framework for animations.

6. The magnification is handled by a magnification controller that
keeps track of the current trnasformation to be applied to the screen
content and the desired such. If these two are not the same it is
responsibility of the magnification controller to reconcile them by
potentially animating the transition from one to the other.

7. A dipslay content observer wathces for winodw transitions, screen
rotations, and when a rectange on the screen has been reqeusted. This
class is responsible for handling interesting state changes such
as changing the viewport bounds on IME pop up or screen rotation,
panning the content to make a requested rectangle visible on the
screen, etc.

8. To implement viewport updates the window manger was updated with APIs
to watch for window transitions and when a rectangle has been requested
on the screen. These APIs are protected by a signature level permission.
Also a parcelable and poolable window info class has been added with
APIs for getting the window info given the window token. This enables
getting some useful information about a window. There APIs are also
signature protected.

bug:6795382

Change-Id: Iec93da8bf6376beebbd4f5167ab7723dc7d9bd00
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
69b0818179201fadc9d2a384d692d8ae4aecd85c 05-Sep-2012 Craig Mautner <cmautner@google.com> Limit certain actions to default Display.

Stop messing up PhoneWindowManager state when passing in windows
from non-default Display.

Change-Id: I472f7a13c5e2241fbf1f79ae1c8045fd92af016c
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
398341927f3dca68d71024483aa276d10af4c080 02-Sep-2012 Craig Mautner <cmautner@google.com> Minor refactors.

- Refactor DragState to take Display instead of DisplayContent.
- Rename xxxAnimationLw methods in WindowManagerPolicy to xxxPostLayout
to reflect animation refactoring.

Change-Id: I502f2aa45a699ad395a249a12abf9843294623f0
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
5ac72a29593ab9a20337a2225df52bdf4754be02 30-Aug-2012 Dianne Hackborn <hackbod@google.com> Improve multi-user broadcasts.

You can now use ALL and CURRENT when sending broadcasts, to specify
where the broadcast goes.

Sticky broadcasts are now correctly separated per user, and registered
receivers are filtered based on the requested target user.

New Context APIs for more kinds of sending broadcasts as users.

Updating a bunch of system code that sends broadcasts to explicitly
specify which user the broadcast goes to.

Made a single version of the code for interpreting the requested
target user ID that all entries to activity manager (start activity,
send broadcast, start service) use.

Change-Id: Ie29f02dd5242ef8c8fa56c54593a315cd2574e1c
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
a99e4caa94ed3261d11c650e778c7c9b26b3e590 30-Aug-2012 Jeff Sharkey <jsharkey@android.com> Merge "Bind to screenshot service for current user." into jb-mr1-dev
d5ea3b464795d4e6adbdd174d1bd2f78b628e280 30-Aug-2012 Jeff Brown <jeffbrown@google.com> Merge "Add initial multi-display support." into jb-mr1-dev
bd6e1500aedc5461e832f69e76341bff0e55fa2b 28-Aug-2012 Jeff Brown <jeffbrown@google.com> Add initial multi-display support.

Split the DisplayManager into two parts. One part is bound
to a Context and takes care of Display compatibility and
caching Display objects on behalf of the Context. The other
part is global and takes care of communicating with the
DisplayManagerService, handling callbacks, and caching
DisplayInfo objects on behalf of the process.

Implemented support for enumerating Displays and getting
callbacks when displays are added, removed or changed.

Elaborated the roles of DisplayManagerService, DisplayAdapter,
and DisplayDevice. We now support having multiple display
adapters registered, each of which can register multiple display
devices and configure them dynamically.

Added an OverlayDisplayAdapter which is used to simulate
secondary displays by means of overlay windows. Different
configurations of overlays can be selected using a new
setting in the Developer Settings panel. The overlays can
be repositioned and resized by the user for convenience.

At the moment, all displays are mirrors of display 0 and
no display transformations are applied. This will be improved
in future patches.

Refactored the way that the window manager creates its threads.
The OverlayDisplayAdapter needs to be able to use hardware
acceleration so it must share the same UI thread as the Keyguard
and window manager policy. We now handle this explicitly as
part of starting up the system server. This puts us in a
better position to consider how we might want to share (or not
share) Loopers among components.

Overlay displays are disabled when in safe mode or in only-core
mode to reduce the number of dependencies started in these modes.

Change-Id: Ic2a661d5448dde01b095ab150697cb6791d69bb5
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
9c7e630e3ffb2aef4a14f0189824dff8dc9095df 29-Aug-2012 Jim Miller <jaggies@google.com> Enable new keyguard

Change-Id: I52af2d4f9083120616f012138a60b557a0eb70cf
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
dcb3d84b82cc2448d04e73359a716581bfb657db 24-Aug-2012 Jim Miller <jaggies@google.com> Replace keyguard with new implementation

This change refactors keyguard to be more modular and maintainable. More
specifically, it replaces the top-level view with just one device-dependent
view that contains two views: a widget area and a security area.

The widget area can be populated with custom widgets.

The security area contains the current security method as dictated by
the stored password quality.

This change contains both the old and the new keyguard with the old keyguard
still enabled. The new keyguard will be enabled in a subsequent change.

Change-Id: Id75286113771ca1407e9db182172b580f870b612
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
35744c19f6b4e2fc8bbd6fe2c82cea7a76818dfd 29-Aug-2012 Jeff Sharkey <jsharkey@android.com> Bind to screenshot service for current user.

Let apps bindService() across user boundaries if they hold the
INTERACT_ACROSS_USERS_FULL permission.

Bug: 7012034
Change-Id: I2047d8318e1de47bfae7470d1dbc6fe5cfe44fdc
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
9a538ee7bde42ad36f43edc48594282d98e191a4 20-Aug-2012 Jeff Brown <jeffbrown@google.com> Add factory test feature to shut off on long press power.

Bug: 6847329
Change-Id: I2f4f975c3af2d13ccc06812a5a42e79032700862
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
98365d7663cbd82979a5700faf0050220b01084d 20-Aug-2012 Jeff Brown <jeffbrown@google.com> Refactor for multi-display support.

Split WindowManagerImpl into two parts, the WindowManager
interface implementation remains where it is but the global
communications with the window manager are now handled by
the WindowManagerGlobal class. This change greatly simplifies
the challenge of having separate WindowManager instances
for each Context.

Removed WindowManagerImpl.getDefault(). This represents the
bulk of this change. Most of the usages of this method were
either to perform global functions (now handled by WindowManagerGlobal)
or to obtain the default display (now handled by DisplayManager).

Explicitly associate each new window with a display and make
the Display object available to the View hierarchy.

Add stubs for some new display manager API features.

Start to split apart the concepts of display id and layer stack.
since they operate at different layers of abstraction.
While it's true that each logical display uniquely corresponds to a
surface flinger layer stack, it is not necessarily the case that
they must use the same ids. Added Display.getLayerStack()
and started using it in places where it was relatively easy to do.

Change-Id: I29ed909114dec86807c4d3a5059c3fa0358bea61
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
79af1dd54c16cde063152922b42c96d72ae9eca8 17-Aug-2012 Dianne Hackborn <hackbod@google.com> Switch public APIs to use new UserHandle class for identifying users.

Gets rid of "yet another integer" confusion.

Change-Id: Id07ea7307aea7c62f0087c6663a1f1c08e2e5dee
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
c40771a90d348b59ce0ffb8654f2d0cde39d7384 16-Aug-2012 Michael Jurka <mikejurka@google.com> Merge "Fix bug with preloading recent tasks" into jb-mr1-dev
f02b60aa4f367516f40cf3d60fffae0c6fe3e1b8 16-Aug-2012 Dianne Hackborn <hackbod@google.com> Rename UserId to UserHandle.

This is the start of turning this into a formal public API.

Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
01de93de1e2a72bb530b6eeaccad59d100970f37 13-Apr-2012 Michael Jurka <mikejurka@google.com> Fix bug with preloading recent tasks

Don't send a "cancel preloading" event to recents
from PhoneWindowManager if we're not using
long-press on home to invoke recents (ie phones
with soft nav keys)
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
9630704ed3b265f008a8f64ec60a33cf9dcd3345 28-Jul-2012 Jeff Brown <jeffbrown@google.com> Power manager rewrite.

The major goal of this rewrite is to make it easier to implement
power management policies correctly. According, the new
implementation primarily uses state-based rather than event-based
triggers for applying changes to the current power state.

For example, when an application requests that the proximity
sensor be used to manage the screen state (by way of a wake lock),
the power manager makes note of the fact that the set of
wake locks changed. Then it executes a common update function
that recalculates the entire state, first looking at wake locks,
then considering user activity, and eventually determining whether
the screen should be turned on or off. At this point it may
make a request to a component called the DisplayPowerController
to asynchronously update the display's powe state. Likewise,
DisplayPowerController makes note of the updated power request
and schedules its own update function to figure out what needs
to be changed.

The big benefit of this approach is that it's easy to mutate
multiple properties of the power state simultaneously then
apply their joint effects together all at once. Transitions
between states are detected and resolved by the update in
a consistent manner.

The new power manager service has is implemented as a set of
loosely coupled components. For the most part, information
only flows one way through these components (by issuing a
request to that component) although some components support
sending a message back to indicate when the work has been
completed. For example, the DisplayPowerController posts
a callback runnable asynchronously to tell the PowerManagerService
when the display is ready. An important feature of this
approach is that each component neatly encapsulates its
state and maintains its own invariants. Moreover, we do
not need to worry about deadlocks or awkward mutual exclusion
semantics because most of the requests are asynchronous.

The benefits of this design are especially apparent in
the implementation of the screen on / off and brightness
control animations which are able to take advantage of
framework features like properties, ObjectAnimator
and Choreographer.

The screen on / off animation is now the responsibility
of the power manager (instead of surface flinger). This change
makes it much easier to ensure that the animation is properly
coordinated with other power state changes and eliminates
the cause of race conditions in the older implementation.

The because of the userActivity() function has been changed
so that it never wakes the device from sleep. This change
removes ambiguity around forcing or disabling user activity
for various purposes. To wake the device, use wakeUp().
To put it to sleep, use goToSleep(). Simple.

The power manager service interface and API has been significantly
simplified and consolidated. Also fixed some inconsistencies
related to how the minimum and maximum screen brightness setting
was presented in brightness control widgets and enforced behind
the scenes.

At present the following features are implemented:

- Wake locks.
- User activity.
- Wake up / go to sleep.
- Power state broadcasts.
- Battery stats and event log notifications.
- Dreams.
- Proximity screen off.
- Animated screen on / off transitions.
- Auto-dimming.
- Auto-brightness control for the screen backlight with
different timeouts for ramping up versus ramping down.
- Auto-on when plugged or unplugged.
- Stay on when plugged.
- Device administration maximum user activity timeout.
- Application controlled brightness via window manager.

The following features are not yet implemented:

- Reduced user activity timeout for the key guard.
- Reduced user activity timeout for the phone application.
- Coordinating screen on barriers with the window manager.
- Preventing auto-rotation during power state changes.
- Auto-brightness adjustment setting (feature was disabled
in previous version of the power manager service pending
an improved UI design so leaving it out for now).
- Interpolated brightness control (a proposed new scheme
for more compactly specifying auto-brightness levels
in config.xml).
- Button / keyboard backlight control.
- Change window manager to associated WorkSource with
KEEP_SCREEN_ON_FLAG wake lock instead of talking
directly to the battery stats service.
- Optionally support animating screen brightness when
turning on/off instead of playing electron beam animation
(config_animateScreenLights).

Change-Id: I1d7a52e98f0449f76d70bf421f6a7f245957d1d7
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
c1d07a4bd26c0ecf87bfa151ae43cb92c0c73791 14-Aug-2012 Amith Yamasani <yamasani@google.com> Launch ASSIST intent on the current user

Lockscreen and statusbar now launch the intent on the current user.
Make sure that the intent resolution is made to the package manager
for the specific user, as the app could have been disabled for that
user or may have an alternative app installed.

Change-Id: I93b0f972d6c7e8880b146da83dc3d08a68fe7e51
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
f7178d3cadfeb0101491eeea7d7f3b0d7c26dbe6 10-Aug-2012 Daniel Sandler <dsandler@android.com> Allow the secure keyguard to engage behind Dreams.

TYPE_DREAM windows are now considered for relevant window
flags alongside application windows.

Bug: 6961616
Change-Id: Idee3303276a8b69c7f07de1d6acdce64c6e1b863
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
cbb6b41aeff9d70bee30ac670237e45b35689cc0 04-Aug-2012 Craig Mautner <cmautner@google.com> Merge "Do not use last app rotation as default." into jb-mr1-dev
dde331cebd87982faded6818ad5f9927ff994c96 03-Aug-2012 Dianne Hackborn <hackbod@google.com> We can now (kind-of) change screen density on the fly.

Preloaded drawables now have a density associated with them, so we
can load the correct drawable if we are using a different density.

Window manager now formally keeps track of the density for each
screen, allowing it to be overridden like you can already do with
size, and relies on this density to drive itself internally and
the configurations it reports.

There are a new set of Bitmap constructors where you provide a
DisplayMetrics so they can be constructed with the correct density.
(This will be for when you can have different windows in the same
app running at different densities.)

ActivityThread now watches for density changes, and pushes them
to the DENSITY_DEVICE and Bitmap global density values for that
process.

A new am command allows you to change the density.
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4bd149ef83c8e3e2ffb61885e71f44df9a9ccfa7 03-Aug-2012 Craig Mautner <cmautner@google.com> Do not use last app rotation as default.

If the rotation sensor has been disabled we were substituting the
last app rotation for the sensor value. This fix uses the last
sensor value delivered before the sensor was disabled. Only use
the last app rotation if we never have received a valid sensor
value.

Fixes bug 6387946.

Change-Id: I50743c30ee2b4455e9848d3a619809be97eec3c8
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
bc632a28e4fba4a659baf39b9fd3d06d10cfda97 31-Jul-2012 John Spurlock <jspurlock@google.com> Re-enable dreams: frameworks/base

Enable feature in config. Expose Dream in public api for unbundled apps.
Unhide package. Add isDreaming() method to service.

Re-arrange the Dream api a bit. (use onStart as hook for subclasses).
Coordinate properly with power manager.

Replace old dock mode (don't fire old intent).

Change-Id: I1318d20cc1613e5d862f2913f2fcdc9719302cf7
Bug: 6921930
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
908aecc3a63c5520d5b11da14a9383f885b7d126 01-Aug-2012 Dianne Hackborn <hackbod@google.com> Start moving away from DisplayMetrics.DENSITY_DEVICE.

This puts in most of the infrastructure needed to allow us to
switch between different densities at run time. The main remaining
uses of the global are to initialize the Bitmap object (not sure
what to do about that since it doesn't have anything passed in
the constructor to get this information from), and being able to
load drawables if we need a different density than what was preloaded
by zygote.

Change-Id: Ifdbfd6b7a5c59e6aa22e63b95b78d96af3d96848
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
b696de5c10ebcc7bf42d8487fc0e56e0e937754d 28-Jul-2012 Jeff Brown <jeffbrown@google.com> Move and rename user activity event type constants.

Change-Id: Ie565808796773b6896e71ddfac6aaaf8031de846
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
525ff5f36bb5ae7595738588c6483f0f35eeeed3 23-Jul-2012 Jeff Brown <jeffbrown@google.com> Remove dead code.

Change-Id: I33afe3a1c364d5cdb9fa08867ad1580c0fd04e0e
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
81d13e8e73df49dad41d29af4f7e332cd52644ee 17-Jul-2012 Erik Gilling <konkers@android.com> remove code to resize status bar when on HDMI

Change-Id: I413eff8fe664033e5187ac54247ec0140175b7ba
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ef863701ae20f985439abacd84dceac130804cbc 11-Jul-2012 Daniel Sandler <dsandler@android.com> Switch to split status/nav bars on all device sizes.

Change-Id: Ie76aa4bdfd76e4a0ffb3949424ab28ef86ec54a1
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
6fbda63e68513ece4409dac845588711ab25c39d 03-Jul-2012 Craig Mautner <cmautner@google.com> Merge CL 202423/3 App launching has random pauses.

Change-Id: Iba5616182c02e51f4d9063d0a01b30b9f558549a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
a4b7f2f75e7803193429ec1179fb5e2eb1c6fbda 21-May-2012 Dianne Hackborn <hackbod@google.com> Use two fingers to work some magic...

Change-Id: Ibcb3dbd3d158c22da8277e544d81fb47eadccd49
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
dfcd6653c5b142e7e2f4275e35f06eaa1a363e60 26-Jun-2012 Dianne Hackborn <hackbod@google.com> am e53fd84a: am 9e608c12: Merge "Fix issue #6381224: Initial emulator boot fails and shows a blank black screen." into jb-dev

* commit 'e53fd84a28584692d9c99712a3d36100643ba000':
Fix issue #6381224: Initial emulator boot fails and shows a blank black screen.
9e608c12186d308fb1711e8824901fdf931a3a96 26-Jun-2012 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #6381224: Initial emulator boot fails and shows a blank black screen." into jb-dev
42e620caf0407f1b5e02935ac4323742c65459fd 24-Jun-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6381224: Initial emulator boot fails and shows a blank black screen.

Make sure that all cases where we remove an activity from the history
stack, we call resumeTopActivityLocked() to cause the home activity
to be launched if the stack is now empty.

Also fixed a problem where some timeouts would not be removed when destroying
an activity, and a race condition in boot that would cause the
PhoneWindowManager to initially start out with the home key not working.

Bug: 6381224
Change-Id: If046bb01aed624b0d9ee3bbaaba68ed6b98fd1d0
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
357d99c61d1c97199ca421408b3e26566e879f2a 21-Jun-2012 Dianne Hackborn <hackbod@google.com> DO NOT MERGE Fix issue #6697105: App launching sometimes has random pauses

In the course of the window manager refactoring into a separate
layout state, we introduced a bad interaction between the two
sides of the world. This resulting in multiple hops needed between
the two sides after an application has said it is finished drawing
its window, until the window/app transition is actually started.
Especially since these hops require going through the anim side
which is vsynced (so will delay its operation until the next frame),
this could introduce a notable delay until the window is first shown.

Fix this by re-arranging the code to make one straight path from
when a window reports it is shown to us starting the app transition
that is waiting for it. This change also includes various improvements
to debugging code that was done while working on it.

Change-Id: I7883674052da1a58df89cd1d9b8d754843cdd3db
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4f5d1511b9123c342ba96fbd335f77749fde00de 21-Jun-2012 Craig Mautner <cmautner@google.com> Make sure onScreenTurnedOn is called at power on.

KeyguardViewMediator.onScreenTurnedOn is not called if the device is
booted into the power-on state. In this case mScreenOn remains false
and the lockscreen will always appear after outgoing calls. This fix
ensures that onScreenTurnedOn is called when the device is powered
up in the on state.

Fixes bug 6709173.

Change-Id: I7557d8f002307b9125bc53b13bc3cb4c5c9b2758
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
0fa4d30b03c4307ca5d461aa4450b672b6850ea1 20-Jun-2012 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #6686339: 2 taps required to launch notification..." into jb-dev
6e2281d44c9b71a03a50ed24d654927111cd2b72 20-Jun-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6686339: 2 taps required to launch notification...

...or settings from lock screen

When a window is drawn, the code to determine whether it should now
be shown was calling WindowState.isReadyForDisplay(). Part of the
condition of this function is that it is not ready if a policy is
forcing the window to be hidden -- which is the case when the lock
screen is shown. As a result, we wouldn't show the window at that
point, so wouldn't tell the activity manager that the token's windows
are visibible, and wouldn't tell the lock screen to go away.

This adds a new variation WindowState.isReadyForDisplayIgnoringKeyguard(),
which is the same as the original method but ignores the policy visibility
for app windows. This allows windows to be go through the complete
path of handling when the window is finally drawn and telling the
activity manager about it, even if behind the lock screen. By making it
a separate function, we don't impact any other code that is calling the
old function and may be relying on its behavior.

Also cleaned up a little of the dumpsys output. Most important, the
new ANR section is now moved to the top, since we want
"adb shell dumpsys window" to still give a nice summary of what we
normally care about -- the window stack and important global state.

Change-Id: Ica3ea85ce46f3f5f5cd2cc30fbd9de13d3885a57
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
45308b1b3b1582d048845df2ee5301241e52a5cf 19-Jun-2012 Jim Miller <jaggies@google.com> Fix 6667238: allow market apps to support ACTION_ASSIST

This change allows market apps and 3rd parties to supply an activity
that responds to ACTION_ASSIST (e.g. market apps).

It also adds a test app to respond to the ASSIST intent and force
the intent disambiguation dialog to appear.

Change-Id: I5a78863c6a9546d18c66275187d178f6a1c9ee17
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
d7a04de16798acc04ec0a89a0c7d9f1cf60d1521 17-Jun-2012 Jeff Brown <jeffbrown@google.com> Capture window manager's last ANR state in bug report.

Currently just grabbing the window state but we could grab
other things as part of the last ANR report.

Bug: 6680398
Change-Id: I23aa70907b1bdcb21c8acc556fde196ca790ef6a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
f03e4c55fc5f8c50c58da03b7e8cfe29b4b0c644 14-Jun-2012 Craig Mautner <cmautner@google.com> Expose apps when keyguard animating.

Continuing in the trend of not hiding apps while the keyguard is
animating.

Fixes bug 6653600.

Change-Id: I151315084a13dcec061d2d6edccd31e1133610f4
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
de7a8ead2467a4a152a5a9b2416c8048f1b48bbb 14-Jun-2012 Jeff Brown <jeffbrown@google.com> Add new ASSIST key and map it to the global assist intent.

Moved some duplicate code from SearchPanelView and LockScreen
over to SearchManager to avoid creating yet another copy of it
in PhoneWindowManager.

Bug: 6594275
Change-Id: Ib4ebcd6817639d17548952ab2ce7cb876c05777c
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
207673cdbb536b9bdd9ff7f9ce953c5485d11f5a 06-Jun-2012 Jeff Brown <jeffbrown@google.com> Implement new rotation policy.

Rotation lock does not override NOSENSOR mode anymore.

Centralize the rotation policy settings into a new class shared by
the System UI and Settings applications.

Add a new setting to specify whether rotation-lock is being hidden
because the "auto-rotate screen" option has been toggled in the
Accessibility settings panel.

Bug: 6523269
Change-Id: I15173280d25bc5d101e89a9c65913aefc53fc33a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
b30cd0a801aa1cdb0b1f6ae7e531b10eb466128a 31-May-2012 Daniel Sandler <dsandler@android.com> NavBar: Don't resize in portrait docks when HDMI connected.

The computation moving the navbar up is too drastic when a device locked
in a portrait dock is connected to a landscape external display (e.g. a TV).
Instead, only do this if the aspect ratios of the device and external display
are the same.

Bug: 6513219
Change-Id: I7cfb1096b7d1a774032d22c4b0d7eb3177766c58
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4004033f87ab1978ceb832e8e8cc003987ba9097 29-May-2012 Michael Jurka <mikejurka@google.com> Fix bug where recents was getting preloaded unnecessarily

Change-Id: I7d2254da009113f81fae0a785583b1c7fd6ad020
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
3d7b7d59c82fdeac039382ed1724af9c9cb70107 24-May-2012 Craig Mautner <cmautner@google.com> Redraw all windows earlier in power on sequence.

Send a message to all windows to redraw before notifying
PhoneWindowManager of screen on. This minimizes the delay in
screen update that causes the keyguard clock to display the old time
before displaying the current time.

Fixes bug 6381021.

Change-Id: Ida7071e7dac2284540f101c5d004511b52133b91
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
8e4df6c1e261a5b41193b00b1c0ce0badaa84f1c 24-May-2012 Craig Mautner <cmautner@google.com> Fix jank when launching apps that show wallpaper.

Do not create a StartingWindow for apps that show wallpaper.
Fix handling of obscure case where found wallpaper is hidden.

Fixes bug 6484034.

Change-Id: I07181c4aea56fa9e530df0c95d886fe8ad61ec9d
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
cf39bdf3dff5e29447f6ce734b76dc3490385e58 18-May-2012 Jeff Brown <jeffbrown@google.com> Add support for switching between multiple keyboard layouts.

Also show a notification when an external keyboard is connected
and does not have a keyboard layout selected yet.

Bug: 6405203
Change-Id: Id0ac6d83b3b381f8a236b2244a04c9acb203db3c
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
40013655dea9427d0b3bc0250658c9923443963c 17-May-2012 Jeff Brown <jeffbrown@google.com> Support long-press on media keys with screen off.

Bug: 3204066
Change-Id: I3ea4b6ceb853483b9e103de62b2ef0cf48b3dff1
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
20c0cdbbf79cef18e59514e0f53dfbcac0bef600 17-May-2012 Dianne Hackborn <hackbod@google.com> Merge "Have the stable layout take into account the window's fullscreen flag." into jb-dev
5b5cc4d5361c1817938d2db58ad40aab528b3ac3 16-May-2012 Dianne Hackborn <hackbod@google.com> Have the stable layout take into account the window's fullscreen flag.

When using stable layouts, you are typically expected to hide and
show the status bar through the system UI fullscreen flag. This hides
both the status bar and the action bar. The stable layout assumed
that when not hiding the status bar through the system UI flags, that
the status bar would be visible.

This change makes things a little smarter, also looking at the
window's fullscreen flag (which only hides the status bar). If this
flag is set on the window, then the stable layout now assumes that
the status bar will never be shown. This allows us to position the
action bar correctly in the situation where the application has set
the window to fullscreen and requested a stable layout, instead of
always leaving room for the status bar above it.

Change-Id: I757072ae99cd3741753af7210dbf51afe94d3db5
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
28e7320116dc7e428e877e7165553046bbe7cd41 17-May-2012 Michael Jurka <mikejurka@google.com> Merge "Revert "Add shortcut for voice search"" into jb-dev
fa1009638d6f45aa8659aa74d93e82dd968e380e 17-May-2012 Michael Jurka <mikejurka@google.com> Revert "Add shortcut for voice search"

This reverts commit 7a3489552ca92776c5e2a57c80026216b44005eb.

Change-Id: Iddfa86183ff0d189e8dbb5dc535344e064e0d103
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
602ab325ca03b8dd0b3c2d572614c85ce32e309a 16-May-2012 Jeff Brown <jeffbrown@google.com> Don't allow shortcuts while keyguard showing.

Bug: 6483916
Change-Id: Ica7d6b1dc6a844650e6f3a2399ebb6aab20e780e
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
2a7a6ca00ab176105b5bbfa6b17bb0dcd058d517 14-May-2012 Dianne Hackborn <hackbod@google.com> Merge "Implement new window cropping." into jb-dev
85afd1b6f871d471fdff1980134676a5f1690525 13-May-2012 Dianne Hackborn <hackbod@google.com> Implement new window cropping.

The window manager now performs the crop internally, evaluating
it every animation from, to be able to update it along with
the surface position.

Change-Id: I960a2161b9defb6fba4840fa35aee4e411c39b32
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
7304c343821309dd15f769b18f1de2fa43751573 12-May-2012 Jeff Brown <jeffbrown@google.com> Move power HAL interactions to PowerManagerService.

This refactoring sets the stage for a follow-on change that
will make use additional functions of the power HAL.

Moved functionality from android.os.Power into PowerManagerService.
None of these functions make sense being called outside of the
system server. Moving them to the PowerManagerService makes it
easier to ensure that the power HAL is initialized exactly once.

Similarly, moved ShutdownThread out of the policy package and into
the services package where it can tie into the PowerManagerService
as needed.

Bug: 6435382
Change-Id: I958241bb124fb4410d96f5d5eb00ed68d60b29e5
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
fd23e3ed976b22b9a92ddb2cb3a46f9d2a0ce23f 09-May-2012 Jeff Brown <jeffbrown@google.com> Fix bugs in fallback key handling.

If a fallback key is generated using a key plus a modifier,
then it's possible we might get a different fallback key
generated if the modifier has changed. PhoneWindowManager
needs to remember which fallback is last generated for a
given key code so that it can apply the same fallback action.

When generating cancellation events, it's important to have
preserved the policyFlags of the original event. Otherwise
we may not dispatch the cancellation properly. For example,
some actions are not performed if the POLICY_FLAG_TRUSTED
is not specified.

Remember the metaState associated with a key event so we can
include it when canceled.

Tell the policy when a fallback is being cancelled so that it
can clean up its state.

After a SEARCH shortcut is invoked, clear the flag indicating
that a shortcut is pending. This is to prevent SEARCH from
getting stuck down in the case where we might forget to send
the up. (Shouldn't happen anymore after the prior fixes.)

Bug: 5616255
Change-Id: I68f0a9679c7af464eaf31c099f2aa50b53fecf1f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
daf5d894ef71c5674e83b11de8b408e3bdabe4c7 08-May-2012 Jeff Brown <jeffbrown@google.com> Small tweaks to orientation.

Improved threshold for detecting external acceleration.

Bug: 5976859
Change-Id: Iaf2298fba8eda72d1cacbb2f3aea72f460a9262f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
e849230f444653e692024b4321044cb9f6188919 02-May-2012 satok <satok@google.com> Merge "DO NOT MERGE : Backport I5723f627ce323b0d12b Reduce window resizing during IME transition" into jb-dev
1bc0a49e3cade697201e454bb6e46ee789cef6e4 25-Apr-2012 satok <satok@google.com> DO NOT MERGE : Backport I5723f627ce323b0d12b Reduce window resizing during IME transition

Bug: 5137498
Change-Id: Ieb8fd700d193eddaa31b0c5ebd8c7f7885586372
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
0632b35b6828cd4324b3d218c2e38f895e819aad 02-May-2012 Jeff Brown <jeffbrown@google.com> Merge "Improve handling of built-in keyboard." into jb-dev
daa3753a04699724d2cfe824ac1f5a266d643a05 02-May-2012 Jeff Brown <jeffbrown@google.com> Improve handling of built-in keyboard.

The window manager policy made some incorrect assumptions about the
meaning of the Configuration.keyboard field. We need to be more
careful about distinguishing between built-in and external keyboards.

Most of this change is to move the determination of the parts of
the Configuration related to input devices into the WindowManagerService
leveraging new features of the InputManagerService to good effect.

Then we plumb through the flag that indicates whether a device
is internal or external so that we can be more particular about
how the lid switch effects changes to the Configuration.

Bug: 6424373
Change-Id: I36a1c22ade35e578955465a25940a33f227b9763
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
8ccfbdddabf3387a1ac9d46bd057bea64eb30ef3 01-May-2012 Jean-Michel Trivi <jmtrivi@google.com> Merge "Optimize how AudioService receives media button events" into jb-dev
c68022258ebd3dd97a5079ba99f4f3cd12b223b0 30-Apr-2012 Jean-Michel Trivi <jmtrivi@google.com> Optimize how AudioService receives media button events

AudioService maintains a stack of registered media button event
receivers.
This change modifies the broadcasters of ACTION_MEDIA_BUTTON intents
let AudioService directly handle the corresponding key event instead
of trapping the intent sent by PhoneWindowManager, KeyguardViewBase
and PhoneFallbackEventHandler.
Because the key event may be sent through a PendingIntent,
AudioService now also implements the OnFinished interface to be
notified when the event was consumed so it can release the wake
lock held if it was held when the key event needed to be sent
(see where PassHeadsetKey was instanciated in PhoneWindowManager).

Change-Id: I2e8614df94af9d54edbf714ef443cc372d21827a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
c5c33c363ec9609b83dfe87d58f0bdcf99ff57a0 01-May-2012 Jeff Brown <jeffbrown@google.com> Merge "Add support for using the lid switch to turn off the screen." into jb-dev
c458ce98ce42c00b98afe00670f822814f3da572 30-Apr-2012 Jeff Brown <jeffbrown@google.com> Add support for using the lid switch to turn off the screen.

Added a config option to allow the lid switch to turn off the
screen. This is a closer match to what a lid switch should be
doing.

Removed an old feature to bypass keyguard when keyboard is visible
because the way it was plumbed in made bad assumptions about
the meaning of the lid switch. Also, the last product we shipped
that had a physical keyboard turned this config option off.
So away it goes. We can bring it back someday if we really want it.
It's questionable how useful the feature is anyhow, since it only
works when the keyguard is unsecure and when the lid switch is
unlikely to be jostled in the user's pocket.

Fixed a bug where we would tell the power manager that the keyboard
was visible even if the lid switch did not control the keyboard.
This used to cause the power manager to try to set the keyboard
brightness, which doesn't work.

Bug: 6377115
Bug: 6406726
Change-Id: Ic84b71d09563d51c92cd1cf132fa8bdee6509103
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
5c58de3a523a384c47b0b1e0f5dd9728a74cd9f7 29-Apr-2012 Dianne Hackborn <hackbod@google.com> Add system insets to windows.

This will be used to determine which parts of a window a completely
hidden by system UI elements (status bar, nav bar, system bar) so
that they can be clipped out from rendering.

Change-Id: I2c6c6ac67dbdfeed82d2c089ef806fb483165bd9
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
9f65c4c34abb07bdda54649ed510af26f16e9c1b 26-Apr-2012 Daniel Sandler <dsandler@android.com> Allow nav bar height to vary between portrait and landscape.

Change-Id: I1d69e0f4a1772bff6534c5c591e1def26d163708
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
908e71ed7c750112af3588f85d37c6dfe405be17 25-Apr-2012 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #5983781: opening a post from status tab..."
560144e2da16eb5ff821f7e6daf7cdd7e28c70c6 25-Apr-2012 Dianne Hackborn <hackbod@google.com> Fix issue #5983781: opening a post from status tab...

...has no cross-activity transition

We apparently no longer want to skip the activity transition when
it is starting from behind the status bar.

Change-Id: I1feb0cf0303f8b89d9089b38b217eac440382059
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
e898ac59db04d8ab0762180ca8ec7cea1347aa09 07-Apr-2012 Jim Miller <jaggies@google.com> Fix 6299832: Add search target swipe action to navigation bar on phones

This adds a feature to swipe upward on the navigation bar to invoke
voice search on phones.

Change-Id: I462076fd43b1c66c5bf624f00b297c6d3414a19a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4a066c5c77109431f50806fc29179d28f1472871 20-Apr-2012 Daniel Sandler <dsandler@android.com> Update SystemUI for sw600dp devices.

Devices between 600 and 719dp will now use the two-bar
(phone) SystemUI layout, or something like it, derived from
PhoneStatusBar. Devices above 720dp will use the system bar
from TabletStatusBar.

However, this distinction is not to be made based on dp, at
least, not by the SystemUI; the goal is to drive most of
this switch from the window manager. Therefore most of
SystemUI's sw600dp resources have been folded into the main
set of resources (renaming them to avoid collisions where
appropriate). This allows SystemUI to choose which set of
resources to use entirely by switching status bar
components, entirely independent of Configuration.

(For some resources, particularly around recents, it seemed
more expeditious to keep relying on the device
configuration, so those resources have been bumped up to
sw720dp.)

Bug: 6297838
Change-Id: I3f5414a6a718bdc83f51930d6878cdf97df48c9c
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
7f58b95f7c2bd75a991ec6a2f05676aaba47a544 18-Apr-2012 Dianne Hackborn <hackbod@google.com> Fix to custom scale animations.

These now do something reasonable when performing transitions
across two activities that are both on top of the wallpaper.

Fixed computation of the pivot point of the animations.

Fixed issue where the recents panel was considered a status
bar element for purposes of deciding if the animating elements
are obscured by the status bar, which would result in us not
running the animation correctly.

Change-Id: I4b9b588b80243463e6f087a9703ee886ee281630
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
c2346134bb519a54d50655cbef940fc3fdec60a9 13-Apr-2012 Jeff Brown <jeffbrown@google.com> Extract Vibrator implementation from interface.

Moved the core logic of Vibrator into SystemVibrator, potentially
allowing for the creation of other Vibrator subclasses.

Fixed several places where we were creating new Vibrator
instances unnecessarily instead of getting it from the Context.

It is safe to make Vibrator abstract because its constructor
was hidden from the SDK so it was not possible to subclass it.

Bug: 6334179
Change-Id: I18ece6544c26a7efb2d5099f8346a10aef8a5e18
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
0c2acffec8689f8721a454845b24a830bc37ce92 13-Apr-2012 Dianne Hackborn <hackbod@google.com> Clean up lock screen hide animation.

We now have an animation to apply to the thing behind the lock
screen animation when it isn't on the wallpaper, which looks
similar to the animation we use when both are on the wallpaper.

In implementing this, cleaned up the code to figure out up-front
which animation to run, getting rid of that kludgy thing that
cleared the window animation if the wallpaper was not being used
for the lower windows.

Change-Id: Ifc4c8a8894ad384124dcf4bbdaab134f1157b0f3
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ed4995d646252313323f648e44a9539d9384f901 12-Apr-2012 Dianne Hackborn <hackbod@google.com> Merge "Change window manager to use fixed size for the status bar."
2e7760eba084400f95476cf153db964cdfd40753 12-Apr-2012 Jeff Brown <jeffbrown@google.com> Don't do anything on lid state change by default.

Because a lid switch can be used to do many things, it's best
if the framework does not do anything by default when the lid is
opened or closed. The behavior of the lid switch should be
configured on a per-product basis in a config.xml resource overlay.

Bug: 6320088
Change-Id: I9f768dd11d76c3c17c49f46c92f993ee2ff1409f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
de368ff1c995bb0b9e713a2afa8ec7ae23446bb1 11-Apr-2012 Dianne Hackborn <hackbod@google.com> Change window manager to use fixed size for the status bar.

Unlike the nav bar, it only uses a fixed size for determining
how to layout elements around it; it lets the status bar window
itself be whatever size it wants.

Change-Id: Id04278981ab38915280a47368fccc7ec14bb97ec
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
c38cf4c7dbe7d96255d42dabf8ca801830813f5e 10-Apr-2012 Daniel Sandler <dsandler@android.com> Merge "New Android Dreams architecture, disabled for now."
077ee853171f0ad72209a59a80e526bd1387fc76 10-Apr-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6309296: Framework returns Configuration.SCREENLAYOUT_SIZE_LARGE for Xoom

Change-Id: I5882e6f6ab249232b69bdc4b8e692716f2fe5efa
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
7d276c377ce0c56630c06a6da431a6cb9bd76d1e 30-Jan-2012 Daniel Sandler <dsandler@android.com> New Android Dreams architecture, disabled for now.

Rather than normal Activities (which have a host of problems
when used for this purpose), screen savers are now a
special kind of Service that can add views to its own
special window (TYPE_DREAM, in the SCREENSAVER layer).

Dreams are now launched by the power manager; whenever it is
about to turn the screen off, it asks the window manager if
it wants to run a screen saver instead. (http://b/5677408)

Also, the new config_enableDreams bool allows the entire
feature to be switched on or off in one place. It is
currently switched off (and the APIs are all @hidden).

Change-Id: Idfe9d430568471d15f4b463cb70586a899a331f7
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
c8cb3291478fe9e836c1e1a56d3eae739b19a9cf 06-Apr-2012 Daniel Sandler <dsandler@android.com> Fix boot on sw600dp devices.

Soon we'll switch this threshold to 720dp, once the
PhoneStatusBar is ready to support 600dp wide devices. For
now, however, restore the previous behavior.

Bug: 6300512
Change-Id: Ibedb8ffc1b677e3bbe9af230598adb7db278635b
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ac14351e16e1258f1cb54e2bf772b8be004eb2b8 06-Apr-2012 Jeff Brown <jeffbrown@google.com> Move some APIs from window manager to input manager.

Simplified input injection API down to just one call.

Removed all input state reading API. It was only used by the
window manager policy and required a permission that applications
could not obtain. READ_INPUT_STATE is now unused and deprecated.

Change-Id: I41278141586ddee9468cae0fb59ff0dced6cbc00
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
9801435820dc159725c0185f18f7e60e0fb1b833 06-Apr-2012 Dianne Hackborn <hackbod@google.com> Fix so that status bar doesn't resize when hiding nav bar.

The status bar now extends behind the nav bar, and uses
fitsSystemWindows to ensure its content is not covered. We
always report a stable content insets (as if the nav bar is
visible) even if the nav bar is hidden, so the content doesn't
jump when transitioing. This does mean that if you only hide
the nav bar (and not the status bar), when in landscape you
will end up with a status bar whose right side still leaves
room for the nav bar. But why the hell would you want to do
that?

Also improve documentation on setSystemUiVisibility().

Change-Id: I8087d875f1214ef0085a91b5ed5c2f35ff2fc1b3
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
f87d19621dc2a30232bba1f51862a0b671eb9729 04-Apr-2012 Dianne Hackborn <hackbod@google.com> Clean up status bar, system bar, navigation bar management.

The status bar and navigation bar are two completely separate
elements, with their own semantics. The system bar now classifies
itself as a navigation bar, since that is really how it behaves.

This required rewriting the HDMI resizing code, so that it is
all done by PhoneWindowManager since that is what is responsible
for the size of the navigation bar (and thus now system bar). This
actually gets rid of a fair amount of code, and means we can also
do the same thing for a pure navigation bar.

Likewise the system bar now has the navigation bar ability to be
hidden when requested by system UI flags. To get the behavior
we want on Xoom, we only allow the nav bar to be hidden when it
will help provide a better aspect ratio for showing widescreen
videos.

Finally the nav/system bar now animates when hidden and shown.

Change-Id: Ie927154b68376a0b61802f99171ff56b8da92e7a
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
3a3a6cfd8ec12208ca75c0d0d871d19d76c34194 26-Mar-2012 Dianne Hackborn <hackbod@google.com> Add new feature to let apps layout over status bar / system bar.

The main change is a few new flags you can supply to
View.setSystemUiVisibility(). One is a new visibility mode,
SYSTEM_UI_FLAG_FULLSCREEN, which is basically the same as
the global FLAG_FULLSCREEN option for windows, but driven as
part of the system UI state.

There are also three new flags for telling the framework that you
would like to have your application's UI ignore screen
decorations -- SYSTEM_UI_FLAG_LAYOUT_NO_NAVIGATION for going
behind the navigation bar and SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
for ignoring full screen decorations (that is the status bar).

In combination with this you can use SYSTEM_UI_FLAG_LAYOUT_STABLE
to have the framework report consistent insets to your application.

When using NO_NAVIGATION, when the user taps the screen we now
also automatically clear ONLY_CONTENT, so that we atomically show
both UI elements. This should make it easy for apps like video
players that want to move between fully full-screen and regular
modes.

The ActionBar has also been extended when in overlay mode so
that it will adjust the system window insets to also account
for its space, and allow it to be hidden using the new
SYSTEM_UI_FLAG_FULLSCREEN.

Change-Id: Ic8db1adec49a0f420bfe40c1d92eb21307856d0b
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
50c69b5d8ae4bc973e53cbe3b58b0eb0299e25c8 30-Mar-2012 Michael Jurka <mikejurka@google.com> Merge "Preload recents on phones with hard nav keys"
7f2668c8469934ce83a5647977f6e74ab782cf07 27-Mar-2012 Michael Jurka <mikejurka@google.com> Preload recents on phones with hard nav keys

Also refactor recents code across Phone/Tablet

Change-Id: Id557c5cb0f7d9378f81c40b20511a5d98bf4078e
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
70825161b5bf51ed48319e142751a9c88b104994 29-Mar-2012 Jeff Brown <jeffbrown@google.com> Ensure pointer location view is attached to the policy thread.

Previously we created the PointerLocationView on whatever thread
happened to trigger the call to updateSettings(). There was
also some messiness around having to add or remove the view
while not holding mLock.

Now, just post the work to the policy handler.

This also makes it possible for us to use invalidate() instead
of postInvalidate() in PointerLocationView, which is more efficient.

Change-Id: I0646d7aeecffdc22f6ac56ae3ef951e7a12e2b93
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
e90585f89d550a61e3efd5050efdc5be2be494af 06-Mar-2012 Christopher Tate <ctate@google.com> Add a config resource to disable key-chord screenshotting

The key chord screenshot mechanism introduces significant latency into
processing of volume-key input; enough to be quite noticeable and
annoying on some kinds of device. This patch introduces a new config
resource entry ("config_enableScreenshotChord"), true by default, so
that products on which this functionality is inapplicable can avoid
its runtime overhead.

Bug 6039047

Change-Id: I968ddf9046741da35988310b7893fae2c0369beb
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
a4972e951bf2bdb7afdafee95b3ab0c15b8bacae 14-Mar-2012 Dianne Hackborn <hackbod@google.com> Add new "options" argument to all startActivity APIs.

This will be used to allow new features to be requested... such as,
say, a special kind of animation. Right now there are no options
defined.

Change-Id: I4eb6f27275cdd4bf186f6da316ab93a2372ad4b7
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
92a8b22e7410e74e1cba1b856333116652af8a5c 10-Mar-2012 Siva Velusamy <vsiva@google.com> ActivityManager: add option to allow OpenGL trace.

This patch adds an option to enable tracing of OpenGL functions.
OpenGL tracing can be enabled by passing "--opengl-trace" option
to am start. This option requires either a device in debug mode,
or that the application itself has debug permission set.

Change-Id: I77788bfe97c9108943b1f947ce81afe8293d78a0
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
7a3489552ca92776c5e2a57c80026216b44005eb 27-Feb-2012 Michael Jurka <mikejurka@google.com> Add shortcut for voice search

On phones with soft nav bar, make long press on
home launch a voice search intent

Change-Id: I69840a96a08524a76e33a306b799222c879db095
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
b8678d76c3e09d0d65255f3971b6112a48e19099 23-Feb-2012 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 210c1a26 to master

Change-Id: Ic44193e62215086c22225f2def5eee3159d26ae8
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
f5f4ec97916a22859abae69c7e8f522d36271eb6 08-Nov-2011 Mike Lockwood <lockwood@android.com> PhoneWindowManager: stifle warning that ITelephony service does not exist

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
d747dc8179df3cfcc68df78ec46b93992de52eaf 13-Sep-2011 Mike Lockwood <lockwood@android.com> Fix problems dispatching media button events on headless devices

Signed-off-by: Mike Lockwood <lockwood@android.com>

Conflicts:

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
3a74bd36f8af1a12353db8ddbc5227d33c2ce680 12-Aug-2011 Mike Lockwood <lockwood@android.com> Add headless mode for running the framework without the surface flinger

Enabled by setting system property ro.config.headless to 1
This will allow the framework to run without starting activities,
system UI and the keyguard.
Framework can still run services, content providers and broadcast receivers.

Signed-off-by: Mike Lockwood <lockwood@android.com>

Conflicts:

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
services/java/com/android/server/PowerManagerService.java
services/java/com/android/server/am/ActivityManagerService.java
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
aa5bf14e2123d39821863d9c352b82fb7946a220 21-Sep-2011 Mike Lockwood <lockwood@android.com> PhoneWindowManager: Disable boot progress dialog on headless builds

Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
61ac6bb250494db602b485491a493b64776eaf3b 03-Feb-2012 Craig Mautner <cmautner@google.com> Extract code from performLayoutAndPlaceSurfacesInnerLocked() into multiple methods.

Change-Id: I80152c38741ce73b92da9483cfed84efbac34f89
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
8c190f76fc92b6db9a1886b5de5b7cecdd656c4b 24-Jan-2012 Dianne Hackborn <hackbod@google.com> am 29cd79c7: am c986d6f0: Merge "Fix issue #5906017: Missing menu entries in portrait when in compatibility mode" into ics-mr1

* commit '29cd79c7b0fecd2753fc27405794c0d5b5314302':
Fix issue #5906017: Missing menu entries in portrait when in compatibility mode
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
d3fe9abfb9a6a21a18abde6a98dceb423c04ebef 21-Jan-2012 Jim Miller <jaggies@google.com> am ab9601cd: am 230a7092: Merge "Fix 5863053: Add method to lock screen immediately." into ics-mr1

* commit 'ab9601cdbb95ae94088750eff9a926a572c1a4d6':
Fix 5863053: Add method to lock screen immediately.
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
f88d1493aa968d3da551116f076edd5e21f7ccfc 13-Jan-2012 Dianne Hackborn <hackbod@google.com> am 10065177: am 2e282f35: Merge "Fix issue #5823276: home repaints after full-screen app is exited" into ics-mr1

* commit '100651779fde99f7ae2a10719d688b51115f08e9':
Fix issue #5823276: home repaints after full-screen app is exited
191713a51f0292b7fce72cc7e16cfd0f0204a0c7 12-Jan-2012 Guang Zhu <guangzhu@google.com> Move where prop dev.bootcomplete is set

Currently test harnesses depends on this flag to determine when
the system is fully booted, and start dismissing keyguard, launch
tests etc. However, the flag is usually set when the boot animation
is still running, and typically about 5 seconds before keyguard is
up etc. Moving to to when BOOT_COMPLETE broadcast is sent makes it
work more reliable.

We also discussed about using sys.boot_completed instead,
unfortunately this flag is not in all platform and we still have
backwards compatibility to maintain in order to drive unbundled
tests.

Change-Id: I99b084cd70d8e4bcfe490ddeca868136d32712e2
/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
44fcb83b38b062a650ddf556fe7f5e34905df9ea 15-Dec-2011 Joe Onorato <joeo@google.com> Add a new ui mode for "appliance"

The idea is that this is a device which is more-or-less headless. It
might have some limited interaction capabilities, but it's not something
that you want to rely on having.

Change-Id: Ib92f53a120bf83de781728011721a4859def7d9f
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
ee4d45f3052c8d339035c4bb8eca9b7a724e5074 13-Dec-2011 Dianne Hackborn <hackbod@google.com> am 0be53567: am 19a06fe9: Merge "Fix issue #5755172: Soft menu key disappears when menu is open" into ics-mr1

* commit '0be53567c1c2299c548d3204d2b9240108fbd53a':
Fix issue #5755172: Soft menu key disappears when menu is open
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
fa7fa9a5ba796eabb2dadb8e2ce1b97da38e939e 09-Dec-2011 Jeff Brown <jeffbrown@google.com> am 944c985b: am e0e9fd98: Merge "Fix system hotkey handling." into ics-mr1

* commit '944c985b4199e6e029568ea87004c9727e469cc0':
Fix system hotkey handling.
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
7e05b4a3097a8e2254de3c9bf7cbba28926c9cf9 08-Dec-2011 Dianne Hackborn <hackbod@google.com> am 7377e593: am 0e385ee4: am b32785c6: Merge "More fixing for issue #5366535: Lockscreen has wrong layout..." into ics-mr0

* commit '7377e59314885b8ef65bd19d04984998cb2e5ff4':
More fixing for issue #5366535: Lockscreen has wrong layout...
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...
0c5c2884542be5313007cb2ba22c409133e5ec5a 08-Dec-2011 Jeff Brown <jeffbrown@google.com> am 03be4d9c: am ff3b5a82: Merge "Make the dock orientation override the HDMI orientation." into ics-mr1

* commit '03be4d9cf456b7ad82e6fbbdea2b4902cb0e4abb':
Make the dock orientation override the HDMI orientation.
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
deb86c63c33f766b1a7fd6916f56b757d40803b1 06-Dec-2011 Dianne Hackborn <hackbod@google.com> am ec42750e: am 0c0120ef: Merge "Fix issue #5714517: App shortcuts can result in bad task intents" into ics-mr1

* commit 'ec42750e4d0e695515d078fb1f222c99a705fd93':
Fix issue #5714517: App shortcuts can result in bad task intents
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
32cbc3855c2a971aa5a801fd339fb6a37db91a1a 01-Dec-2011 Jeff Brown <jeffbrown@google.com> Refactor InputQueue as InputEventReceiver.

This change simplifies the code associated with receiving input
events from input channels and makes it more robust. It also
does a better job of ensuring that input events are properly
recycled (sometimes we dropped them on the floor).

This change also adds a sequence number to all events, which is
handy for determining whether we are looking at the same event or a
new one, particularly when events are recycled.

Change-Id: I4ebd88f73b5f77f3e150778cd550e7f91956aac2
/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
4952dfd16a0f839559ffa78f5016394caf85294f 01-Dec-2011 Jeff Brown <jeffbrown@google.com> Ensure input events are processed in-order in the application.

As it turns out, it used to be possible for there to be multiple
input events simultaneously in flight in an application. Although
it worked, it made it hard to reason about what was going on.
The problem was somewhat exacerbated by the introduction of a
queue of "InputEventMessage" objects as part of an earlier latency
optimization.

This change restores order from chaos and greatly simplifies the
invariants related to input event dispatch within the application.

Change-Id: I6de5fe61c1fe2ac3dd33edf770d949044df8a019
/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
4d774e0ac274e2a1c2a65a9dedfb336c95879f05 01-Dec-2011 Dianne Hackborn <hackbod@google.com> am f5fd08d6: am a1240184: Merge "Fix issue #5433192 and maybe #5433192" into ics-mr1

* commit 'f5fd08d64959f23ba87f4da4771ca511b05a6be0':
Fix issue #5433192 and maybe #5433192
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
0475f82c95e6e9657580820b16b0e48d814119b5 29-Nov-2011 Jeff Brown <jeffbrown@google.com> am c339fe30: am be6ab576: Merge "Fix application launch shortcuts." into ics-mr1

* commit 'c339fe302bc5083f0a110569eec06676be511088':
Fix application launch shortcuts.
be6ab576ff0e3bf2a8dc3feee6f476061afbda30 29-Nov-2011 Jeff Brown <jeffbrown@google.com> Merge "Fix application launch shortcuts." into ics-mr1
123ad2823b1b60b33228f5b39f24139def4e2236 29-Nov-2011 Dianne Hackborn <hackbod@google.com> am 3788ce9e: am 50b20425: Merge "Another attempt at getting OOM reports to batch." into ics-mr1

* commit '3788ce9ed9b896c2f1d5500910e949a6eba308e2':
Another attempt at getting OOM reports to batch.
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
0e9c942e4a97c0416928d9697f6e92be8faff5a3 29-Nov-2011 Daniel Sandler <dsandler@android.com> am 834c2870: am fed7a99a: Merge "Quick fix for bug 5646217 blocking automation tests" into ics-mr1

* commit '834c2870fa422098b3728ae26099b3030994f86f':
Quick fix for bug 5646217 blocking automation tests
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
5b17f73573e778c3ac22e41d13d4633f1f1d3f9f 22-Nov-2011 Daniel Sandler <dsandler@android.com> am 70f1279e: am 63188574: Merge "Dismiss system windows when screen savers start." into ics-mr1

* commit '70f1279e65eaa138f297a8f590f8383f2c76f7b4':
Dismiss system windows when screen savers start.
711683cd96884690b9e834198e7c756bb23ab5ad 20-Nov-2011 Daniel Sandler <dsandler@android.com> am 25a43ada: am 9b5d7a59: Merge "Dreams (now Screen Candy) development." into ics-mr1

* commit '25a43adabb70aa769a097c6cb09d71b031431677':
Dreams (now Screen Candy) development.
6686effc613fb92218ee3288136a9c0fec0b6417 18-Nov-2011 Daniel Sandler <dsandler@android.com> am 2e56995e: am da0e7b0c: Merge "Tie screen saver to the screen off timeout." into ics-mr1

* commit '2e56995e9e19f18958167a28911120f31b096756':
Tie screen saver to the screen off timeout.
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
f27e94ce9db83f01a98eefd0add04e7a19dde60d 17-Nov-2011 Daniel Sandler <dsandler@android.com> am 7fd3ba91: am d5decdcc: Merge "Disable desk dock apps." into ics-mr1

* commit '7fd3ba9149affe68f8e21c88d3eceb4514cf2f6f':
Disable desk dock apps.
28b23cdef491a270d6fcd4d60f5aebef3f10f370 17-Nov-2011 Daniel Sandler <dsandler@android.com> am 8b9ba6fa: am f52a4482: Merge "Add a default Dreams component." into ics-mr1

* commit '8b9ba6fa8806c401c89df88f0a1690fbfd1ebb89':
Add a default Dreams component.
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
96af5a054d94fb02dbc3614f37e12619d31254ae 15-Nov-2011 Jeff Brown <jeffbrown@google.com> am d3b98329: am d5713179: Merge "Override app requested orientation when docked." into ics-mr1

* commit 'd3b98329636ad089bb0b14cefa4b49d32e5ec678':
Override app requested orientation when docked.
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
bc072da931b7b146f19c0ee9dd5dac9a1cccab16 15-Nov-2011 Jeff Brown <jeffbrown@google.com> POWER key is always a wake key.

This change is useful to ensure that injected POWER key events
always wake the device even if the right policy flags were
not set.

Change-Id: I05b8b35f984f5c9f58b0e9d44bcb6f41a9562fc8
/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