History log of /frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a7f2bd4da736b48a2f23335d90475db4fee4ffbb 16-Oct-2013 Craig Mautner <cmautner@google.com> Remove debug logging.

Change-Id: I5d7c11e8b8525bfc8eb87bb0fff4f71337b4a39d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5800443e2dbb9b7ea4ba479ae0998ce688d44eb7 14-Oct-2013 Craig Mautner <cmautner@google.com> Move the wallpaper beneath the keyguard.

If the keyguard is the wallpaper target the wallpaper cannot sit at
the bottom of the stack and must be directly beneath the keyguard.
Otherwise keep it at the bottom of the window stack.

App animations when the keyguard is showing should not be disabled if
the keyguard is also animating.

Fixes bug 10858941.
Fixes bug 10932680.

Change-Id: I8399837f6510ea16003f68b165e67439f3571ef4
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4ebe57804d1421daef81add365cd94a9a8183bc8 14-Oct-2013 Craig Mautner <cmautner@google.com> Merge "Revert "Restore wallpaper positioning between apps."" into klp-dev
7c495cbf68d8315e585e4dfc6fb7daa7a5028b12 14-Oct-2013 Craig Mautner <cmautner@google.com> Revert "Restore wallpaper positioning between apps."

This reverts commit faf1a40382b61d9cabab82e6e835603511046564.

Bug 10932680 is back where it was.

Change-Id: I5058db837941769f25f09e3fafd9c19ef370df8e
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
021d243d6d113b114d5e71931e728f2aacb9ca14 14-Oct-2013 Dianne Hackborn <hackbod@google.com> Fix issue #11199654: Action bar enter animation skips frames when cleared by the system

We have become too aggressive about not allowing windows to draw while windw
animations are running, basically not allowing any drawing in any window when
there is any window animation. So if you did a relayout while the status bars
were being animated, your window would stop drawing until that status bar
animation was complete.

This change relaxes those rules in two ways:

- A particular window will only be told to stop updating when *it* is
currently involved in a window animation. So animations in status bars
will not stop app windows from update, and vice versa.

- If a window receives input events while it is in the "do not update"
state, we will immediately terminate that state and start allowing it to
draw. If the user is actually interacting with a window, we don't want
to wait to show feedback.

Change-Id: I72574eec048aee53115b46a78686cf27f42c42f7
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
faf1a40382b61d9cabab82e6e835603511046564 12-Oct-2013 Craig Mautner <cmautner@google.com> Restore wallpaper positioning between apps.

Simplification where wallpaper was behind all apps didn't work when
keyguard and associated wallpaper needed to be above phone screen when
phone screen animated in and out. Instead phone screen was instantly
hiding the wallpaper.

Fixes most of bug 10932680.

This fixes the wallpaper disappearing as soon as the animation begins
when going from keyguard to phone. There remains jank going from phone
to lockscreen where the animation is not occurring and the phone
blanks out immediately.

Change-Id: Ie5f464acb2f6cefd2fb91f3b920a687ec7c15d76
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
d69417d2f62606af76ec4cea72bff089ff27b2f2 11-Oct-2013 Craig Mautner <cmautner@google.com> Merge "Reduce jank on incoming phone call during dream." into klp-dev
2881630af92aa089e8d4c68527198379a3895dee 11-Oct-2013 Craig Mautner <cmautner@google.com> Reduce jank on incoming phone call during dream.

- Include dreams in the conditions that disable transition animations.
This way there is no visibility of activities that are closing
behind the keyguard when an activity that dismisses the keyguard
starts up.

- Do not notify the keyguard mediator when the keyguard is dismissed
because a dream is starting up. This keeps activities from resuming
just because the keyguard is being dismissed.

Fixes bug 11064847.

Change-Id: I9d32fc96d518b1cdab511e187226a3cb889cf6d4
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4ca2aec2be70026a2f8feee258405647985dc389 10-Oct-2013 Craig Mautner <cmautner@google.com> Merge "Add task to list before looking it up." into klp-dev
8e79734ba371e123a63de3ac993fc3cae201a592 10-Oct-2013 Craig Mautner <cmautner@google.com> Add task to list before looking it up.

Rearranging the order of operations allows a newly added task to be
bumped to the top during window sorting. Also, redundant calls moving
the home task to the bottom when moving an app task to the top are
removed.

Maybe fix 10858941.

Change-Id: Ic42d2e7045175384591644675dd0e8013a7c7528
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e8a057a9aea661a9398ddaa3161e7ea6ab6675b8 09-Oct-2013 Craig Mautner <cmautner@google.com> Merge "Remove overly tight constraint on drawn Keyguard." into klp-dev
4e8a19c73a0b4ca91ea963230948841054495631 09-Oct-2013 Craig Mautner <cmautner@google.com> Remove overly tight constraint on drawn Keyguard.

The requirement that a window that is invisible will not be drawn is
incorrect. In particular the test fails before a surface has even been
added (mHasSurface == false) or shown (mPolicyVisibility == false).
This was causing the screen to turn on before Keyguard had been drawn
and exposing surfaces that would have normally remained hidden.

Also, don't pass null into KeyguardServiceDelegate.onShown() or we
will immediately turn the screen on before Keyguard is drawn.

Fixes bug 11062635.

Change-Id: I964c7ef186d0a94678020b9c27ca6b79e5433350
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
6930d3805e1f0e770c636b8419a105bc19919048 08-Oct-2013 Alan Viverette <alanv@google.com> Merge "Ignore certain WindowManager flags when touch exploration is enabled" into klp-dev
e2dd83a5b428df5a6ef21c11e71d021c640d843f 08-Oct-2013 Craig Mautner <cmautner@google.com> Yet more debugging for 10858941.

Change-Id: I258957044cb1a8331124f6abbe53428429c33355
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5a0f4eccfb1e1774c4aac825bf39bcc4f5fc00e0 08-Oct-2013 Alan Viverette <alanv@google.com> Ignore certain WindowManager flags when touch exploration is enabled

Specifically, ignore any flags that alter the visibility of the navigation
bar and transparency.

BUG: 11082573
Change-Id: I17264dc55a1c6c3cb9b9cf92d5121799cecee5b8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
27b826325c6201a0bb96efb1011c752408ece18a 03-Oct-2013 Craig Mautner <cmautner@google.com> Merge "Retain IME assignment if no windows accept input." into klp-dev
ae87962e3ed41a8f502640a388f40ff33d7c3616 03-Oct-2013 Craig Mautner <cmautner@google.com> Retain IME assignment if no windows accept input.

Was skipping over the default assignment due to new null value for
windows (ag/361266).

Fixes bug 10987178.

Change-Id: I89efd41ab54b42de384eec84c5e937cc2a59d099
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e660ecc436c6bb9d3476298e97976a24b432482e 03-Oct-2013 John Spurlock <jspurlock@google.com> Merge "Store decor rects per window for transition cropping." into klp-dev
d65825ab1cdbfd88122beaaad8cf815434cbf46d 03-Oct-2013 Adam Lesinski <adamlesinski@google.com> Merge "Private flags are masked in correct variable" into klp-dev
9a93f6f039920c2e24cdef172c9cbd39586b949c 03-Oct-2013 John Reck <jreck@google.com> Merge "Reduce max recents on lowram" into klp-dev
172e87ce5113d75afbf894aef83bd30b43c98f5e 03-Oct-2013 John Reck <jreck@google.com> Reduce max recents on lowram

Bug: 10918599
Reduce the number of recent tasks to 10 on lowram devices
Use RGB_565 on low ram devices for thumbnails instead of ARGB_8888
Combined this saves ~9MB across system_process and systemui

Change-Id: Ieddcb512c7341a90097bc7cbc72d7355a775b416
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
95c42974f719d1fac90fc0438eac778e9795681f 02-Oct-2013 Adam Lesinski <adamlesinski@google.com> Private flags are masked in correct variable

Newly added private flags were being masked in the public flag variable
as opposed to the correct privateFlags variable.

bug:11033280
bug:11043194
Change-Id: Idda3a70a083457f3f1b7d4b46d231f4a7e704cf0
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4aca4c1520549ae8b99986a47a08cde311058140 03-Oct-2013 Craig Mautner <cmautner@google.com> Merge "Don't reorder windows on non-default display." into klp-dev
85689b9f489133d26b7ddce0a68acecf8668f039 02-Oct-2013 Craig Mautner <cmautner@google.com> Don't reorder windows on non-default display.

At least not until we add tasks to those displays.

Fixes bug 10264736.

Change-Id: I3baed4bf324c4a11bbf5b07755218c2992f5af39
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4664623c304cf162b9a78f3aee3290a92e54b628 01-Oct-2013 John Spurlock <jspurlock@google.com> Store decor rects per window for transition cropping.

Instead of keeping a single global system decor rect around
in WindowManagerService, calculate and store policy-defined
system-decor frame for each window.

The per-window decor rect is useful for smooth transitions, since it
determines window cropping during transition animations.

Bug:10938001
Change-Id: Ice6652aa5946027c45c0b7ab4e46473a0f8e3f90
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
93cb8f6b78079f10836377e825c7f7b63b8e7c21 02-Oct-2013 Craig Mautner <cmautner@google.com> Merge "Create new window-side task on demand." into klp-dev
31482a7fe1b50e6bcd4c3e43b40f3ac5ab467c0b 02-Oct-2013 Craig Mautner <cmautner@google.com> Create new window-side task on demand.

The activity manager can create a new task under certain
circumstances in resetTargetTaskIfNeededLocked(). In that case the
window manager was not told to create a new task. This fix creates the
task in window manager when it recognizes that there is a new task
required.

Fixes bug 10412588.

Change-Id: Ife9ecfeb7f53f9df5950322c9359c836adc258a2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
164371fb759bad6854570af0fca60d9a01e17235 02-Oct-2013 Dianne Hackborn <hackbod@google.com> Fix issue #11005453: [SUW] G+ profile creation for new user broken

The main problem here was a mistake when turning a single process
structure to a multi-package-process structure with a common
process. When we cloned the original process state, if there were
any services already created for the process for that package, they
would be left with their process pointer still referencing the
original now common process instead of the package-specific process,
allowing the active counts to get bad. Now we switch any of those
processes over to the new package-specific process.

There was also another smaller issue with how ServiceRecord is
associated with a ServiceState -- we could be waiting for an
old ServiceRecord to be destroyed while at the same time creating
a new ServiceRecord for that same service class. These would share
the same ServiceState, so when the old record finally finished
destroying itself it would trample over whatever the new service
is doing.

This is fixed by changing the model to instead of using an "active"
reference count, we have an object identifying the current owner
of the ServiceState. Then when the old ServiceRecord is cleaning
up, we know if it is still the owner at that point.

Also some other small things along the way -- new Log.wtfStack()
method that is convenient, new suite of Slog.wtf methods, fixed
some services to use Slog.wtf when catching exceptions being
returned to the caller so that we actually know about them.

Change-Id: I75674ce38050b6423fd3c6f43d1be172b470741f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
42e9b63100edfef7a9cbee735ee3574fb1b94349 02-Oct-2013 Adam Lesinski <adamlesinski@google.com> Merge "Make room for new public flags" into klp-dev
6a591f585909415a1da431a2cc76b7732724037d 02-Oct-2013 Adam Lesinski <adamlesinski@google.com> Make room for new public flags

Moved two hidden flags to private

bug:11033280
Change-Id: Icca867b073aff643eefdaf84df68de86bb6b05ac
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
68cc241e8dca1ba20c2004afceac428d1aec31ef 01-Oct-2013 Craig Mautner <cmautner@google.com> Add a timeout for removing starting windows.

If two activities are started at the same time the first activity can
add a starting window but never start. In that case there is no event
that will clear the starting window. This change adds a 10 second
timeout for the starting window to be cleared after which it will
clear the starting window automatically.

Fixes bug 10797865.

Change-Id: I1d59c3058c63367ff688d426474e8a6f006b2e0d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
564e8e6f548951c9fe5825aaad327b9ffbeece82 29-Sep-2013 Craig Mautner <cmautner@google.com> Merge "Ensure correct window ordering." into klp-dev
5ee6d19fd726d1196297a0c549587cb2e18e9cfe 29-Sep-2013 Craig Mautner <cmautner@google.com> Ensure correct window ordering.

Make sure that moveStackWindowsLocked() is called every time that the
stack ordering changes. This will rebuild the window list. Previously
the call was being made after the moveStack() call which got forgotten
in the addAppToken() causing the home stack to obscure incoming phone
and video calls.

Fixes bug 10023223.
Fixes bug 10678010.
Maybe fixes bug 10858941.

Change-Id: I59922dc979a19210008eac1f528704984c63c886
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
6c9df5054a25f179ea7359a1a5e59e7d5d8da122 20-Sep-2013 Jim Miller <jaggies@google.com> Fix permissions on WindowManagerService.showAssistant()

Since binder call permissions are not transitive by design,
the proper way to fix this is to have the call talk directly
to keyguard from the navigation bar.

Fixes bug 9409008

Change-Id: Ibd90a79bb638c969b514455a2ad93c6ff668222d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
0ab7d4d1a114b888889862ec7a5e2dc3bcd23fa5 24-Sep-2013 John Spurlock <jspurlock@google.com> Merge "Remove Rect allocation in each layout pass." into klp-dev
4e92a7cf0362c926a3521b33adacd031f91985ec 24-Sep-2013 John Spurlock <jspurlock@google.com> Remove Rect allocation in each layout pass.

Bug:10786445
Change-Id: I0cb1ab7697f33e02adeb5319bae19d3a1d20753c
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
9bf6c5cec834343104aa326b65b86c064c86c6cb 24-Sep-2013 Craig Mautner <cmautner@google.com> Merge "Fix method for determining focused window." into klp-dev
ac56514ea7ff5e30f4d3010da2b8ebbdb36406de 24-Sep-2013 Craig Mautner <cmautner@google.com> Fix method for determining focused window.

Method had been rewritten to be task-based and there were errors
when a task had no apptokens. New version is much easier to
maintain.

Maybe fixes bug 10689184.

Change-Id: I5e4c8447a33a4f5686296c20b9f9fe302c9ae49f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
9bb0ee9131b0fa8cf2720f200575ba2ede48a65c 22-Sep-2013 Dianne Hackborn <hackbod@google.com> Issue #10461551: KLP API Review: AppOpsManager

Changed public constants from integers to strings. Internally
everything is still integers, since we want that more efficient
representation for most things.

Changed the Callback interface to OnOpChangedListener. We also
have a private versin that again takes an int, and tricks to
make both work.

Reworked the class documentation to be appropriate to the SDK
(as much as it can be); most of the existing documentation is
moved to the private implementation. Also added documentation
of the MODE constants.

Change-Id: I4f7e73cc99fe66beff9194e960e072e2aa9458f8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
04476691424811f5029194410519f49f913b672d 20-Sep-2013 Craig Mautner <cmautner@google.com> Merge "Remove over-aggressive stack movement." into klp-dev
8916aadd1e0a305b1b5115e7881f551cade0f146 20-Sep-2013 Craig Mautner <cmautner@google.com> Remove over-aggressive stack movement.

Moving a task to the bottom was also moving its stack to the back.
Since chrome always finishes by calling moveTaskToBack this put
the home stack in front of the application stack and would cause
bizarre window layering effects.

Definitely fixes 10764463.
Maybe fixes 10678010.

Change-Id: Ic202ae4fad44b36a8444255764d2135fccd4743d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
b3370cec719ccfe09c9fc83edc2dd2f833df3945 19-Sep-2013 Craig Mautner <cmautner@google.com> Debug for b/10689184.

Change-Id: I67b7a4bd7fb902b0d0275af0665625593dc1af00
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
bc65c1dbccfe936856e9a2c4066c1ec9115140e2 18-Sep-2013 Craig Mautner <cmautner@google.com> Merge "Do not assign InputMethod to non-input windows." into klp-dev
22b9a5e0aa8e6364b08e707eec916016caab7c4a 17-Sep-2013 Craig Mautner <cmautner@google.com> Do not assign InputMethod to non-input windows.

The InputMethod window was being assigned to the bottommost
window as a fall-through situation when no window could receive
input. This fix changes that so that if the bottommost window
cannot receive IME input then the InputMethod will be unassigned.

In most ANRs associated with bug 10689184 mInputMethodTarget
was assigned to the Wallpaper window and the InputMethod was
placed directly above it. When the ANR occurred the window that
was awaiting focused was then always placed immediately above the
InputMethod. This fix will keep that situation from happening.

Change-Id: Ic247e8132a907f2712a9f8a89e43c099142ec851
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
b1885b8588db015b74ef411e70277c0f8a448c87 17-Sep-2013 Craig Mautner <cmautner@google.com> More debugging for b/106899184

Change-Id: I729a2c5bae087713765d782daaa7309ee6cd5b5a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5845812780a29f4594dbdac12e65c4e063ddb4b0 14-Sep-2013 Craig Mautner <cmautner@google.com> Add debug logging for b/10689184.

Focus is now on focus. Remove logging when fixed.

Change-Id: Ic0cd2d6bd4e65dac9dd40f4745dd12fb84f687ce
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
2cad64c0fbeba07bb546674e19cfb0166d7ec332 11-Sep-2013 Igor Murashkin <iam@google.com> Merge "Surface: Change OutOfResourcesException to be a runtime exception" into klp-dev
bd181bb83282571eb793d2e4a48b4d19585de7f2 11-Sep-2013 Jeff Brown <jeffbrown@google.com> Propagate input ANR reason to activity manager log.

Make it a little easier to diagnose input dispatch timeouts by
providing the detailed reason as the ANR annotation in the log.

Bug: 10689184
Change-Id: Ie18fd9ad066b0673d1f57c030e027ad0085f4650
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a86ab640f7bb0bf3cb4eaed80473ca8c5d131903 30-Aug-2013 Igor Murashkin <iam@google.com> Surface: Change OutOfResourcesException to be a runtime exception

- Deprecates SurfaceTexture.OutOfResourcesException, it wasn't used
- Make all JNI code throw only Surface.OutOfResourcesException
- Get rid of redundant SurfaceControl.OutOfResourcesException

Bug: 10566539
Change-Id: I58126260771b9ccff6a69c672ce7719b9f98138d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
61f0f9ada51a6718075acfe7fafbb9954f38e980 27-Aug-2013 Craig Mautner <cmautner@google.com> Merge "When adding a window evaluate all tasks." into klp-dev
018be3da7b2154499f644f72145f72454fa9fe15 27-Aug-2013 Craig Mautner <cmautner@google.com> When adding a window evaluate all tasks.

Previously the code was adding a window based only on the tasks on
the stack belonging to the window being added. But if a window from
another stack was on top the window would be added out of order.

In particular when there was a dialog over the launcher app and the
device was rotated, the launcher window was being added over the
dialog. This caused the launcher icons to obscure the dialog and for
the dialog buttons to be untouchable.

Fixes bug 9984067.

Change-Id: I9a57eb641d118f4a90e98af8ca77127ab5364e79
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ef4adae5de5fd02f4b98ea7528f5888b6397dd8e 26-Aug-2013 John Spurlock <jspurlock@google.com> Allow wallpaper to extend into the entire screen.

Previously it was constrained to displayInfo.appWidth/appHeight
which comes from PWM.getNonDecorDisplayWidth/Height, which includes
the nav bar.

Also adjust window layout to entire screen.

This allows wallpaper to extend into the navigation bar region,
important if the nav bar is hidden or transparent.

Bug:10505328
Change-Id: Ia6057b9c57b476a48f3b2d8b6368fd631e944a3e
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
1eb0637f2a17362476a8876b4437f8a0c0783b86 09-Aug-2013 keunyoung <keunyoung@google.com> fix race condition when a new display is added

- When a new display is added, display add event triggers handleDisplayAddedLocked in
WindowManagerService asynchronously.
- After creating virtual display, application can move on and call addWindow before
handleDisplayAddedLock is called.
- Application's addWindow leads into creating a new DisplayContent, and a window will be added there.
- But when handleDisplayAddedLocked is called later, it will create a new DisplayContent for the
display, and the window added by the application will be lost.
- This CL tries to fix the issue by checking the presence of DisplayContent before creating a new
one.

bug: 9975297

Change-Id: I9fac7ffb57c3e1effa8f0e950539cfae73e7e1c6
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
6201c2ac418424424573343d61b2b5bda3de77e2 10-Aug-2013 Craig Mautner <cmautner@google.com> Put animation background behind visible wallpaper

The new wallpaper positioning associated with multiple activity stacks
put animation backgrounds in front of the wallpaper. This caused
hideous jank. Testing for visible wallpaper and moving the background
behind it fixes the jank.

Fixes bug 10078282.
Possibly fixes bug 10247094.

Change-Id: I3f4e07accd7276d59725192081904b791f77781f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ef981a40aa63069dc115b216ce38d1dd939dc64c 07-Aug-2013 Jeff Brown <jeffbrown@google.com> Fix propagation of display overscan information.

Fix several problems in the way that the overscan was plumbed in
which could result in information not being delivered to applications.
There was also a violation of certain invariants regarding the
immutability of returned DisplayInfo objects.

Bug: 10213771
Change-Id: I21184a14305e44278b5e81353bf95d511e8517fb
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
2eb15342be5b075dda3df29b2b014a92ce13a5f8 07-Aug-2013 Craig Mautner <cmautner@google.com> Destroy surfaces when display is removed.

Fixes bug 10226153.

Change-Id: I4eb8b14258985768d36745260ad4e62ba6c78844
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
dee8bf0eb53b7b557f380e8c3ee5c9179ff0c74d 07-Aug-2013 Craig Mautner <cmautner@google.com> Create SurfaceSession before creating DimLayer.

Fixes "java.lang.IllegalArgumentException: session must not be null"

Change-Id: Id7e77a44e59e5169ed8944682ab79783631182dd
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
9d808b1f4823879ce8b52aefb90c55346017cdc7 07-Aug-2013 Craig Mautner <cmautner@google.com> Add home StackBox to all DisplayContent.

Each display needs a stack and a stack box to contain windows.

Fixes bug 10161525.

Change-Id: Ic617cdf5a082ae68f0589e826ecbb37d8fba52ac
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5c7132560aac40f291726095b761a0c46ee32b09 04-Aug-2013 Craig Mautner <cmautner@google.com> Merge "Add force default orientation."
46ac6fa614131d567bed93d1d2067d765ecef85d 01-Aug-2013 Craig Mautner <cmautner@google.com> Add force default orientation.

Devices can be configured to remain in their default landscape or
portrait orientation by setting config_forceDefaultOrientation true
in overlay/.../values/config.xml.

Activities that desire to run in the non-default orientation are
supported by creating a logical display within the physical display.
Transitions to and from the activity perform a crossfade rather than
the normal rotation animation.

Also, improve SurfaceTrace debug output.

Fixes bug 9695710.

Change-Id: I053e136cd2b9ae200028595f245b6ada5927cfe9
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
635a6d5a0b922b5d845b6e2c7ec8453b14fe4b01 30-Jul-2013 Dianne Hackborn <hackbod@google.com> Fix some oom tuning and display size stuff.

Fix a problem where we would not respect the device's
override display density/size if those had been reset at
some point (to an empty string).

Tweak the tuning of low RAM devices to consider 480x800 as
the base line resolution. That is our target these days.

Improve output of oom and meminfo to include this tuning
information.

Change-Id: Ic9a85b0391b075178c4ac17e64086ef21889f430
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
67a60426d8f7b25304b2cbfc3361beb53eb3dd1f 24-Jul-2013 Craig Mautner <cmautner@google.com> Update configuration before setting override size.

PhoneWindowManager.setInitialDisplaySize() uses Resources to determine
the height of the Status and Navigation bars. Previous to this CL the
Configuration was being updated after setInitialDisplaySize() was
called which caused the Status and Navigation Bar heights to use the
initial size and density and not the override values. This fix moves
the updateConfiguration after the override values are read in but
before setInitialDisplaySize() is called.

Fixes bug 9966940.

Change-Id: If5b033f520e14f32080d0f2aebbdc6bdae714f88
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
07cb345877a1dd5e347a5cb77ea54291281699d4 22-Jul-2013 Chet Haase <chet@android.com> am 09a68ac9: am dbc51de4: am 53771e5f: Merge "Remove useless/repetitive code"

* commit '09a68ac943e0d21ad61a94ed4eac1d6099657602':
Remove useless/repetitive code
09a68ac943e0d21ad61a94ed4eac1d6099657602 22-Jul-2013 Chet Haase <chet@android.com> am dbc51de4: am 53771e5f: Merge "Remove useless/repetitive code"

* commit 'dbc51de44fe4f9a7f81528204250de32ec405d39':
Remove useless/repetitive code
dbc51de44fe4f9a7f81528204250de32ec405d39 22-Jul-2013 Chet Haase <chet@android.com> am 53771e5f: Merge "Remove useless/repetitive code"

* commit '53771e5f955f67035cf6b6432c34171a18ab14dc':
Remove useless/repetitive code
acb837fe632b79d52af0c683957cee8b567be74a 20-Jul-2013 Craig Mautner <cmautner@google.com> Merge "Fix home activity and user switch interactions."
ac6f843c917b68ea8805711965b149a9338e3a0e 17-Jul-2013 Craig Mautner <cmautner@google.com> Fix home activity and user switch interactions.

- Make sure Home activity goes in the correct task and on the correct
stack.
- Do not allow different users to be in the same task.
- Do not set stacks aside for each user.

Fixes bug 9775492.

Change-Id: I0e7954e917aac8482a1015a36923e02914e2b692
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
70eac41f7044552305beae86eb0978cd74724ecf 19-Jul-2013 Craig Mautner <cmautner@google.com> am a64325f6: am 7c6be10d: Remove iterators (DO NOT MERGE)

* commit 'a64325f6e70569255ff395a85ec161f3230f9e35':
Remove iterators (DO NOT MERGE)
ef96fd9009ee8c50bc5de25e6a8dfe3f04050262 19-Jul-2013 Colin Cross <ccross@android.com> Add properties to override size and density

Add properties ro.config.density_override and ro.config.size_override
to provide build-time virtual screen sizes. A device with no
override set with "wm size" will use the size specified by the property.
"wm size reset" will go back to the physical size.

Change-Id: I07a585eb2e0f91365fac2b64c53de3af138a2a85
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
b48fe0ec5e5515782600dd1ccacbd96ccecb654b 16-Jul-2013 Craig Mautner <cmautner@google.com> Merge "Remove iterators."
f8924150b3fa5a9afef66bcae0affab1e66b3629 16-Jul-2013 Craig Mautner <cmautner@google.com> Remove iterators.

Remove DisplayContentsIterator and AllWindowsIterator. These were cute
but they take up valuable resources. Iterate over ArrayList members
in their place.

Change-Id: I1d8a3b040175cb88b98f6a7e97cab06d17d5706b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7c6be10d314413bb7afbed41017343320319915d 16-Jul-2013 Craig Mautner <cmautner@google.com> Remove iterators (DO NOT MERGE)

Remove DisplayContentsIterator and AllWindowsIterator. These were cute
but they take up valuable resources. Iterate over ArrayList members
in their place.

Change-Id: Ie0c537608532cfb36f34d976cc6eacd21bad98cd
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5f5882ffa83d1c5762569e3260fa4ec85e0d0d4c 15-Jul-2013 Cyril Mottier <cyrilmottier@gmail.com> Remove useless/repetitive code

fixScale(float) method has been extracted from the code but the original
code has been kept in place. Because of this, the animation scale is
"fixed" twice which is not necessary. This patch, simply call
fixScale(float) once and stores the result of it in the scale variable.

Change-Id: I50aeacbc2c13ebbf447506ae4309d50c0e313837
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
27116e35e8f90f6641a027d190d47b183e01e44c 13-Jul-2013 keunyoung <keunyoung@google.com> Merge "add TYPE_PRIVATE_PRESENTATION window type"
a446bf0e8c7b5f5441aeb11b359ba6776b9b3061 22-Jun-2013 keunyoung <keunyoung@google.com> add TYPE_PRIVATE_PRESENTATION window type

- This window type can be used for Presentation created on top of virtual
private display.
- There can be PRIVATE_PRESENTATION specific policy / behavior, but for now,
there is nothing special.

Change-Id: I9fde0f0376e57fcc60000d3a3f8657a21ef58993
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
abee69bc08e65d3ac0321f73380e3fb7b36f7575 12-Jul-2013 Amith Yamasani <yamasani@google.com> am 8361a9f7: am 1a1a7c08: am 06a441de: Merge "Pass along the user id to AttributeCache requests" into jb-mr2-dev

* commit '8361a9f719b6a416a40134951daf28297b6e0670':
Pass along the user id to AttributeCache requests
8361a9f719b6a416a40134951daf28297b6e0670 12-Jul-2013 Amith Yamasani <yamasani@google.com> am 1a1a7c08: am 06a441de: Merge "Pass along the user id to AttributeCache requests" into jb-mr2-dev

* commit '1a1a7c0878320b94d01da6bdfaa857c85b4199a3':
Pass along the user id to AttributeCache requests
4befbecfcc286652209126b9a64883b35544157d 11-Jul-2013 Amith Yamasani <yamasani@google.com> Pass along the user id to AttributeCache requests

Bug: 9759331
Change-Id: Ib96ba6a89c58edc207021aa43a2b67b4f6c50117
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5eda9b330120f75964cd78b29f6101cc273c2a7e 02-Jul-2013 Craig Mautner <cmautner@google.com> Add convertToTranslucent to API.

Rename convertToOpaque to convertFromTranslucent. Add the
counterpart to Activity.convertFromTranslucent() for returning from
opaque to a translucent Activity. The caller should wait until
TranslucentConversionListener.onTranslucentConversionComplete() is
called before actually changing the background to translucent.

Change-Id: Id04b026bcc4dd8bad9a33a7af126e1bb28fb9c03
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5729b81ab56379e3b8736a2c716421e185756460 27-Jun-2013 Craig Mautner <cmautner@google.com> Merge "Add API to convert translucent Activity to opaque."
4addfc5f3998e3d7fc0a2ed9a9051c034da2ea3d 25-Jun-2013 Craig Mautner <cmautner@google.com> Add API to convert translucent Activity to opaque.

Fixes bug 9298778.

Change-Id: If6198f42bdea8aa727a2abc672eb0062aaf63ca3
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
8c84109b9fbbf473b225707a38261ff5f99d95fb 24-Jun-2013 Dianne Hackborn <hackbod@google.com> Use FastPrintWriter... everywhere.

One problem this turned up is, because FastPrintWriter does
its own buffering, a lot of code that used to use PrintWriter
would fail -- if it pointed to a StringWriter, there was no
buffering, so it could just immediately get the result. Now
you need to first flush the FastPrintWriter.

Also added some new constructors to specify the size of buffer
that FastPrintWriter should use.

Change-Id: If48cd28d7be0b6b3278bbb69a8357e6ce88cf54a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7a78b39428f86015a1cb1f59d65de455cd52350b 24-Jun-2013 Craig Mautner <cmautner@google.com> Merge "Fix unnecessary and harmful task movement."
f0ac5c87f2a4a7ee8148a7b8d02b55e439ab130c 24-Jun-2013 Craig Mautner <cmautner@google.com> Fix unnecessary and harmful task movement.

Changing the focus to a new activity should not move it to the top of
the task stack. When the previous activity fully pauses and the new
focused activity resumes then it will be brought to the top of the
task stack at the proper time. Moving it there prematurely causes the
ActivityManager and WindowManager stack sequences to be out of sync.

Fixes bug 9518153.

Also remove false warnings in validateTopActivitiesLocked() and add
debug for task movement to TaskStack.

Change-Id: Ib57500b07ded97223155cda7ef603aecc9b642c3
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
48d0d1886731ff19ed3fb47a5997be5df0d1bba8 11-Jun-2013 Craig Mautner <cmautner@google.com> Add activity token to display system.

First step in adding activity specific information to displays.
Replace CompatibilityInfoHolder with DisplayAdjustmentsHolder that
holds an activity token in addition to the CompatibilityInfo.

Change-Id: Ie113cd8dd9c62e0b5311204e039a4829096bea68
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a7cfb4f82751a4f4166006c1725758e8f9bb5c5c 19-Jun-2013 Craig Mautner <cmautner@google.com> Merge "Fix stack transfer bug."
1d001b670e34fe887488047f525a5430154626e1 19-Jun-2013 Craig Mautner <cmautner@google.com> Fix stack transfer bug.

Set the focused stack to the task with the started activity. Do not refocus
when activities report resume.

Add more conditional debug.

Fixes bug 9481679.

Change-Id: Ib7134e88f9a2c8ad1703af0d43442c8bbe4e65dc
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a506a6ec94863a35acca9feb165db76ddac3892c 04-Jun-2013 Jeff Brown <jeffbrown@google.com> Add an API to allow for creating private virtual displays.

This change enables applications to create a private virtual
display that renders its content to a surface of its own creation.
The display is private in the sense that only the application
that owns the display is allowed to place windows upon it.
Mirroring and blanking is also disabled for these displays.

Bug: 9192512
Change-Id: I852ea07f0c7df1d244e354e3daca3a6960285ca0
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
d213beae7539d8feb7cf1ba8f25f9769f5890e0b 17-Jun-2013 Craig Mautner <cmautner@google.com> Don't bring stack forward when moving tasks.

Change-Id: I222eda9e3ea62119c8948a99a63de55b13ca69f4
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
80f00c1f2375796dab09bc4ed5b7631c62f7e158 13-Jun-2013 John Spurlock <jspurlock@google.com> Remove concept of system bar from window manager.

It was already hardcoded to false, this change removes the dead code.

Change-Id: I5e543344e60f69cb9882a70ba29f7c09404ad9fc
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
037aa8d434984840691378f3cc7d99d63dcc4076 07-Jun-2013 Craig Mautner <cmautner@google.com> Centralize all system InputEventReceiver monitors.

Implement all system level InputEvent monitors as new
InputEventListeners. Only one InputChannel required and monitoring
can be enabled or disabled by registering with WindowManagerService.

Change-Id: I64714ab858342ed183c62b421098478ffb6637bc
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
fb7044598bf017783fbc4d86ef5a7350116b0650 06-Jun-2013 Craig Mautner <cmautner@google.com> Merge "Extend stacks up under status bar"
c5a6e44f59b7606eb03cd1dc8e319ab45abe21e7 06-Jun-2013 Craig Mautner <cmautner@google.com> Extend stacks up under status bar

Retain compatibility with earlier behavior. Fixes bug 8685941.

Change-Id: Ida800a2476ba3a18cd97deccbc65c8a02739d118
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
04fe6ebb9f919f196ec06a19bebc09b8e943f95b 31-May-2013 Adam Powell <adamp@google.com> Fix a bug resolving the correct icon/logo in action bars

Remove some abstraction-breaking magic in ActionBarView and replace it
with proper resolution of the icon/logo when creating a window. The
old implementation relied on the ActionBarView's context being an
Activity.

Bug 9171554

Change-Id: Idbbb1942622195dcb55e8119f2d64287b07bb509
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
2e39f5c5cb2eac59b067b68a93b5c454b97a5127 25-May-2013 Dianne Hackborn <hackbod@google.com> Merge "New ArrayMap class."
f4bf0ae2a7c2d9d92c5c8abdb82baa53b4c9ccda 21-May-2013 Dianne Hackborn <hackbod@google.com> New ArrayMap class.

This is a new kind of key/value mapping that stores its data
as an array, so it doesn't need to create an extra Entry object
for every mapping placed in to it. It is also optimized to reduce
memory overhead in other ways, by keeping the base object small,
being fairly aggressive about keeping the array data structures
small, etc.

There are some unit and performance tests dropped in to some
random places; they will need to be put somewhere else once I
decided what we are going to do with this for the next release
(for example if we make it public the unit tests should go in
to CTS).

Switch IntentResolver to using ArrayMap instead of HashMap.

Also get rid of a bunch of duplicate implementations of binarySearch,
and add an optimization to the various sparse arrays where you can
supply an explicit 0 capacity to prevent it from doing an initial
array allocation; use this new optimization in a few places where it
makes sense.

Change-Id: I01ef2764680f8ae49938e2a2ed40dc01606a056b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5a449154d1795abe8e44b7bfe821d640b145e2c6 25-May-2013 Craig Mautner <cmautner@google.com> Convert API refs to StackBox from ActivityStack.

- Removed IActivityManager.getStacks() since getStackBoxes() is better.
- Made createStacks operate relative to StackBox instead of TaskStack.
- Made resizeStack into resizeStackBox.

Change-Id: I7a0e1f4e34f399b4fd1180c60cc3989f9c2433f3
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5ff12101722874f5e7b0cadf06f4c53f4ec4b917 24-May-2013 Craig Mautner <cmautner@google.com> Add retrieval of StackBox info for more flexibility

First step in permitting StackBoxes to be manipulated by user.
Necessary for Configuration changes coming down.

Change-Id: I4029926a35e4fdc59a5759fd9e4bae10bb308413
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c6f7a7ff880c2154d0e794efcef06d9790517365 20-May-2013 Satoshi Kataoka <satok@google.com> Merge "A tiny cleanup as the supplement of I9b5ef954479150bc4735 Bug: 3483284 Bug: 8851603"
12afe1450e14673f4db1bf41a29c006ebd29ccce 20-May-2013 Satoshi Kataoka <satok@google.com> A tiny cleanup as the supplement of I9b5ef954479150bc4735
Bug: 3483284
Bug: 8851603

Change-Id: Ia6dd894dced9cc68c04aafdcae754a404cf52e83
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
f1a6d646a458d1383c005e67f643f316814916c0 20-May-2013 Satoshi Kataoka <satok@google.com> Merge "Fix a bug on the focus of the input method switching dialog"
02679f647b3a48f8340138ac07c7bc7bced25b02 20-May-2013 Satoshi Kataoka <satok@google.com> Fix a bug on the focus of the input method switching dialog

Bug: 8851603
Change-Id: I9b5ef954479150bc47351197c792fb96aba70d01
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
b3b36ba13895d779159799341d432f6380a0ba8a 20-May-2013 Craig Mautner <cmautner@google.com> Resize all changed windows and fix moveTaskToStack

- Add all changing windows to mResizingWindows when an ActivityStack
is resized.

- Stop calling TaskStack.setBounds if the bounds haven't changed.

- Make moving a task from one stack to another work properly.

- Eliminate unused methods and redundant variables in WindowState and
WindowStateAnimator.

Change-Id: I3a950c777bcc50cdeced150d44423d4d0b38af4a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
76ea2246781a899659ce4e24f3b75d17d2f0745d 15-May-2013 Craig Mautner <cmautner@google.com> Limit screenshots to specified activity and stack.

The screenshots were capturing the entire screen. Now they are limited
to the stack containing the activity.

Add debug for stack states.

Change-Id: I6d47cd37091bfdfd94e7abe89826b7ba8cb69b51
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4058828d8186d2037e59fa21e5f209c882bbab2b 14-May-2013 Craig Mautner <cmautner@google.com> Merge "Fix rotation animations not working."
11462cc0b0fd34151968b310833a0b8525457eb4 14-May-2013 Craig Mautner <cmautner@google.com> Fix rotation animations not working.

Restore over aggressive deletions from ag/305620.

Also remove over specification of debug member variables.

Change-Id: Id637d0dbece169d27271aabd714d34d449bfb050
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
04db1762fb75a3938dda34537626c41c8e97d9c5 13-May-2013 John Spurlock <jspurlock@google.com> Window manager cleanup.

Specifically:
- Fix policy vs wm lock management issues.
- Share runnable to avoid allocation.
- Remove unused noop runnable.
- Make sure to handle status bar = null case.
- Fix javadoc typo.

Bug: 8890313
Change-Id: I242eaef8e946025f6885d6dba3225722fb0ca7ce
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5457e61f64e625be35f997ee3865ef61a2133468 11-May-2013 Craig Mautner <cmautner@google.com> Fix window and wallpaper position problems

- Put wallpaper behind all other windows.

- When moving a task to the top or bottom of a stack, move all of the
other tasks' windows on the stack to the top or bottom with the task.

Change-Id: I0821341dfd602c9240c685e954dac42678132d4a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c87a732e7554e74d991cbe893c2923a349263246 07-May-2013 Craig Mautner <cmautner@google.com> Merge "Call ensureActivitiesVisibleLocked from supervisor."
b59dcfd5e108fdffbc610ef109cccecbbd11cd75 06-May-2013 Craig Mautner <cmautner@google.com> Call ensureActivitiesVisibleLocked from supervisor.

- Don't call ActivityStack.ensureActivitiesVisibleLocked directly.
Instead call ActivityStackSupervisor.ensureActivitiesVisibleLocked.

- Add detecting monochrome screenshots to black screenshots.

- minor refactors.

Change-Id: I050b1cd40cacaab451f1460a77a82125a8077ff2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
dfe570527c2b79f9339f398aa69156756197683d 03-May-2013 Craig Mautner <cmautner@google.com> Merge "Fix layering and launching issues."
05d290365f0b9ed781ffcb30b38a0c7c6e450e9d 03-May-2013 Craig Mautner <cmautner@google.com> Fix layering and launching issues.

- Replace calls to ActivityStack.resumeTopActivity() with calls to
ActivityStackSupervisor.resumeTopActivities().

- Move dim layers from display scope to stack scope. This applies to
both the animation background dim layer and the FLAG_DIM_BEHIND dim
layer.

- Move windows on stacks that are not targeting wallpaper above the
wallpaper. Otherwise wallpaper placement hides the non-focused stacks.

Change-Id: Ic6b97ac6b094672bb1ddac17ce46ea58c738f073
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
8d044e8bc287c1a567d82aedbe30085b011544c3 01-May-2013 Dianne Hackborn <hackbod@google.com> Start combining threads in system process.

This introduces four generic thread that services can
use in the system process:

- Background: part of the framework for all processes, for
work that is purely background (no timing constraint).
- UI: for time-critical display of UI.
- Foreground: normal foreground work.
- IO: performing IO operations.

I went through and moved services into these threads in the
places I felt relatively comfortable about understanding what
they are doing. There are still a bunch more we need to look
at -- lots of networking stuff left, 3 or so different native
daemon connectors which I didn't know how much would block,
audio stuff, etc.

Also updated Watchdog to be aware of and check these new
threads, with a new API for other threads to also participate
in this checking.

Change-Id: Ie2f11061cebde5f018d7383b3a910fbbd11d5e11
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
6601b7bdeb46756fd83ad4c1966ef966c52b46e4 29-Apr-2013 Craig Mautner <cmautner@google.com> Exclude regions from the tap detector.

Fix typing on the keyboard causing focus to shift stacks.

Change-Id: I4ec9ccdbe35e27f4860a5bdf0e2818f58e53b873
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ccb825dde6ecd8678c1617179048913057d2f9c5 28-Apr-2013 Craig Mautner <cmautner@google.com> Merge "Clean up FocusedStackFrame layer setting."
f76664673eed1c7b2fa141ce99e01028bc7a1be0 28-Apr-2013 Craig Mautner <cmautner@google.com> Clean up FocusedStackFrame layer setting.

- Putting the stack frame above the highest app window layer ends up
putting it over the IME when the caret popup is showing. This puts
the stack frame layer above the highest non-child window layer.

- Also change the timing so the layer isn't applied until all other
layers are also being applied.

Change-Id: Ic5f142998822ac1e3890a2943cda7fc86a7e7974
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
b551c6d95925fc8324d962df5b75fa6e14058c28 26-Apr-2013 Andreas Huber <andih@google.com> Fix wfd crash after disconnect due to null pointer exception in

WindowManagerService.java

Change-Id: I661f9c73d481da88661793ad529c0807cf74a5e7
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
eb95786fd3ffa9807a9d00c25e7c7e8a62d23658 25-Apr-2013 Craig Mautner <cmautner@google.com> Pause activities when leaving.

Missed a spot where an activity that is launching another was not
being paused. Fixes bug 8640130. At least in one case.

Release mWindowMap as soon as it is no longer needed.

Change-Id: Id2c63d3d715b98741e2ebe3c9985cb1e9ca5ffbc
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
d3c933875cbf35cf6f4f29ae686080224552278f 24-Apr-2013 Craig Mautner <cmautner@google.com> Fix deadlock.

Grabbing StackTapDetector before grabbing mWindowMap doesn't play well
with grabbing mWindowMap and then StackTapDetector.

Change-Id: I40daa4c940930b1ebbb587edc1958e84321d6d7f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
858d8a6583b0c91c66960167b84c67b6c4e2d3c6 24-Apr-2013 Craig Mautner <cmautner@google.com> Fix user switching.

- Save and restore WindowManager stack states.
- Maintain ActivityManager activity states based on the stack
the activity is in.

Fixes bug 8646641.

Change-Id: I16c76c7708ab49121c3884a7e5bf219898b92d3f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
cf910b0c714b2ca90ea0013e5695850506a1d36f 23-Apr-2013 Craig Mautner <cmautner@google.com> Add tap detector for switching stack focus.

- New InputEventReceiver for detecting taps outside of focused stack
boundaries.
- Fixed bug that wasn't pausing the non-focused window when returning
home.

Change-Id: Ia51d312a7c029abc01eb5df1102814cc29d33b47
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7bb0ae0d45d83d4b9e5d1de5bd18eca9b2e41e03 18-Apr-2013 Craig Mautner <cmautner@google.com> Merge "Add null test and remove redundant call."
f06b8c1788e28f31e18f9313c3d7efe1a0011b9f 18-Apr-2013 Craig Mautner <cmautner@google.com> Add null test and remove redundant call.

- Did not handle the case where mTaskIdToTask returned null.
Fixes bug 8646178.
- updateInputWindowsLw() was being called in removeWindows
immediately after it was called in performLayoutAndUpdateSurfaces.

Change-Id: I1b8bcfadcc93f8c6638fd4247b426af77feeee23
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ab0a89041234a95e73f0a32bafca443ed9a19d74 18-Apr-2013 Craig Mautner <cmautner@google.com> Merge "Add transparent frame around focused stack."
a9a3fb1da3d3d41f923e87d5b08b35c3e0c1f72e 18-Apr-2013 Craig Mautner <cmautner@google.com> Add transparent frame around focused stack.

- Also fix bugs when removing stack.

Change-Id: I3e0e3029f512f086601add00ccf34b2fea84296d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a6e8ebb12f2d451236fc354778d2a916ed2fb0ef 18-Apr-2013 Dianne Hackborn <hackbod@google.com> am fb4e1c21: am 25b49734: Merge "Fix issue #8540550: Screenshots should never have transparency" into jb-mr2-dev

* commit 'fb4e1c21eddf07fad7b36ac5e19dd2d479e71c5c':
Fix issue #8540550: Screenshots should never have transparency
fb4e1c21eddf07fad7b36ac5e19dd2d479e71c5c 18-Apr-2013 Dianne Hackborn <hackbod@google.com> am 25b49734: Merge "Fix issue #8540550: Screenshots should never have transparency" into jb-mr2-dev

* commit '25b49734cac1ecd17dba2af2a1af8328490236d4':
Fix issue #8540550: Screenshots should never have transparency
ca46b8711868d3ca2999e38ad01c05df6754b37e 18-Apr-2013 Dianne Hackborn <hackbod@google.com> Fix issue #8540550: Screenshots should never have transparency

Make sure the thumbnail bitmap is initialized with a black
background.

Change-Id: I87c00d309b7d30b6085a751aa4ae22cf146c74f5
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
29219d963d1ec29ddea3e5814eb82c2aeaccc1ac 17-Apr-2013 Craig Mautner <cmautner@google.com> Steady improvement to multi stack.

- Fix back button behavior with two stacks. Stopping activities were
held in that state indefinitely. This change causes IDLE_NOW_MSG to
be sent immediately for the last activity in a stack.

- Touch in non-focused stack was being ignored because of focus tests
in AbsListView.

- Change the focused stack when the activity focus changes. Renamed
mMainStack to mFocusedStack to reflect this.

- Resume all top stack activities when resuming.

- Assign intent task to ActivityRecord if it doesn't have a task.
Fixes bug 8433463.

Change-Id: I8d3c806234511697bc209ab99890730ffa514d20
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4cd0c13f8f765118a24e31548c058b5029481bea 17-Apr-2013 Craig Mautner <cmautner@google.com> Incremental repairs to side by side stacks.

- Add taskId parameter to createStack() so stacks are pre-populated
with a task.
- Keep track of stack access order in DisplayContent so getTasks
returns in MRU order.
- Set touchableRegion in InputMonitor so modal touching does not
extend beyond stack boundary.
- Fix stack merging so that deleting a stack results in a new
stack the size of the two children.

Change-Id: I62a6ba0a34f34dd7ec866b440bf04595379e19e8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
967212cb542e6eeb308678367b53381bff984c31 14-Apr-2013 Craig Mautner <cmautner@google.com> Implement stack splitting and task movement.

Split stacks and move tasks between them. Layout the windows
according to the new stack split.

After layout content rectangles are known split the available area
between all stack boxes. Then use those values for future layout.

Provide stack contents to ActivityManager.

Change-Id: I9746e6185445633810d506be514d0b7b540a7f99
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
de4ef020ec5c3acdc90c4ba43011dda20d98d4dd 08-Apr-2013 Craig Mautner <cmautner@google.com> Implement separate stacks.

One for home activity(s), one for other activities. Coordination
between the stacks is handled by the ActivityStackSupervisor.

Change-Id: I11395edea501d2f84a18a6a8bced1ce3d0797dad
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c1dedb6fc41855a03651924b2cc18b2d605413ed 13-Apr-2013 Craig Mautner <cmautner@google.com> Merge "Prepare WindowManager for multiple stacks."
9903d8bf78c51035001dc92e47679ea9092b7ae8 13-Apr-2013 Craig Mautner <cmautner@google.com> Merge "Separate stacks into Home and others."
229f1aadf95069c7369c153e107fe98050c17719 10-Apr-2013 Dianne Hackborn <hackbod@google.com> am abe0aa78: am 8f980e1a: Merge "Reduce duration of rotation xfade animation." into jb-mr2-dev

* commit 'abe0aa78caf81b24af0b45700801fc1f867cfa0e':
Reduce duration of rotation xfade animation.
abe0aa78caf81b24af0b45700801fc1f867cfa0e 10-Apr-2013 Dianne Hackborn <hackbod@google.com> am 8f980e1a: Merge "Reduce duration of rotation xfade animation." into jb-mr2-dev

* commit '8f980e1a5ae99d5e34aaef6aac7f38a7d0038631':
Reduce duration of rotation xfade animation.
8f980e1a5ae99d5e34aaef6aac7f38a7d0038631 10-Apr-2013 Dianne Hackborn <hackbod@google.com> Merge "Reduce duration of rotation xfade animation." into jb-mr2-dev
d5d5d0f4b8c75c9ed4fea320b4f31740b88dd37e 04-Apr-2013 Craig Mautner <cmautner@google.com> Prepare WindowManager for multiple stacks.

Create concept of home stack. When moving a new task to the top
move the home stack back.

Change-Id: I2e352722da0c4785b19227713bc30c0850d187b1
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
9e4f28cfa157fff89e42859edc9cce546508491f 03-Apr-2013 Craig Mautner <cmautner@google.com> Separate stacks into Home and others.

Change-Id: I9434ee6cd9e8a8baf24d4e4ee5a15e99cf11f227
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e1197547a0669155ae81838595614cdf39e87a8b 05-Apr-2013 Craig Mautner <cmautner@google.com> am d339818d: am bab9687e: Merge "Make the min layer go down through all windows" into jb-mr2-dev

* commit 'd339818d9a261974e535cd25797d7a614a17657d':
Make the min layer go down through all windows
d339818d9a261974e535cd25797d7a614a17657d 05-Apr-2013 Craig Mautner <cmautner@google.com> am bab9687e: Merge "Make the min layer go down through all windows" into jb-mr2-dev

* commit 'bab9687e6473072d6ff4f7ea5a7b21bcfbf95744':
Make the min layer go down through all windows
bab9687e6473072d6ff4f7ea5a7b21bcfbf95744 05-Apr-2013 Craig Mautner <cmautner@google.com> Merge "Make the min layer go down through all windows" into jb-mr2-dev
4238e3e4b5edbd7e28d0d929ac0c4fdbecd7b100 28-Mar-2013 Craig Mautner <cmautner@google.com> Make the min layer go down through all windows

The min layer was set to only show the windows that matched
the specified app token. But that meant when dialogs were
launched it only showed the dialogs and not the background
windows.

Added improved debugging.

fixes bug 8502844.

Change-Id: I26b49568b872801ec9aa088df20317aa752dacd6
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c849fbcf3ddd3cbb08840c72f7f325294c5d2802 02-Apr-2013 Brian Colonna <bcolonna@google.com> resolved conflicts for merge of 5856ee4b to master

Change-Id: I60ba85bc246b9cf25d467b2099535aad47f82ca7
5856ee4bd620fcbabc5f52651875d034d1513c5b 02-Apr-2013 Brian Colonna <bcolonna@google.com> am 1eccc0cf: Merge "FUL now restarts when flipping tablet 180 (bug 7484464)" into jb-mr2-dev

* commit '1eccc0cf5f7f33203091c0b475a4ad91570c85cd':
FUL now restarts when flipping tablet 180 (bug 7484464)
08426453f3bad82051c7a2d3f8cd635984d5f5da 02-Apr-2013 Craig Mautner <cmautner@google.com> am 79b468dc: Merge "Fix potential deadlock between LockScreen and WindowManagerService" into jb-mr2-dev-plus-aosp

* commit '79b468dcaab89f52394132d5ee733c6a01bad7e9':
Fix potential deadlock between LockScreen and WindowManagerService
0438bd692b523b2291cd945d1affe99c133743b6 16-Jan-2013 Sangkyu Lee <sk82.lee@lge.com> Fix potential deadlock between LockScreen and WindowManagerService

If LockScreen is enhanced using SurfaceView/GLSurfaceView,
deadlock problem between LockScreen and WindowManagerService
can occur because of IWindow.resized() callback.
And it must lead to watchdog and reset.

IWindow.resized() callback is one-way function so calling resized()
callback of a remote IWindow object is never blocked.
However, calling resized() callback of a local IWindow object
(LockScreen is running on the same system_server process)
is always blocked until resized() callback returns.
Because resized() callback of SurfaceView/GLSurfaceView can lead to
WindowManagerService.relayoutWindow() call, deadlock can occur
between relayoutWindow() and performLayoutAndPlaceSurfacesLockedInner().
(Both functions need locking mWindowMap)

So this patch simulate one-way call when calling resized() callback
of a local IWindow object.

Change-Id: I2a6a5c74ed22d8e6b7a3bea3424ff2879d227105
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>

Conflicts:
services/java/com/android/server/wm/WindowManagerService.java
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
88f3677be1532fdd62a597897e3ab57efe491643 16-Jan-2013 Sangkyu Lee <sk82.lee@lge.com> Fix potential deadlock between LockScreen and WindowManagerService

If LockScreen is enhanced using SurfaceView/GLSurfaceView,
deadlock problem between LockScreen and WindowManagerService
can occur because of IWindow.resized() callback.
And it must lead to watchdog and reset.

IWindow.resized() callback is one-way function so calling resized()
callback of a remote IWindow object is never blocked.
However, calling resized() callback of a local IWindow object
(LockScreen is running on the same system_server process)
is always blocked until resized() callback returns.
Because resized() callback of SurfaceView/GLSurfaceView can lead to
WindowManagerService.relayoutWindow() call, deadlock can occur
between relayoutWindow() and performLayoutAndPlaceSurfacesLockedInner().
(Both functions need locking mWindowMap)

So this patch simulate one-way call when calling resized() callback
of a local IWindow object.

Change-Id: I2a6a5c74ed22d8e6b7a3bea3424ff2879d227105
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
b1b9a8ac07ea7d438eda613f4c798dd8b10a66ce 29-Mar-2013 Brian Colonna <bcolonna@google.com> FUL now restarts when flipping tablet 180 (bug 7484464)

When a tablet rotates, FUL must be stopped and restarted in a new
position. 90 degree rotations cause a configuration change, causing
FUL to be automatically reconstructed in the new location. However,
a 180 degree rotation is not a configuration change, so FUL was not
restarting. A 180 degree rotation happens more often than one might
think. If you set the tablet down and later picked it up in the
opposite orientation, FUL would not work prior to this fix.

This change adds a rotation watcher to KeyguardFaceUnlockView. It
watches for 180 degree rotations and stops and restarts FUL
accordingly.

The rotation watcher callback must be unregistered when
KeyguardFaceUnlockView is recreated (as during 90 degree rotation
changes), otherwise the number of rotation watcher callbacks will keep
growing and they will never go away. This is a problem not just
because there are many callbacks hanging around, but also because the
old callbacks end up trying to access biometric unlock views that no
longer exist, resulting in crashes. So, a simple function was added
to the window manager to unregister a rotation watcher.

Change-Id: Ie1ef20a9a22b8f4e39918987dff2b8ad444fcfd1
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a57c695bf2c0f917517ecac8251043716b34f72d 29-Mar-2013 Dianne Hackborn <hackbod@google.com> Reduce duration of rotation xfade animation.

Also add code for tracking how long a rotation takes,
and who is causing it to take that time.

Change-Id: Ie3352ddfddd247f5a5c08f7da6bfe6b4da607ba2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5ab6d905782562995f1755f03c3716887fba53b8 27-Mar-2013 Dianne Hackborn <hackbod@google.com> am a4820789: am 5871b258: Merge "Change wm commands to return size and density info." into jb-mr2-dev

* commit 'a4820789136c814e1e9ae26d5a0712e1c7fd4dd5':
Change wm commands to return size and density info.
672cf45de7aa5ad6fd1f75512ee5a451a16c0b39 26-Mar-2013 Dianne Hackborn <hackbod@google.com> Change wm commands to return size and density info.

Change-Id: Id25722fe5f0cd9470d04d657f067e5ad29927c98
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
00af9fe6ae0da5b716212fa754163d90b60c1ee6 25-Mar-2013 Craig Mautner <cmautner@google.com> Modify StackBox and TaskStack methods.

Also add dump() throughout.

Change-Id: I5369d2e71262645d9b1015bd4e72fad395cc7547
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
1a563451db20b248829638c777c0b9cc174d3b5f 22-Mar-2013 Craig Mautner <cmautner@google.com> am 78089c3c: am 5341f377: Merge "Reduce situations where black thumbnail occurs." into jb-mr2-dev

* commit '78089c3c225c27c326f5e4aad0084e173a7075e9':
Reduce situations where black thumbnail occurs.
24d88747e9d78c49452768374dc213d744cfbfed 20-Mar-2013 Craig Mautner <cmautner@google.com> Reduce situations where black thumbnail occurs.

Pause and retry capturing a thumbnail if the window hasn't yet
been drawn. Still will show black thumbnails if recents is pressed
before window has anything drawn.

Improves bug 7552304.

Change-Id: I550c5a60510bfc4547bbb44451d57b4bc9f49880
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
8c2267d471fc9dc457077ad2e700db1bd01addb9 19-Mar-2013 Craig Mautner <cmautner@google.com> am c9e2239e: am aea8b0e5: am 7f7ac5b4: am fda1bff8: Merge "Correct the target app token for input method window"

* commit 'c9e2239efeddc7f22b67073e33c99e5521d31bf1':
Correct the target app token for input method window
aea8b0e571d9fe6b99b001df73d86d6e67bc276a 19-Mar-2013 Craig Mautner <cmautner@google.com> am 7f7ac5b4: am fda1bff8: Merge "Correct the target app token for input method window"

* commit '7f7ac5b4a86be479bdede226fd4a2bddcd8a9a2b':
Correct the target app token for input method window
5c97184c3a92dd2a608fd031ab5c01574030777a 30-Oct-2012 Carrie Xu <carrie.xu@sonymobile.com> Correct the target app token for input method window

The root cause is:
There is a defect in window manager service: When a new
activity that can be ime target is added into window manager
but the Z order of input method window don't need to be
changed, then the target app token of input method window
would not be updated to new one. This defect may cause that
the layer of input method window is calculated incorrectly.

The solution:
Correct the target app token for input method window.

Change-Id: I008311e3c9b1cf5fc320b614d8675c183c506d50
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
d9a22881fda77e208f54f893a804d0001d27a27e 16-Mar-2013 Craig Mautner <cmautner@google.com> Complete removal of Task from DisplayContent.

Moved Tasks into TaskStacks.

Change-Id: I3478dab4eab3a68d4d71a7a5bb2e65ba2394f2d7
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a5eed0b8c7e7bf38d27960b961ce112b0f38f2ba 16-Mar-2013 Craig Mautner <cmautner@google.com> Refactor addWindowToListInOrderLocked for clarity

Break up long method into three orthogonal shorter methods.

Change-Id: Ieeffd6263b84de50956f03e513f80a9264a09e43
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c00204b4d14d49a0417b44ca21aee4f0d4c466e0 06-Mar-2013 Craig Mautner <cmautner@google.com> Start moving Tasks from DisplayContent to TaskStack

- Create new classes for Stacks on WindowManager.
- Stop using DisplayContent methods and members:
addAppToken(),
removeAppToken(),
setAppTaskId(),
removeTask(),
mTaskIdToDisplayContents,
mTaskIdToTask.
- Start using WindowManagerService.createTask().
- Establish hierarchy of references: AppWindowToken=>Task=>
TaskStack=>StackBox=>DisplayContent.
- Clean up StackBox, TaskStack, and Task.

Change-Id: I798990aa7966784d22f4a43822087d8bb0404dd6
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ee61a7fb95b96880042a963c78774a148eed8c15 05-Mar-2013 Dianne Hackborn <hackbod@google.com> am 530b2b1c: am a5513616: Merge "Add new WindowId for cross-process monitoring of focus." into jb-mr2-dev

* commit '530b2b1c98e3a3d86fd90cd91a08005370b8aa49':
Add new WindowId for cross-process monitoring of focus.
e3f23a36d86fedf6c8c6503378cd6d2190c5ab23 01-Mar-2013 Dianne Hackborn <hackbod@google.com> Add new WindowId for cross-process monitoring of focus.

This is a class representing a window and providing limited
interaction with it, which can be handed across processes.

Change-Id: I22885f2064a9cc8c68d690a5858c2e28bbb6a0f3
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
f81b908752365fda62a6158bfe7d1559b0d52cdd 26-Feb-2013 Craig Mautner <cmautner@google.com> Remove AppTokenIterator from DisplayContent.

Simplify accessing successive AppWindowTokens from different
TaskLists.

Change-Id: Icf6265dd6c7953c9c770c97e1342f0f81256c017
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
2ad920759b1981eaf526fd37a314fbc5a3ed90ae 26-Feb-2013 Craig Mautner <cmautner@google.com> Revert ActivityManager changes for tasks. DO NOT MERGE

Keeping all activity=>task changes in master and removing them
from jb-mr2.

Revert "Update histories simultaneously."
Revert "Add null check to setAppGroupId."
Revert "Fix crashing bug in validator."
Revert "Switch topRunning* and moveTaskTo*"
Revert "Begin switch over to task based history."
Revert "Reset and reuse Iterators and don't new() one."
Revert "Remove AppWindowToken lists."
Revert "Fix build."
Revert "Remove unused App methods."
Revert "Stop using AppToken movement and start using Task."
Revert "Replace access to mAppTokens with AppTokenIterator"
Revert "Refactor setAppOpVisibility implementation."
Revert "Add AppWindowTokens to TaskList."
Revert "Make ActivityStack.mHistory private."
Revert "Migrate AppWindowToken lists into DisplayContent."

Change-Id: I5722c9a4956dccb52864207e2967690bc58e4ebb
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c4aad01cbbb69c916ef323693e1fd0560b0eccba 23-Feb-2013 Dianne Hackborn <hackbod@google.com> Formalize overscan metrics.

The window manager now maintains and reports a new formal
"overscan insets" for each window, much like the existing
content and visible insets. This is used to correctly
position the various UI elements in the various combination
of layout options. In particular, this allows us to have
an activity that is using fitSystemWindows to have the content
of its UI extend out to the visible content part of the screen
while still positioning its fixed UI elements inside the
standard content rect (and the entire window extending all
the way into the overscan area to fill the screen as desired).

Okay, maybe that is not written so clearly. Well, it made
my head hurt too, so suffer!

The key thing is that windows now need to know about three
rectangles: the overall rectangle of the window, the rectangle
inside of the overscan area, and the rectangle inside of the
content area. The FLAG_LAYOUT_IN_OVERSCAN option controls
whether the second rectangle is pushed out to fill the entire
overscan area.

Also did some improvements to debug dumping in the window
manager.

Change-Id: Ib2368c4aff5709d00662c799507c37b6826929fd
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
12e563fff95ebb186126d531b6f65af18eb1a069 22-Feb-2013 Craig Mautner <cmautner@google.com> Merge "Create rotation animation modes."
3c1743705c4df816089e07a17753c6043b4d8e66 22-Feb-2013 Craig Mautner <cmautner@google.com> Create rotation animation modes.

Allow fullscreen windows to specify crossfade or jumpcut animations
that override the default rotation animation. Only if the incoming
and outgoing topmost windows are fullscreen and both specify the
same animation to use.

Fixes bug 8182773.

Change-Id: I6b3c0020d7bd2cdfba5c66189e114ec62cd54fcf
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
b44de0d910a3ec22b9963e538117e257f621de47 22-Feb-2013 Craig Mautner <cmautner@google.com> Update histories simultaneously.

In moveTaskToBackLocked calls that used mHistory were being made
between the times that mTaskHistory and mHistory were modified. This
caused an inconsistent state that led to Windows arranged out of
order. Updating both history stacks at the same time fixes this.

Fixes bug 8244261.

Change-Id: I9669762ad39b06ab6d401122702b74969d4dc658
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
32b44d08e2870692451eef9c61c8e2fb6753e06b 21-Feb-2013 Craig Mautner <cmautner@google.com> Add null check to setAppGroupId.

Fix bug 8217929.

Change-Id: I3bd54c32abcf6683c2fa75a85bf5025f47e09398
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5161f20925ec071e72c2b0eb084f7abaa9dffabf 21-Feb-2013 Craig Mautner <cmautner@google.com> Fix crashing bug in validator.

Change-Id: I649bb7cfc2b42fbeda478edcaa3a56f3c23d4bc8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
07aa25dab9b8f5592b2e9e7dbc708b5e3064c5ff 21-Feb-2013 Craig Mautner <cmautner@google.com> Merge "Switch topRunning* and moveTaskTo*"
11bf9a52eb9fb02a8c553a1cb1d71725f9706dad 19-Feb-2013 Craig Mautner <cmautner@google.com> Switch topRunning* and moveTaskTo*

- More of the Activity to Task changeover.
- Fix bug in validateAppTokens().
- Improved validation of changeover.
- Eliminated iterator classes.

Change-Id: I934a208eabfc9a2668e5a6162452e1406f2c8d3a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
fd171e43e4946ce5789e5dd8ade09a1cbf2a5ae0 20-Feb-2013 Daniel Sandler <dsandler@android.com> Merge "Switch to system process before modifying rotation."
3de830b82b74f3df86ede47c8b1a0b8dcac113d6 20-Feb-2013 Daniel Sandler <dsandler@android.com> Switch to system process before modifying rotation.

Bug: 8218133
Change-Id: Ib44d64d48dbdf3095182c409dd2211f6a3b726ad
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5d9c7be84d9628c1cf199fcf9015942835c4671b 15-Feb-2013 Craig Mautner <cmautner@google.com> Begin switch over to task based history.

- Introduce the task history and add to and remove from it with
verification.

Change-Id: If97e74f5a13f85acdb1521fc6d0b066a7e8584ae
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c652de8141f5b8e3c6bcf8916842b6e106413b1a 16-Feb-2013 Dianne Hackborn <hackbod@google.com> Implement display overscan support.

The window manager now keeps track of the overscan of
each display, with an API to set it. The overscan impacts
how it positions windows in the display. There is a new set
of APIs for windows to say they would like to go into the
overscan region. There is a call into the window manager to
set the overscan region for a display, and it now has a
concept of display settings that it stores presistently.

Also added a new "wm" command, moving the window manager
specific commands from the "am" command to there and adding
a new now to set the overscan region.

Change-Id: Id2c8092db64fd0a982274fedac7658d82f30f9ff
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
29479ebe1007361222bf6ab4d5e2a27927d4b8e8 14-Feb-2013 Mathias Agopian <mathias@google.com> clean-up following Surface split

Change-Id: I853a76d92d957ee38a36fcdd280d6407ec316987
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
22ee9aad834b055df1bd5d5544e37a63edc963fe 14-Feb-2013 Craig Mautner <cmautner@google.com> Merge "Reset and reuse Iterators and don't new() one."
343ad71d7cb4934751a91006677266bd73ed224c 14-Feb-2013 Craig Mautner <cmautner@google.com> Reset and reuse Iterators and don't new() one.

Save time and memory by resuing permanent mTmpXxxIterator for
AllWindowsIterator and AppTokenIterator.

Change-Id: I2e5143364651d9471e9e70eee514d3f45d595468
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
58a1ca6642d404b67e5c9e75076b9bbe08e4076b 14-Feb-2013 Mathias Agopian <mathias@google.com> Merge "split Surface in two classes: SurfaceControl and Surface"
3866f0d581ceaa165710feeee9f37fe1b0d7067d 12-Feb-2013 Mathias Agopian <mathias@google.com> split Surface in two classes: SurfaceControl and Surface

SurfaceControl is the window manager side; it can
control the attributes of a surface but cannot push buffers
to it. Surface on the other hand is the application (producer)
side and is used to push buffers to the surface.

Change-Id: Ib6754c968924e87e8dd02a2073c7a447f729f4dd
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
496bdbba30a113baaec61d4d0c011461cf5ee36d 14-Feb-2013 Craig Mautner <cmautner@google.com> Remove AppWindowToken lists.

No longer necessary.

Change-Id: I0d2b96f69152fb93b6ba56f02ce9693ff1370cbc
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
534d136aa66fb13f7c1b482513627de45c218c29 14-Feb-2013 Craig Mautner <cmautner@google.com> Merge "Remove unused App methods."
f0b36c559074718c5e932c20a9931d97d9c061ef 14-Feb-2013 Craig Mautner <cmautner@google.com> Merge "Refactor setAppOpVisibility implementation."
b0c0b1fd70e3edeb724e2b2fb2c7063eb943f05e 14-Feb-2013 Craig Mautner <cmautner@google.com> Remove unused App methods.

Now that the Task methods have replaced the App methods remove
the App methods.

Change-Id: I0e7432f2c6f99708759ed8c871d20eb5bd38c3c2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
926f3839d81e4b6b60238e38350bec7cb6d0269e 13-Feb-2013 Craig Mautner <cmautner@google.com> Stop using AppToken movement and start using Task.

Change-Id: I5fbd3b2b692e0e127386051f782b1015515ba384
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
30e2d72810e699d7a61277b7ba1b6cace26b84aa 12-Feb-2013 Craig Mautner <cmautner@google.com> Replace access to mAppTokens with AppTokenIterator

More switching from Activity-based to Task-based control.

Change-Id: Ida47d71a52b875a6a6bd77cb62911053f942da15
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
bea3b60ed1ecf1cc2a9a6b1fe550f8af7392c721 13-Feb-2013 Craig Mautner <cmautner@google.com> Merge "Add AppWindowTokens to TaskList."
fb32c6e9e97e8c7541e85fcbd200ae86e721e7a4 13-Feb-2013 Craig Mautner <cmautner@google.com> Refactor setAppOpVisibility implementation.

- Convert double iteration over DisplayContents and WindowLists to
single iteration over AllWindowsIterator.

- Use existing change check in show() and hide() to trigger animation
scheduling rather than propagate change state up through calling tree.

Change-Id: Ic703a9fddebacbd0785bd5a186e95f9d0b128c42
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
05d6272bad2d707b488a6f8784ce8aea5e25b110 11-Feb-2013 Craig Mautner <cmautner@google.com> Add AppWindowTokens to TaskList.

- Add/remove/move TaskLists from ActivityStack.
- Further isolate mHistory.
- Cleanup warnings by parameterizing ArrayList.
- Fix previous bugs.

Change-Id: Ife8c7b7347479c70f10467cc384283456149ac50
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
b6b23ecdfc262097eaf7afa611e9f22cc543806f 12-Feb-2013 Dianne Hackborn <hackbod@google.com> App ops: the draw on top op now actually controls what is drawn.

Change-Id: Iccfc0723a0f92108a4f7d631d74efe21dbc6f157
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
2ceb08150512ca121acc474d94f84357f0bf0bbf 07-Feb-2013 Craig Mautner <cmautner@google.com> Merge "Migrate AppWindowToken lists into DisplayContent."
c2293025a25e04b26bf53713d71f85fd9ca5e8e9 07-Feb-2013 Dianne Hackborn <hackbod@google.com> App ops: track system windows, monitoring changes.

Change-Id: I273e82bdad66ada3bf0f7ec9176bc304b9ee1ee8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
b1fd65c0ff5784b90d765edb7e3c3115d767dff0 05-Feb-2013 Craig Mautner <cmautner@google.com> Migrate AppWindowToken lists into DisplayContent.

In preparation for converting ActivityManager control to a task-based
interface the AppWindowTokens are being stored per-display.

Change-Id: Ie5e355219554523f5e56eaef138d382975cf1682
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
cb9a61bdc40b9215e614ea26df6bb58e2de7d764 23-Jan-2013 Svetoslav <svetoslavganov@google.com> Display magnifier does not release its surface on destroy.

Change-Id: I0b9448c8859b0167632652060b08072dc8c9c0a5
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
80943d8daa6ab31ab5c486d57aea406aa0730d58 02-Jan-2013 Svetoslav Ganov <svetoslavganov@google.com> Adding UI test automation APIs.

This change adds APIs support for implementing UI tests. Such tests do
not rely on internal application structure and can span across application
boundaries. UI automation APIs are encapsulated in the UiAutomation object
that is provided by an Instrumentation object. It is initialized by the
system and can be used for both introspecting the screen and performing
interactions simulating a user. UI test are normal instrumentation tests
and are executed on the device.

UiAutomation uses the accessibility APIs to introspect the screen and
a special delegate object to perform privileged operations such as
injecting input events. Since instrumentation tests are invoked by a shell
command, the shell program launching the tests creates a delegate object and
passes it as an argument to started instrumentation. This delegate
allows the APK that runs the tests to access some privileged operations
protected by a signature level permissions which are explicitly granted
to the shell user.

The UiAutomation object also supports running tests in the legacy way
where the tests are run as a Java shell program. This enables existing
UiAutomator tests to keep working while the new ones should be implemented
using the new APIs. The UiAutomation object exposes lower level APIs which
allow simulation of arbitrary user interactions and writing complete UI test
cases. Clients, such as UiAutomator, are encouraged to implement higher-
level APIs which minimize development effort and can be used as a helper
library by the test developer.

The benefit of this change is decoupling UiAutomator from the system
since the former was calling hidden APIs which required that it is
bundled in the system image. This prevented UiAutomator from being
evolved separately from the system. Also UiAutomator was creating
additional API surface in the system image. Another benefit of the new
design is that now test cases have access to a context and can use
public platform APIs in addition to the UiAutomator ones. Further,
third-parties can develop their own higher level test APIs on top
of the lower level ones exposes by UiAutomation.

bug:8028258

Also this change adds the fully qualified resource name of the view's
id in the emitted AccessibilityNodeInfo if a special flag is set while
configuring the accessibility service. Also added is API for looking
up node infos by this id. The id resource name is relatively more stable
compared to the generaed id number which may change from one build to
another. This API facilitate reuing the already defined ids for UI
automation.

bug:7678973

Change-Id: I589ad14790320dec8a33095953926c2a2dd0228b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
6cfa7292cffac750d344c0cad8085ccd533b5215 15-Jan-2013 Craig Mautner <cmautner@google.com> Add Overrides, remove trailing whitespace.

Once and for all.

Change-Id: I0835515696c1a8ec7dff719fb734cbbd0b4252d6
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
b5eb550fb10ad7c54be489a89a08fc3fb10fbe53 11-Jan-2013 Craig Mautner <cmautner@google.com> Call assignLayersLocked when InputMethod is moved.

Call was removed by over-ambitious editing in CL 259410.

Fixes bug 7966824.

Change-Id: I9feb2ec27907f4e03b9424710adc2743a8b512d8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ef6550195f2f403e5ace27d49ae4f7f38d29cf4a 03-Jan-2013 Craig Mautner <cmautner@google.com> Release Session earlier, release Session later.

For finishDrawingWindow queue the performLayoutAndPlaceSurfaces call
and return immediately.

For setTransparentRegionHint call the WindowStateAnimator method
immediately, removing the previous queueing of it.

Fixes bug 7174665.

Change-Id: Ia52f9a6685842220e4ffca6e214ee366470ff666
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
73164dc7bce52f6658eb2f786c45538e52404ab4 08-Jan-2013 Craig Mautner <cmautner@google.com> Merge "Combine DimAnimator and DimSurface into DimLayer"
1420b93fa5606979fd67eaf80f50294d4f8c191b 29-Dec-2012 Craig Mautner <cmautner@google.com> Combine DimAnimator and DimSurface into DimLayer

Replace two classes that did similar things in a complicated manner
with one class that does it more simply.

Bug 7064755 fixed.

Change-Id: I8c415671f60d1d2ece9da5916421f4d24aed2d65
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
581068131c192a8c495fac00d3c61807580c7eca 28-Dec-2012 Craig Mautner <cmautner@google.com> Remove some TODOs.

Change-Id: I52f5a8a76593dde177c2e931f656b13134a3bd2b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
9a29a5d6790cda3f9eedd8231570d9b4f76c06cd 28-Dec-2012 Craig Mautner <cmautner@google.com> Convert three booleans into single state variable.

Make app transition states easier to understand.
Remove unnecessary dependence on ActivityOptions.

Change-Id: If3942133e919a4121340f8ef5ca1c50df22f370d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4b71aa1f8a1a3b7189fd29241ea7c594ce01623c 28-Dec-2012 Craig Mautner <cmautner@google.com> Move app transition constants

Move app transition constants from WindowManagerPolicy to
AppTransition.

Change-Id: I8ae6c4d0da1db826c44eb4ea0c6b85016b50b1a3
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
72669d18016446d874e4fa1005464e36375124e4 19-Dec-2012 Craig Mautner <cmautner@google.com> Fixes to clean up icon launching during animations.

Several problems were causing animations to jump to the end when
launching an app while a previous app was animating away.

- Keep the two app token lists in tighter synch. These were separated
when we hoped to completely separate layout form animation. This is
not as critical a goal any more.

- Use new test criteria for starting and stopping animations.

Bug 7885350 fixed.

Change-Id: Ib679117f627d0957cda17cc6ffca2bc2cdd6ecdd
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a2303750fb03839e9c7584a5f573f166465be214 20-Dec-2012 Craig Mautner <cmautner@google.com> Merge changes I1dfe21e5,Ia0218bf8

* changes:
Clean up warnings.
Minor refactorings.
0bf6ec9e377f9fafb67a36f7fb54d3f6676634fc 18-Dec-2012 Craig Mautner <cmautner@google.com> Clean up warnings.

Change-Id: I1dfe21e5f64364c90565b594e28074cabe7daa64
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
f8f147d167ed2a6cf5ba4b1b3a633401ecc5d384 18-Dec-2012 Jamie Gennis <jgennis@google.com> am 81e3c9ed: am d2a21d7f: Merge "Fade recents thumbnail to transparent earlier." into jb-mr1.1-dev

* commit '81e3c9ed66ce6968a331c4eafb969f66234d6e8a':
Fade recents thumbnail to transparent earlier.
3be73abc69eaef80c6d27169ca5f15e283a9debc 18-Dec-2012 Craig Mautner <cmautner@google.com> Fade recents thumbnail to transparent earlier.

Reduce the gpu load by fading the recents thumbnail to an alpha of
0.0 before the remaining animations are completed. When alpha hits
0 the gpu treats the layer as hidden and can merge the remaining
layers in time.

This is a partial fix for 7729214.

Change-Id: I9761bbd0554db6454c7eec0485be798b11672ff5
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
545252f4fde6fbb70b07e97a120c7d1405758017 11-Dec-2012 Svetoslav Ganov <svetoslavganov@google.com> Refactoring of the screen magnification feature.

1. This patch takes care of the case where a magnified window is covering an unmagnigied
one. One example is a dialog that covers the IME window.

bug:7634430

2. Ensuring that the UI automator tool can connect and correctly dump the screen.

bug:7694696

3. Removed the partial implementation for multi display magnification. It adds
unnecessary complexity since it cannot be implemented without support for
input from multiple screens. We will revisit when necessary.

4. Moved the magnified border window as a surface in the window manager.

5. Moved the mediator APIs on the window manager and the policy methods on the
WindowManagerPolicy.

6. Implemented batch event processing for the accessibility input filter.

Change-Id: I4ebf68b94fb07201e124794f69611ece388ec116
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
2268e7ee5c450c45121ebd5796221592c087ed73 14-Dec-2012 Craig Mautner <cmautner@google.com> Minor refactorings.

Change-Id: Ia0218bf86d142be80dd12d04de97da5d19293815
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ae44659f30ddaba67581fbdf9c9255ac982d45ab 07-Dec-2012 Craig Mautner <cmautner@google.com> Call adjustWallpaperWindowsLocked once per pass.

Also refactor a few methods and improve logging.

Change-Id: Ic54a1ff99f6de732b31cda5c06d36e8de01a269c
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
28db1975802374985f2cb8bf4aedc7f5a9e81a22 11-Dec-2012 Craig Mautner <cmautner@google.com> Merge "Share the pending layout changes"
74c9671855b436816e36d407b85d781c38095a50 11-Dec-2012 Craig Mautner <cmautner@google.com> Merge "Recouple layout and animation a bit."
ccc9e9b9365ee149c97589524b2abab2f381c6c8 11-Dec-2012 Craig Mautner <cmautner@google.com> Further refine test for window gone.

Do not treat a window that is animating as being onscreen until it
has been drawn. The indication that a window was "gone" was occurring
too soon resulting in windows appearing before the status bar came
back and having to be drawn twice, with and without the status bar.
By waiting for the window to be drawn the status bar appears and the
window does not have to get redrawn.

Bug 7696315 fixed.

Change-Id: Ic93bf6eed03cf12a92a656791725a6d26e0ad0e9
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
961ce2afbf82d4b2a9691f1c1cc75a97ce43fe2b 07-Dec-2012 Sascha Prueter <saschap@google.com> am 2588648b: am 203f69f0: Merge "Call setSize to sync Surface to SurfaceFlinger. DO NOT MERGE" into jb-mr1.1-dev

* commit '2588648b5268526bdc9ed7fb4e9eac36c8c693dc':
Call setSize to sync Surface to SurfaceFlinger. DO NOT MERGE
4abf3f987f1d7c1ca909c4b4008796e1a5851951 07-Dec-2012 Craig Mautner <cmautner@google.com> Call setSize to sync Surface to SurfaceFlinger. DO NOT MERGE

RecentsActivity screenshots are called for very quickly after
WindowStateAnimator prepareSurface(). Without enough delay the
Surface.setLayer call does not propagate to the SurfaceFlinger
and the screenshot is incorrect (black) because it stops sampling
the layers too early.

This fix calls Surface.setSize() for each sampled Surface in
screenshots. setSize forces the SurfaceFlinger to process all
transactions queued before returning from closeTransaction.

Bug 7552304 fixed.

Change-Id: I1911dfa0b09cab713c55f5ba0c612496337a77df

Conflicts:

services/java/com/android/server/wm/WindowManagerService.java
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
66f78d7a979775efb148873797bac4584ddb3b83 05-Dec-2012 Craig Mautner <cmautner@google.com> Share the pending layout changes

Do not pass the pending layout changes from animation to layout.
Simply assign them to the DisplayContent.

Change-Id: I72e48753db509023e5df70513a87e26998ec699f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
968683335e17c06504a11bc2e38a2580f613ea16 04-Dec-2012 Craig Mautner <cmautner@google.com> Recouple layout and animation a bit.

Share state between layout and animation and stop copying
redundant data between the two.

Change-Id: If07d3fc3ddfd33e3d46bf45d24d7aca58067ee66
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
9339c401cf1a056a3a1caddc648334069e6bd267 30-Nov-2012 Craig Mautner <cmautner@google.com> Further decouple layout and animation.

Load animation parameters dynamically and synchronously rather than
asynchronously. Eliminates storing parameters and cross-barrier method
calls.

Change-Id: Ia9162f0cb3fe60da35fd9fb5f24f31f88891b950
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
bebd1a092ea2fe35d78ba9dce7374f3f5ec30f2b 04-Dec-2012 Craig Mautner <cmautner@google.com> am d3b9dd6c: am 40627de3: Merge "Remove unnecessary references in WindowManagerService"

* commit 'd3b9dd6ca6325abe5cf2049c2894a86b256a3db1':
Remove unnecessary references in WindowManagerService
d3b9dd6ca6325abe5cf2049c2894a86b256a3db1 04-Dec-2012 Craig Mautner <cmautner@google.com> am 40627de3: Merge "Remove unnecessary references in WindowManagerService"

* commit '40627de3044c4a23c20c2229cab20aab21ff2b03':
Remove unnecessary references in WindowManagerService
cb6291c9b16d6c2ead8224e81636ff1d8ee5c216 04-Dec-2012 You Kim <you.kim72@gmail.com> Remove unnecessary references in WindowManagerService

Clean message routines in WindowManagerService.

Change-Id: I3e3106b6499c67d1fd7133c987c0452a73141a3f
Signed-off-by: You Kim <you.kim72@gmail.com>
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
f9ae5f75af259437391e41dac7f3c4461c495dd9 04-Dec-2012 Dianne Hackborn <hackbod@google.com> am 23307cbb: am e0a676a3: Merge "Fix issue #7649590: Background windows sometimes not being hidden for secondary users" into jb-mr1.1-dev

* commit '23307cbb6b432b658b0fd7437dacfedd6298af94':
Fix issue #7649590: Background windows sometimes not being hidden for secondary users
bb4ca5271a806c94a59d98c5c718db7b89728246 03-Dec-2012 Dianne Hackborn <hackbod@google.com> Fix issue #7649590: Background windows sometimes not being hidden for secondary users

There are two things going on here:

(1) In secondary users, some times theme information such as whether
the window is full screen opaque was not being retrieved, so the window
manager didn't know that it could hide the windows behind the app.
This would just be a performance problem, except that:

(2) There appear to be a number of applications that declare that they
are full screen opaque, when in fact they are not. Instead they are
using window surfaces with an alpha channel, and setting some pixels
in their window to a non-opaque alpha level. This will allow you to
see whatever is behind the app. If the system happens to completely
remove the windows behind the app, and somebody is filling the frame
buffer with black, then you will see what the app intends -- those
parts of its UI blended with black. If one of those cases doesn't
hold (and though we have never guaranteed they would, in practice this
is generally what happens), then you will see something else.

At any rate, if nothing else than for performance reasons, we need to
fix issue #1.

It turns out what is happening here is that the AttributeCache used
by the activity manager and window manager to retreive theme and other
information about applications has not yet been updated for multi-user.

One of the things we retrieve from this is the theme information telling
the window manager whether an application's window should be treated
as full screen opaque, allowing it to hide any windows behind it. In
the current implementation, the AttributeCache always retrieves this
information about the application as the primary user (user 0).

So, if you have an application that is installed on a secondary user but
not installed on the primary user, when the AttributeCache tries to retrieve
the requested information for it, then from the perspective of the primary user
it considers the application not installed, and is not able to retrieve that
info.

The change here makes AttributeCache multi-user aware, keeping all of its
data separately per-user, and requiring that callers now provide the user
they want to retrieve information for. Activity manager and window manager
are updated to be able to pass in the user when needed. This required some
fiddling of the window manager to have that information available -- in
particular it needs to be associated with the AppWindowToken.

Change-Id: I4b50b4b3a41bab9d4689e61f3584778e451343c8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
152e9bb81aa5b2ab4637f4b2dae04b3ce89fa891 13-Oct-2012 Svetoslav Ganov <svetoslavganov@google.com> Refactoring of the screen magnification feature.

1. The screen magnification feature was implemented entirely as a part of the accessibility
manager. To achieve that the window manager had to implement a bunch of hooks for an
external client to observe its internal state. This was problematic since it dilutes
the window manager interface and allows code that is deeply coupled with the window
manager to reside outside of it. Also the observer callbacks were IPCs which cannot
be called with the window manager's lock held. To avoid that the window manager had
to post messages requesting notification of interested parties which makes the code
consuming the callbacks to run asynchronously of the window manager. This causes timing
issues and adds unnecessary complexity.

Now the magnification logic is split in two halves. The first half that is responsible
to track the magnified portion of the screen and serve as a policy which windows can be
magnified and it is a part of the window manager. This part exposes higher level APIs
allowing interested parties with the right permissions to control the magnification
of a given display. The APIs also allow a client to be registered for callbacks on
interesting changes such as resize of the magnified region, etc. This part servers
as a mediator between magnification controllers and the window manager.

The second half is a controller that is responsible to drive the magnification
state based on touch interactions. It also presents a highlight when magnified to
suggest the magnified potion of the screen. The controller is responsible for auto
zooming out in case the user context changes - rotation, new actitivity. The controller
also auto pans if a dialog appears and it does not interesect the magnified frame.

bug:7410464

2. By design screen magnification and touch exploration work separately and together. If
magnification is enabled the user sees a larger version of the widgets and a sub section
of the screen content. Accessibility services use the introspection APIs to "see" what
is on the screen so they can speak it, navigate to the next item in response to a
gesture, etc. Hence, the information returned to accessibility services has to reflect
what a sighted user would see on the screen. Therefore, if the screen is magnified
we need to adjust the bounds and position of the infos describing views in a magnified
window such that the info bounds are equivalent to what the user sees.

To improve performance we keep accessibility node info caches in the client process.
However, when magnification state changes we have to clear these caches since the
bounds of the cached infos no longer reflect the screen content which just got smaller
or larger.

This patch propagates not only the window scale as before but also the X/Y pan and the
bounds of the magnified portion of the screen to the introspected app. This information
is used to adjust the bounds of the node infos coming from this window such that the
reported bounds are the same as the user sees not as the app thinks they are. Note that
if magnification is enabled we zoom the content and pan it along the X and Y axis. Also
recomputed is the isVisibleToUser property of the reported info since in a magnified
state the user sees a subset of the window content and the views not in the magnified
viewport should be reported as not visible to the user.

bug:7344059

Change-Id: I6f7832c7a6a65c5368b390eb1f1518d0c7afd7d2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
52a839de9e6afdc880664ae0f5af456b40a68c55 01-Dec-2012 Craig Mautner <cmautner@google.com> am 3351ab27: am f967500e: am 46732445: Merge "Include child windows when looking for insertion point." into jb-mr1.1-dev

* commit '3351ab27b9fc9eb2b21044ac68efebd1cfe85dfb':
Include child windows when looking for insertion point.
3351ab27b9fc9eb2b21044ac68efebd1cfe85dfb 01-Dec-2012 Craig Mautner <cmautner@google.com> am f967500e: am 46732445: Merge "Include child windows when looking for insertion point." into jb-mr1.1-dev

* commit 'f967500ebaefb95d7a1c14acd05574a0f17ec078':
Include child windows when looking for insertion point.
7b1aa77a9b25b4b1e8070c9cccfadcde39954952 01-Dec-2012 Craig Mautner <cmautner@google.com> Include child windows when looking for insertion point.

After finding a window in the window list we turn around and look in
the AppWindowToken.windows list for it. If it is a child of a window
in that list we should use the parent windows index as the search
result. Instead we gave up and ended up inserting the window at the
beginning of the windows list.

Bug 7357465 fixed.

Change-Id: If77f343b8597bfbb0b7fa41dedf7972d78d03020
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
d08fc869646f272b9fd49d66293dcea7d29d6c88 29-Nov-2012 Craig Mautner <cmautner@google.com> am 4317b341: am 24d966a3: Merge "Fix math errors causing black screen. DO NOT MERGE" into jb-mr1.1-dev

* commit '4317b3418b144c162634ec647df76a484ac35612':
Fix math errors causing black screen. DO NOT MERGE
8f0bdb5bb64044202c1090120f1193c4ff4a9fdf 29-Nov-2012 Craig Mautner <cmautner@google.com> Merge "Extract AppTransition from WindowManager"
24d966a3b6a0407076b333ec2e074160b2311cb2 29-Nov-2012 Craig Mautner <cmautner@google.com> Merge "Fix math errors causing black screen. DO NOT MERGE" into jb-mr1.1-dev
9dd9e0c99dcb2db98ffbcf9ad97e58fab8d38640 15-Nov-2012 Craig Mautner <cmautner@google.com> Fix math errors causing black screen. DO NOT MERGE

Turning off animations in the Developer options creates a ValueAnimator
duration scale of 0. This is used as the denominator in RampAnimator
which, if the numerator is also 0, sets mAnimatedValue to NaN. Rounding
NaN to the nearest int produces 0 which is then assigned to
mScreenBrightness in DisplayPowerState.

A copy mistake which assigned mTransitionAnimationScale as the default
value for mAnimatorDurationScale in WindowManagerService is also
fixed here.

Bug 7515609 fixed.

Change-Id: I39f8d0a7abdd5a1fe70d757fe95fbddaf7a0ed51
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
8c6008e7e84877afbda14a3fc6fce1c0872ff8f7 28-Nov-2012 Craig Mautner <cmautner@google.com> am ae336a08: am 067a7ac4: am 9e98927e: Merge "Retain configuration change info and sync access." into jb-mr1.1-dev

* commit 'ae336a08ddc402372e3ba16dfaf50cfb837cf74d':
Retain configuration change info and sync access.
ae336a08ddc402372e3ba16dfaf50cfb837cf74d 28-Nov-2012 Craig Mautner <cmautner@google.com> am 067a7ac4: am 9e98927e: Merge "Retain configuration change info and sync access." into jb-mr1.1-dev

* commit '067a7ac494c8a248840b9a7a46f22a0efff9e52f':
Retain configuration change info and sync access.
e8552142494bbb4438a8748707f74b1ce241ea48 07-Nov-2012 Craig Mautner <cmautner@google.com> Retain configuration change info and sync access.

- If a window was hidden while the configuration changed and then
changed back WindowManagerService would not know that the change
had ever happened and wouldn't notify the window of this. Most
windows wouldn't care but because Keyguard inflates layouts while
it is hidden...

Bug 7094175 fixed?
Bug 7501099 fixed!

Change-Id: If27f5f1d333602dac7719dd39dbdf3fe7954aa06
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
164d4bb4c3eeba1488d9b4994980d24c1f6ec961 26-Nov-2012 Craig Mautner <cmautner@google.com> Extract AppTransition from WindowManager

Refactor of WindowManagerService to move app transitions out.

Change-Id: Id3e377526a69f95a3ee4c0d97ca6fd84005beb6a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
625ac3086af4eb572f92b305a7d0c27724edde7e 26-Nov-2012 Craig Mautner <cmautner@google.com> Merge "Retain dimming while animating and obscured."
7636dfbc3331dec0cea374a9540a1f31fb7dbf77 17-Nov-2012 Craig Mautner <cmautner@google.com> Do not clear AppWindowToken.allDrawn while animating.

Creating new surfaces for applications clears the allDrawn flag in the
AppWindowToken. If the app windows were animating when this happened
the animation would complete immediately resulting in jank. This fix
defers clearing allDrawn until the animation completes.

Bug 7326635 fixed.

Change-Id: I5abe3b9ecfbefb476de6a6c8acc394373cc11751
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a7233fe31a8144f54eb041d12e631afdce25af4e 15-Nov-2012 Craig Mautner <cmautner@google.com> Fix math errors causing black screen.

Turning off animations in the Developer options creates a ValueAnimator
duration scale of 0. This is used as the denominator in RampAnimator
which, if the numerator is also 0, sets mAnimatedValue to NaN. Rounding
NaN to the nearest int produces 0 which is then assigned to
mScreenBrightness in DisplayPowerState.

A copy mistake which assigned mTransitionAnimationScale as the default
value for mAnimatorDurationScale in WindowManagerService is also
fixed here.

Bug 7515609 fixed.

Change-Id: I39f8d0a7abdd5a1fe70d757fe95fbddaf7a0ed51
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
312eac402c307592ee95575e4dd6f856f15525d9 13-Nov-2012 Craig Mautner <cmautner@google.com> Retain dimming while animating and obscured.

Fixes for two dimming problems.

- Dimming was turning off at the start of animation because it was
dependent on hiddenRequested which becomes true while the view is
still visible.

- Looking for windows with FLAG_DIM_BEHIND set stopped at the first
obscured window. But Z-order shuffling due to Animation.setZAdjustment
causes the window list order to be different than the display order.
Consequently windows that are being shown are declared obscured by
handleNotObscuredLocked().

Bug 7396404 fixed.

Change-Id: Ic59150964d3950e29b115da5f6c0f07a64190d44
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
55fdd58af8784a408d23af7882ed2d9e13324ace 09-Nov-2012 Dianne Hackborn <hackbod@google.com> am e0d454d2: am 72325cdb: am 63bc6c12: am a46a74fc: Merge "Remove extraneous logs." into jb-mr1-dev

* commit 'e0d454d2e86f4170bdab68d45696fb2eb9a87f9f':
Remove extraneous logs.
08bb2316f12743fb43d18af94248c5e8caecfa85 09-Nov-2012 Jim Miller <jaggies@google.com> am 061b4fae: am a2bf6181: am 2c29deaa: am 6be441c5: Merge "Add mechanism to kick keyguard to show the assistant" into jb-mr1-lockscreen-dev

* commit '061b4fae3daf40c90b46e16b12e7f22142eb498c':
Add mechanism to kick keyguard to show the assistant
e0d454d2e86f4170bdab68d45696fb2eb9a87f9f 09-Nov-2012 Dianne Hackborn <hackbod@google.com> am 72325cdb: am 63bc6c12: am a46a74fc: Merge "Remove extraneous logs." into jb-mr1-dev

* commit '72325cdb65a321df7755ba214efd9be42ce828d5':
Remove extraneous logs.
061b4fae3daf40c90b46e16b12e7f22142eb498c 09-Nov-2012 Jim Miller <jaggies@google.com> am a2bf6181: am 2c29deaa: am 6be441c5: Merge "Add mechanism to kick keyguard to show the assistant" into jb-mr1-lockscreen-dev

* commit 'a2bf6181dfca0f93461fc041f2bd2444551a4515':
Add mechanism to kick keyguard to show the assistant
d97b09b0f31152bd05ba69ca9249bcaf33d05e14 09-Nov-2012 Jim Miller <jaggies@google.com> am bef82757: am c7dc250d: am fe7e94a0: am 088fb915: Merge "Add isSafeModeEnabled() API to WindowManagerService" into jb-mr1-lockscreen-dev

* commit 'bef827572ce9644253ea42ab91b11b8107d2300f':
Add isSafeModeEnabled() API to WindowManagerService
bef827572ce9644253ea42ab91b11b8107d2300f 09-Nov-2012 Jim Miller <jaggies@google.com> am c7dc250d: am fe7e94a0: am 088fb915: Merge "Add isSafeModeEnabled() API to WindowManagerService" into jb-mr1-lockscreen-dev

* commit 'c7dc250d5a3dab93ff87e9986a71ae58ff124399':
Add isSafeModeEnabled() API to WindowManagerService
a46a74fcd61d2b4e72b6027625a471f10b21b1c9 08-Nov-2012 Dianne Hackborn <hackbod@google.com> Merge "Remove extraneous logs." into jb-mr1-dev
7ff30113de68539ec840c524b8f1561f938f96c5 08-Nov-2012 Dianne Hackborn <hackbod@google.com> Remove extraneous logs.

Change-Id: I4c47d36748de91bd6fddc419afbf59552bf63e9a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
7b172a49a90ea6784dbfe0002474f9d4fd4ace1a 07-Nov-2012 Kenny Root <kroot@google.com> am 58ed5d74: am 768d9e1a: Merge "Correct executable bit for source files"

* commit '58ed5d748c0b9b64845975ef5844ad313de7c3f6':
Correct executable bit for source files
58ed5d748c0b9b64845975ef5844ad313de7c3f6 07-Nov-2012 Kenny Root <kroot@google.com> am 768d9e1a: Merge "Correct executable bit for source files"

* commit '768d9e1a72ceee7d4a5f608776b87b62d6ce4a04':
Correct executable bit for source files
3a084af2e90849aaa8beb3a610189e3399c63ea0 07-Nov-2012 Kenny Root <kroot@google.com> Correct executable bit for source files

Many media files and source code files were marked as executable in Git.
Remove those.

Also a shell script and python script were not marked as executable.

Change-Id: Ieb51bafb46c895a21d2e83696f5a901ba752b2c5
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
f02296f599bc03353a76a2ead73d8975704bfd46 06-Nov-2012 Craig Mautner <cmautner@google.com> Layout windows that are about to animate.

Do not treat windows that are animating as "gone" for layout
purposes.

Bug 7453222 fixed.

Change-Id: I521a44127eafdfee18ff0cf858861d85efdcac93
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
bfec0a8616bc197ee3b7b71be6fed1939d0c3c4d 06-Nov-2012 Jim Miller <jaggies@google.com> Add isSafeModeEnabled() API to WindowManagerService

This adds a means of determining when the device is in safe mode,
as required by keyguard to disabled some features.

Change-Id: I31d357e6738c92e1837f9e0263e5f3f4de66315a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
98129739afcb3786a6ec9f3efe774d8e01f6d632 02-Nov-2012 Dianne Hackborn <hackbod@google.com> Fix issue #7343200: Fails to show wallpaper in the background for...

...lockscreen sometimes and remains black / blank

The problem was that we were using the animation-side wallpaper state
in cases where it was not updated yet.

The mWallpaperTarget variable is propagated over to the animation
side when the main window manager state updates. On the animation
side, this is used by hideWallpapersLocked() to determine if the
current wallpaper should be hidden.

The problem is that various paths to hideWallpapersLocked() can
come from the layout side of the window manager instead of the
animation side. This causes the problem here because in this case
the wallpaper state may not have yet been propagated to the
animation side, so it could incorrectly decide to hide the wallpaper
because it thinks there is not a target when in fact a target is
set in the layout side. This won't get fixed until some time way
later that the layout side decides that a new window is being shown
that may need to have the wallpaper shown.

The fix here is pretty gross, but as safe as possible -- the
hideWallpapersLocked() function now uses either the animation or
layout wallpaper state depending on where the call to it is coming
from.

Change-Id: I9250bfeae6e11c1761760bcc696fdb33fb5c8a5f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
529e744d3131b9ebeb6b33c8030230c29a44ad12 01-Nov-2012 Dianne Hackborn <hackbod@google.com> More debugging for issue #7343200 Fails to show wallpaper in the...

...background for lockscreen sometimes and remains black / blank

There was a bunch of state not being put into the dumpsys output.
In particular, the current wallpaper target of the WindowAnimator
was not being included. I think the problem is that these targets
are not being updated from the main window manager state at some
point where they need to be.

Change-Id: Ic795047f6aea9b6f72d5550bccc9f8d76c6ecb67
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
d5d11af3d3cefff6267d4e3a19e61a9b03cfbab5 31-Oct-2012 Chet Haase <chet@google.com> Fix for regression in WindowManager orientation changes

A fix yesterday for #7428221 caused a regression where new orientations would
sometimes cause a flash through black on the way to seeing the real static wallpaper.
There is a fundamental problem in WindowManagerService where we show a window before
it has all of the layout/sizing information it needs, which is the cause of the black
flash. The regression yesterday was that we are now less aggressive about layout out
hidden windows, so we won't layout the window until after the window is shown with the
incorrect sizing info.

The fix/workaround is to back off the layout logic specifically for the wallpaper,
ensuring that we will lay it out on orientation changes, even when hidden. This means that
when we finally do show it, it will already have been drawn in the correct orientation/size.

Issue #7444971 Home jank regression

Change-Id: Ib20fdabc43ece9720b261bf04b272c5511e2d902
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
27f752eb1d5c0f92fb38e7d6d0ea20b3b3b26a02 31-Oct-2012 Chet Haase <chet@google.com> Merge "WindowManager shouldn't layout non-visible windows" into jb-mr1-dev
9cceae9a5f4a2e8b5abc7dc9610dc7e40c7d283c 31-Oct-2012 Chet Haase <chet@google.com> WindowManager shouldn't layout non-visible windows

A recent change in WindowManager made background windows perform layout
(when they should really be left alone). This resulted in artifacts
where rotating the device and then going to a backgrojnd activity (launcher,
Recents) would briefly show that activity in the wrong size/orientation, then
flash to the correct one after a proper layout.

This fix is a simple workaround, leaving in the original fix that the code
change addressed (for keyguard orientation changes), while going back to the
previous (don't layout gone windows) for all other cases.

Issue #7428221 sometimes recents is drawn off-center and then fixes itself

Change-Id: I41b47933c2bd86f29133853d3387bb7294be8f48
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ef03a7f441cf0cbef5a5f7fafb58a7d5aea7ef52 30-Oct-2012 Dianne Hackborn <hackbod@google.com> Work on issue #7343200: Fails to show wallpaper in the background...

...for lockscreen sometimes and remains black / blank

Add some debug output to try to track down what is going on.

Change-Id: I98a96c5da9c04b988e948f6fc2766d927db49ebf
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
77119bc6c90a62beb2f83d9496d99199a7aefe14 23-Oct-2012 Dianne Hackborn <hackbod@google.com> Fix issue #7342364: JellyBean broke Toddler Lock, again

Change-Id: I400c02711edc302a1bc7fbf98b62fcb9f76e5e12
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
0ed07a0a30ef71053d0426956d3c198bb7540d4e 19-Oct-2012 Craig Mautner <cmautner@google.com> Merge "Allow getDisplayContentLocked to return null..." into jb-mr1-dev
738cfc91053fc888397ec2d139e0798f8c95b3ca 19-Oct-2012 Michael Jurka <mikejurka@google.com> Fixing wallpaper flash when going in/out of Recents

Bug: 7372516
Bug: 7216872

Change-Id: I2a2308a85caf9f2ad2d382c709e5f8867bd060be
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
2d5618c22101cfc4d6478cfe1d846798389540c1 18-Oct-2012 Craig Mautner <cmautner@google.com> Allow getDisplayContentLocked to return null...

... and check for null returns. This prevents DisplayContent objects
from containing null Display references.

Bug: 7368565 fixed.
Change-Id: I830fb4c1349204c366193657a95a92c48ccee66c
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
860f660a0f891b44a9f61558d75119184bafa9e3 18-Oct-2012 Craig Mautner <cmautner@google.com> When removing windows remove from resize list.

Windows remained in the resized list if they were removed during
rotations.

Bug: 7372289 fixed.
Change-Id: I41f949b7836b08b33d4d178e9aa016548328749a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
964629aca8d076826198a21b654ed858618b5619 16-Oct-2012 Svetoslav Ganov <svetoslavganov@google.com> Merge "Occasionally triple tap on the keyboard toggles screen magnification." into jb-mr1-dev
dc9e13b30ab26f8382b7e67dd681dee9b04bdb29 16-Oct-2012 Craig Mautner <cmautner@google.com> Merge "Perform all layouts within first loop." into jb-mr1-dev
a13a41dc0ed049319c3a6b51d1f35b0b1c20d81b 16-Oct-2012 Craig Mautner <cmautner@google.com> Perform all layouts within first loop.

Do not begin animation while layout requests are still
outstanding.

Bug: 7333622 fixed.
Change-Id: I77c2cdc123c1e26f9661feade0d9a1843c75d5f6
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
55468c64bc4f3c4b16bf144f66907d75bb656b0a 16-Oct-2012 Svetoslav Ganov <svetoslavganov@google.com> Occasionally triple tap on the keyboard toggles screen magnification.

1. Sometimes unlocking the device when the IME is up and triple tapping on the keyboard
toggles screen magnification. The core reason is that when the kayguard window is
shown we hide all other windows and when it is hidden we show these windows. We did
not notify the screen magnifier for windows being shown and hidden. Also when the
windows are shown we may reassign layers to put the IME or the wallpaper in the
right Z order. The screen magnifier is now notified upon such layer reassignment
since window layers are used when computing the magnified region.

bug:7351531

Change-Id: I0931f4ba6cfa565d8eb1e3c432268ba1818feea6
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a4942c9fb9cc224bcb1a0a53dcacd13848819951 16-Oct-2012 Craig Mautner <cmautner@google.com> Revert app freeze timeout delay.

Speed up of wallpaper loading on Manta means this workaround is no
longer necessary.

Bug 7354440 fixed.

Change-Id: Ic0ad3c689abb5342fb29c824857db9d5c2d45008
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
a987d43bc916b6446fe41037d9fcf07e778b3452 11-Oct-2012 Craig Mautner <cmautner@google.com> Check for apps closing and restore mExiting test.

Removal of the mExiting test in a previous CL was a mistake leading
to z-order errors. In particular the auto complete dialog was on top
of the IME and was being dismissed due to touches on the IME.

Restoring mExiting alone missed cases where apps were exiting which
don't set mExiting. Adding a test for membership in mClosingApps
fixes that.

Bug: 7327220 fixed.
Change-Id: I3965b8a07080d1347bdada51ffeafe6ef2e32c8e
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
0a75ed0805dd7f97ff058623eb8e4f4b258c44ab 11-Oct-2012 Craig Mautner <cmautner@google.com> Merge "Revert "Remove debugging statements before final ROM."" into jb-mr1-dev
c1940167109098b5748cde025e49575c6515e490 11-Oct-2012 Chris Craik <ccraik@google.com> Merge "Use the original caller pid for computing visibility" into jb-mr1-dev
3198ef3f971384cfb92f7d18b0fc8dae222bd58f 10-Oct-2012 Chris Craik <ccraik@google.com> Use the original caller pid for computing visibility

bug:7325771

Make Strict mode violations flicker the screen for visible app correctly.

Change-Id: I293dc9e945cb0366a1cd7b63a5b746159aab7c74
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
64ecc0e1015f1c6c1f949bb74ba3f0875178c737 10-Oct-2012 Craig Mautner <cmautner@google.com> Revert "Remove debugging statements before final ROM."

The bug cropped up again. Need these statements to pin it down.

This reverts commit f1f3b49b949af72692f7f85a1c1ef220e8630e30

Change-Id: Ie0548232daff32ee2541249b0950e23bd98c08d2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
fa5bc081593891959c143e0de9e59dd076a47b42 10-Oct-2012 Craig Mautner <cmautner@google.com> Merge "Increase window freeze timeout for bigger screens." into jb-mr1-dev
7dfcb018206abebc45e478ef01465a50532f0f4e 10-Oct-2012 Craig Mautner <cmautner@google.com> Increase window freeze timeout for bigger screens.

More pixels take longer. Timeout was occurring before Status and
Navigation Bars were finished drawing causing them to animate in
during rotations.

Bug 7307718 fixed.

Change-Id: Iccf27b6172d0c9831690cc2fcf93027a40b705d8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
f1f3b49b949af72692f7f85a1c1ef220e8630e30 09-Oct-2012 Craig Mautner <cmautner@google.com> Remove debugging statements before final ROM.

Change-Id: I18afd1a4c4f8f945308edc9b3af48b8c8adb3b9e
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e6f7d5054a71eeae8c0b10a2305347efdcd8c3d3 08-Oct-2012 Craig Mautner <cmautner@google.com> Fix problems with IME layers.

The query WindowState.isDisplayed did not take into account being
displayed due to app animations.

When an existing input method target was animating away the logic
for detecting if it was still on screen was faulty. This led to
assigning the input method to a layer below its target and obscuring
the input method until the animation was complete.

Bug: 7296703 fixed.
Change-Id: Ib00db4f21b726ed57d25d6a1e796b65a7d45ee97
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
138f272bfcd45f233abfd94faf4aabaa5d01b90b 07-Oct-2012 Craig Mautner <cmautner@google.com> Merge "Save resized windows even if freezing." into jb-mr1-dev
33877e15b8bfc50bd874027689a4794aa93b923d 07-Oct-2012 Craig Mautner <cmautner@google.com> Merge "Adds showWhenLocked attribute to Activities." into jb-mr1-dev
ade0a9a9386a2cd6f11ad3cde257c11fe300d785 06-Oct-2012 Craig Mautner <cmautner@google.com> Save resized windows even if freezing.

During app freezes resized windows were being dropped if the freeze
window timed out. This fix adds windows to the list of resized
windows but does not notify the clients of the resize until freezing
is completed.

Bug: 7094175 fixed.
Change-Id: Iee1f5f532a0e661fbf900e4540146ae4b645d68e
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5962b12bedc4a1d0354816c1cd6b06ba04f6d807 05-Oct-2012 Craig Mautner <cmautner@google.com> Adds showWhenLocked attribute to Activities.

The new attribute allows an Activity such as the alarm to appear
on all users screens.

Bug: 7213805 fixed.
Change-Id: If7866b13d88c04af07debc69e0e875d0adc6050a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
c38c9be031ddad5cf551b55458889f11e01dc5b2 04-Oct-2012 Jeff Brown <jeffbrown@google.com> Coordinate screen on with the window manager.

Bug: 7267457
Change-Id: Ic2c322253639e1f0b2e4e72a7b145025d0240f93
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
3e2358a0e677ad1c88d677919aa9b8d7b2fb4eb2 03-Oct-2012 Craig Mautner <cmautner@google.com> Merge "Delay setting hidden until after isVisibleNow test." into jb-mr1-dev
4b5aa78c898a827c3cd65f578d31d3809b61aad6 03-Oct-2012 Craig Mautner <cmautner@google.com> Delay setting hidden until after isVisibleNow test.

Setting hidden prior to test guarantees the test will fail. This
then causes the exit animation to not be loaded and consequently
the window is immediately hidden. Then, when the window is removed
later it reappears in order to animate away. The consequent flash
is undesirable.

Bug: 7242373 fixed.
Change-Id: I56966bd9060124be372702090f86b29b4deea8c0
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
cb882f90e4305bd40d7219707bc1796319e9c80e 03-Oct-2012 Jeff Brown <jeffbrown@google.com> Fix bug removing all windows that belong to a display.

Removing one window causes its subwindows to also be removed.
We have to be careful when traversing the window list
because multiple windows may be removed at a time so we
don't get IndexOutOfBoundsException due to the window
list changing in unexpected ways.

Bug: 7273702
Change-Id: I0ed9ba00c325ad178ab28919ce2e763cb6fd38ba
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
6e2bee75cea415621165698fdd9ce857bbb8872e 01-Oct-2012 Jeff Sharkey <jsharkey@android.com> Migrate more System and Secure settings to Global.

Includes telephony, WindowManager, PackageManager, and debugging
settings. Update API to point towards moved values.

Bug: 7231764, 7231252, 7231156
Change-Id: I5828747205708872f19f83a5bc821ed0a801cb79
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
1e3b98d47df596d0c4eadbdf60143709f8465b28 01-Oct-2012 Jeff Brown <jeffbrown@google.com> New internal API to eliminate poke locks.

Added a new WindowManager.LayoutParams inputFeatures flag
to disable automatic user activity behavior when an input
event is sent to a window.

Added a new WindowManager.LayoutParams field userActivityTimeout.

Bug: 7165399
Change-Id: I204eafa37ef26aacc2c52a1ba1ecce1eebb0e0d9
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
65d11b3eeff395011a2c6b56eb117fd3c4881c1a 01-Oct-2012 Craig Mautner <cmautner@google.com> Only inform DisplayManager of visible content.

WindowManager was notifying DisplayManager of content if any window
existed on a display. Now the window must be visible and we must not
be showing a Dream or the Keyguard.

Bug: 7214060.
Change-Id: I9ce4a49aabfbac22ff1e39a837199ce35b9f7503
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
fe37f8f51d90fc4c6230e54dcd1270df5fcc6be3 30-Sep-2012 Dianne Hackborn <hackbod@google.com> Work on issue #6949468: android.dpi.cts.ConfigurationScreenLayoutTest...

...#testScreenLayout failures on JO

This doesn't actually fix it; I have concluded that the test is broken
(the platform is correctly reporting that this is a NOT LONG device
because in portrait once you account for the status bar and system
bar our size is 880dp high and 600dp wide, which is not enough for us
to be in the LONG config).

However while working on this I noticed that the code for computing
the configuration of the external display was wrong. I have fixed
that by putting this code for computing these parts of the configuration
in a common place that both the window manager and external display
code can use.

Change-Id: Ic6a84b955e9ec345a87f725203a29e4712dac0ad
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c36c49ee83123d6083c05a3e333ac43a13f664cd 30-Sep-2012 Craig Mautner <cmautner@google.com> Changing debug for b/7094175.

Fixes bug 7094175 (but not really).

Change-Id: Ice2abb93f479ea0bda931e9643710668c25aa285
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
3dc0b80dc6e6aa156eea4d737cdeaad96aa1125a 28-Sep-2012 Craig Mautner <cmautner@google.com> Merge "Fix layout state issues." into jb-mr1-dev
812d2ca475e88d4e52870a4eeeb096a411f0f077 28-Sep-2012 Craig Mautner <cmautner@google.com> Fix layout state issues.

- Restore test of hidden to isGoneForLayoutLw(), without that
we return false when setAppVisibility(true) is called which leads
to early layout of windows. Particulary on return from full screen
to non-full we lay out once before recognizing that the status bar
should be back and then again once the status bar appears causing
a jump. Fixes bug 6470541.

- Add a new test for configuration size changes to gone or hidden
windows. This forces a layout call to these windows which informs
them of the new size even though they are not shown until later.
In particular this keeps windows that were in the background
during a rotation from using their old boundaries on return.
Fixes bug 6615859.

- Consolidate WindowState.mConfiguration tests into WindowState.

Change-Id: I7a82ce747a3fcf7d74104dc23f1532efe64bd767
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
2033763bb18913773eea3ac82bf9dbb053444ac6 24-Sep-2012 Jeff Brown <jeffbrown@google.com> Allow a window on a secondary display to have focus.

If any window on the default display has focus, then it
gets focus as usual. If no window on the default display
has focus, then we consider windows on the secondary display.

In the future we will need more elaborate schemes for
managing focus across multiple displays, but this is enough
for testing purposes now.

Bug: 7183618
Change-Id: I21ddb9904eb9e574e42d28743aeca51f4ffebf64
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a9d131c30878cacdaeacb4f43a82a7cc5b872453 21-Sep-2012 Jeff Brown <jeffbrown@google.com> Disentangle input manager service startup.

We will be adding additional callbacks for other components.
This change makes it clearer how the input manager is started
and where the callbacks are initialized.

Bug: 6548391
Change-Id: I4b2a61482126a12b7cf11fafe513f846c76c11e5
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
6704a48bd06f01d2933f83e9b5eda4ed9846bab7 19-Sep-2012 Craig Mautner <cmautner@google.com> Merge "Fixes to Starting window and Wallpaper windows." into jb-mr1-dev
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/services/java/com/android/server/wm/WindowManagerService.java
8863cca57d8c901a2da0edc422b653ae68849313 19-Sep-2012 Craig Mautner <cmautner@google.com> Fixes to Starting window and Wallpaper windows.

- Checking for found wallpaper to match either mWallpaperTarget
or mLowerWallpaperTarget keeps from swapping the layers while
transitioning between two wallpaper activities.

- Fade out RecentsActivity while bringing up selected activity. This
keeps the RecentsActivity from showing through a launching wallpaper
activity.

- When moving a starting window from one activity to another clear
the startingDisplayed flag in the old activity.

- When moving a starting window from one activity to another assign
the new activity's mAppAnimator to the starting window's mWinAnimator.

- Only treat a wallpaper transition as entering if the mWallpaperTarget
is visible and not being hidden. Keeps from assigning the wrong
animation when activities are launched back to back and the
mWallpaperTarget is still animating away.

Fixes bug 7148089.

Change-Id: Idd405b1ba113f3345ca2116d141b474abe5bd4c0
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a91f9e2959ee905f97977a88fe45bde6ffb874b0 15-Sep-2012 Craig Mautner <cmautner@google.com> Make more items per-Display.

Moving DimSurfaces, DimBackgrounds and Rotation surfaces into
per-display class.

Fixes bug 7167028.

Change-Id: I7408b3a27b5a7a8d0d59e9d6109c002fc627e536
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5dc5a00e7ebadc085ded7e29feacd17e53698486 16-Sep-2012 Dianne Hackborn <hackbod@google.com> More multi-user stuff.

- New public APIs to find out when a user goes to the foreground,
background, and is first initializing.
- New activity manager callback to be involved in the user switch
process, allowing other services to let it know when it is safe
to stop freezing the screen.
- Wallpaper service now implements this to handle its user switch,
telling the activity manager when it is done. (Currently this is
only handling the old wallpaper going away, we need a little more
work to correctly wait for the new wallpaper to get added.)
- Lock screen now implements the callback to do its user switch. It
also now locks itself when this happens, instead of relying on
some other entity making sure it is locked.
- Pre-boot broadcasts now go to all users.
- WallpaperManager now has an API to find out if a named wallpaper is
in use by any users.

Change-Id: I27877aef1d82126c0a1428c3d1861619ee5f8653
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
3a1136eeeb6c2b30b0528e30c41ce36bda35c531 14-Sep-2012 Jeff Brown <jeffbrown@google.com> Merge "We don't need black frames for forced display size." into jb-mr1-dev
dc5a6384e7a82ac732c483e32b7acce6dfa443a8 14-Sep-2012 Craig Mautner <cmautner@google.com> Improve debug output.

Change-Id: I94f46e1e373dc9e67bfbc1d1847399c119ec2fcb
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
76a3cb9773d01079de447c16741f628d19108087 14-Sep-2012 Jeff Brown <jeffbrown@google.com> We don't need black frames for forced display size.

Now that surface flinger lets us set a display projection,
the window manager no longer needs to place a black frame
around the content when simulating a different display size.

Bug: 7139798
Change-Id: I6014390f47444633d434ccf918cee5ff7b502869
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4be297545362e547c2168c5d031be9b335101957 13-Sep-2012 Craig Mautner <cmautner@google.com> Merge "Rename variables and methods for clarity." into jb-mr1-dev
5c0e78c445ed4b12fec295f1c7f0799d1e79bf72 13-Sep-2012 Craig Mautner <cmautner@google.com> Rename variables and methods for clarity.

Change-Id: I2a1b2f2d5605123e55f264d45b1e7292852f2a7f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
0bb4d078afeadf4996240d0ac41514c28e5f795a 12-Sep-2012 Svetoslav Ganov <svetoslavganov@google.com> Merge "Screen magnifier should handle window rebuilds correctly." into jb-mr1-dev
9b4125e435b6bc8f8bd2f6e569d9b0b296ab16ef 12-Sep-2012 Svetoslav Ganov <svetoslavganov@google.com> Screen magnifier should handle window rebuilds correctly.

1. The way for computing the magnified region was simplistic and
incorrect. It was ignoring window layering resulting in broken
behavior. For example, if the IME is up, then the everything else
is magnifed and the IME not. Now the keyguard appears and covers
the IME but the magnified region does not expand while it would
since the keyguard completely covers the not magnified IME window.

bug:7138937

Change-Id: I21414635aefab700ce75d40f3e913c1472cba202
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
9ba2a188919e6e5bf8c042b26527fc090de677ef 11-Sep-2012 Jeff Brown <jeffbrown@google.com> Merge changes I4ad08873,If0562677,I5fe6ba32 into jb-mr1-dev

* changes:
Don't auto-discover peers until scan requested.
Use wfdInfo to filter available sinks.
Allow adb shell am display-size to use bigger sizes.
9d9ece3c1e16001b63244459cdf4b428f4272d2e 11-Sep-2012 Dianne Hackborn <hackbod@google.com> Animations for user switching.

The window manager now has a facility to provide a full-screen
animation, which the activity manager uses every time a user
switch happens.

The current animation is just a simple dumb slide until we get
a design from UX.

Also some cleanup: moved the portrait task animations to the
default config so we always have an animation for them, and finally
got the java symbol stuff out of public.xml.

Change-Id: I726f77422b2ef5f2d98f961f8da003e045f0ebe8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
43aa15912891930833edfc101615a9c881de54a1 11-Sep-2012 Jeff Brown <jeffbrown@google.com> Allow adb shell am display-size to use bigger sizes.

We now support scaling the logical display to fit the
physical display, whatever size it is. So we can allow
adb shell am display-size to use more or less arbitrary sizes
although we do enforce an upper and lower bound to
protect the user.

Change-Id: I5fe6ba32ad1f9e4fbcd6915f7d36850b987bbcc0
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e215f26f74744535bcc0209f2a0a0e4a9f36fd82 11-Sep-2012 Jeff Brown <jeffbrown@google.com> Fix adb am display-size.

There were several problems resulting from the use of
mDefaultDisplay before displayReady() was called.
As it happens, we don't need mDefaultDisplay becase we
can get the information from the default display content.

Also modified the Configuration calculations to never
choose a SQUARE orientation. The constant is deprecated
and documented as no longer used, so we should make that
be the case.

Change-Id: I326ed7100030a81e24411e898e5243f28895ea22
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
83d616a9c7b9505153d258511eb5c16b552e268d 10-Sep-2012 Jeff Brown <jeffbrown@google.com> Make input system aware of multiple displays.

The input system needs to know about the window that has
focus, even if it is on a secondary display. So now we
send it the list of all windows and indicate which display
they are on. We filter the list of windows as necessary
when delivering touch events.

To keep things simple, monitor input channels and input
filters are not supported except on the main display.
We also do not pass the display id to applications; it is
only used inside the input system for now.

Properly scale touch coordinates based on the viewport.
This will be needed to ensure that touch works on external
display as well as when the internal display is being used
to simulate a different resolution.

Change-Id: I1815579a52fcc852c519b5391fc7ab8767c2dc59
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
d728bf514f257670fcb9aa22c6eaf97626072c93 09-Sep-2012 Jeff Brown <jeffbrown@google.com> Make display manager tell input system about viewports.

The window manager is no longer responsible for telling the
input system about the display viewport.

Change-Id: I932882bae55decef55f25093bb2a7ebac1620bb1
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
72018294cc4e3cc5feb7affdec4bf4bb2368ac41 08-Sep-2012 Jeff Brown <jeffbrown@google.com> Merge "Make mirroring automatic based on Windows on display." into jb-mr1-dev
efb735dbafd131cd1e8f4af40274c16443e39078 08-Sep-2012 Craig Mautner <cmautner@google.com> Fix incorrect indexing calculation.

Fixes bug 7129583.

Change-Id: Ia395a7acded05686668d5b3cee09d49025a9f339
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
722285e199a9fc74b9b3343b7505c00666848c88 07-Sep-2012 Craig Mautner <cmautner@google.com> Make mirroring automatic based on Windows on display.

Tell the display manager whenever a given logical display
contains interesting windows. If so, then the display
manager arranges to show that content on a physical display,
otherwise it ignores the logical display and makes its
associated primary physical display mirror the default
display.

Assign DisplayContents when Displays are added, remove them when
Displays are removed, and update the DisplayInfo when Displays
change.

Change-Id: I36e08ec538055acabe1e24cdd12c40de4e47a158
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
7950d081ac945d97427264f2a0531607097c2c71 05-Sep-2012 Craig Mautner <cmautner@google.com> Merge "Make mLayoutNeeded per-Display." into jb-mr1-dev
19d59bc5ad877e9b1544ab13a08282b7b384fefb 04-Sep-2012 Craig Mautner <cmautner@google.com> Make mLayoutNeeded per-Display.

Switch from a global mLayoutNeeded to one for each Display so that
we don't run layout on Displays that haven't changed.

Change-Id: Ib65c5c667933cceacc46b94f4e6e6bd613d5cb35
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
035ce2ca92742894f7f906c93d7d217c647aa19a 05-Sep-2012 Fabrice Di Meglio <fdimeglio@google.com> Merge "Add support for "-rtl" in resources" into jb-mr1-dev
76a7165719dc3ccce902953f6244e2c2668aa753 04-Sep-2012 Craig Mautner <cmautner@google.com> Change layout inner loop order for multi display.

The inner loop that ran over each display had a few problems:
- The Surface transaction was starting and stopping between each
display.
- The layout change bits were being applied globally so all
displays were layed out when only individual displays needed to be.
- Wallpaper and input actions were being applied each time through
the display loop rather than once only for the default display.

Change-Id: I924252bab28c426222a4bb73693accc4b21cecbe
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
4ed8fe75e1dde1a2b9576f3862aecc5a572c56b5 31-Aug-2012 Jeff Brown <jeffbrown@google.com> More improvements to the display manager.

Added more complete support for logical displays with
support for mirroring, rotation and scaling.

Improved the overlay display adapter's touch interactions.

A big change here is that the display manager no longer relies
on a single-threaded model to maintain its synchronization
invariants. Unfortunately we had to change this so as to play
nice with the fact that the window manager wants to own
the surface flinger transaction around display and surface
manipulations. As a result, the display manager has to be able
to update displays from the context of any thread.

It would be nice to make this process more cooperative.
There are already several components competing to perform
surface flinger transactions including the window manager,
display manager, electron beam, overlay display window,
and mouse pointer. They are not manipulating the same surfaces
but they can collide with one another when they make global
changes to the displays.

Change-Id: I04f448594241f2004f6f3d1a81ccd12c566bf296
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
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/services/java/com/android/server/wm/WindowManagerService.java
64a55af0ac700baecb0877235eb42caac59a3560 26-Aug-2012 Jeff Brown <jeffbrown@google.com> Add plumbing for new surface flinger display API.

Cleaned up the implementation of Surface and SurfaceSession
to use more consistent naming and structure.

Added JNI for all of the new surface flinger display API calls.

Enforced the requirement that all Surfaces created by
the window manager be named.

Updated the display manager service to use the new methods.

Change-Id: I2a658f1bfd0437e1c6f9d22df8d4ffcce7284ca2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5f7979993979466c79ab4f38d83c6f2aca361662 16-Jun-2012 Fabrice Di Meglio <fdimeglio@google.com> Add support for "-rtl" in resources

- fix bug #7035019 Need to have "-rtl" support for Resource

Change-Id: Ic82145c2ac672729d8a6c695a5f343276a1a0a2c
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5642a48fbba84cc0b646aea1b9f407f046b70be9 23-Aug-2012 Craig Mautner <cmautner@google.com> Fix unprotected variable access by serializing.

The variables mKeyguardDisabled and mAllowDisableKeyguard were
being modified unprotected by mKeyguardTokenWatcher. Fix is to
serialize accesses to these variables by only referencing them
from the same Handler that mKeyguardTokenWatcher uses. Eliminates
synchronization blocks and mKeyguardDisabled variable.

Fixes bug 7045624.

Change-Id: I6355aa393507408296316bee61e178dc81e2a172
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
6715d1effaa70abf261112d2771d4d555cc109c2 23-Aug-2012 Craig Mautner <cmautner@google.com> Merge "Clean up displayId and layerStack usage." into jb-mr1-dev
b47bbc3d80badb94229bc4ce7a2d5006faa9ef15 23-Aug-2012 Craig Mautner <cmautner@google.com> Clean up displayId and layerStack usage.

Make better use of Display object by saving it in DisplayContent.
Only use layerStack when referring to Surfaces. Get displayId from
default Display or default DisplayContent. Remove warnings.

Fixes bug 7038151.

Change-Id: Ie493f0f5e755dc9b91ee969ff561c2a098283ead
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
259328c04ce16c554b48a14f68d8af94dc54d7ec 22-Aug-2012 Craig Mautner <cmautner@google.com> Eliminate special battery calls by WindowManager

Previous to this change the WindowManager was notifying the
BatteryDtatsService about windows that keep the screen on. WM used a
custom WakeLock tag to indicate to PowerManagerService that it had
already notified the BatteryStatsService.

This change eliminates WindowManager notifying the BatteryStatsService
and lets PowerManagerService do the job.

Fixes bug 7030326.

Change-Id: I666dc6ef8f094b8d3d109fea6876be058e057b4f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
de1d96c736730c2a99a225311b9211a34042f9d4 21-Aug-2012 Craig Mautner <cmautner@google.com> Merge "Hide non user app windows from other users." into jb-mr1-dev
4b72463d7cb807912ca359f3b5a160f59d985c1d 21-Aug-2012 Jeff Brown <jeffbrown@google.com> Merge "Add factory test feature to shut off on long press power." into jb-mr1-dev
9dc52bc44c94854fcd3384a045b4b862e30e25de 06-Aug-2012 Craig Mautner <cmautner@google.com> Hide non user app windows from other users.

When transitioning between old user and new user application windows
from the old user may not be shown because only one user's windows
can be shown at a time.

Change-Id: I4e17b36c9100c9457cc6eb3cb3b77f3a94fa2b41
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
ec42c3c35fd4c16e1823cfd0e5b589ed2d205aa7 20-Aug-2012 Craig Mautner <cmautner@google.com> Merge "Ensure that mAllAppWinAnimators is not null." into jb-mr1-dev
bea12bdc2e6d2b1158c1faa58a8197d5e971a817 20-Aug-2012 Craig Mautner <cmautner@google.com> Ensure that mAllAppWinAnimators is not null.

The method showAllWindowsLocked can be called from the layout
side of the WindowManagerService. Previously the AppWindowAnimator
member mAllAppWinAnimators was created on the animation side. If
showAllWindowsLocked was called before the first animation of the
activity an NPE would occur. This fix creates mAllAppWinAnimators
when the AppWindowAnimator is created and also updates it with
current values before calling showAllWindowsLocked.

Fixes bug 6917136.

Change-Id: If3ace22022b65c6888bbb9d0575efe9a45d86475
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
d2ae85d41ec1651dd1bf4c33fe31833ba5c5cff5 17-Aug-2012 Michael Jurka <mikejurka@google.com> Merge "Adding a thumbnail scale down animation" into jb-mr1-dev
832cb229cd748505c90f74ae8154fc3557d61a73 13-Apr-2012 Michael Jurka <mikejurka@google.com> Adding a thumbnail scale down animation

Recents animation will temporarily look a bit
wrong, but a subsequent change will fix this.
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a1a1a1d6caddc25c4e249e5b5030d6a3ed861dd9 16-Aug-2012 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #6955586: No navigation bar in landscape on tablets" into jb-mr1-dev
5a052a4d19556700a21286029f37e1cc37f217b1 16-Aug-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6955586: No navigation bar in landscape on tablets

The window manager was telling the activity manager to evaluate
the new configuration when first initializing the display, before
actually setting mDisplay, so it failed creating that first config.

Change-Id: I6e94fcf55b0587ccf15a5fd7ecbe2c9a0c201b96
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
ff7e6ef4f18ff94a9836492ff3ccd1ba7f6804f3 15-Aug-2012 Jeff Brown <jeffbrown@google.com> Apply ValueAnimator scale factor immediately in WM.

Normally the ValueAnimator scale factor is applied the first
time a ViewRootImpl window session is created but that may
be too late for animators created by system services that
start early in the boot process. So set the scale factor
immediately whenever the setting changes.

Also make ValueAnimator.getDurationScale() accessible (but @hide)
for custom animators that want to apply the same scale to
their animations.

Change-Id: I0f5a750ab5b014f63848445435d8dca86f2a7ada
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
758143ecfedbe08cc6c4fed0ad8ad7a854194ca4 07-Aug-2012 Svetoslav Ganov <svetoslavganov@google.com> Window position not reported if the window is not moved.

1.If a window is shown but never moved the window window
is never notified for its current location. Therefore,
accessibility nodes do not contain correct bounds in
screen coordinates.

bug:6926295

Change-Id: I7df18b095d33ecafffced75aba9e4f4693b0c393
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
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/services/java/com/android/server/wm/WindowManagerService.java
4f67ba6ba4e861b287a3ff0323c107aa77f66264 02-Aug-2012 Craig Mautner <cmautner@google.com> Refactor DisplayManagerService to be functional.

Change-Id: Ieac1eca172be5dc5db45302d3afa26188acd4d6d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
437a0fbd57662e1d9d260da6f62ff83da2769a7e 02-Aug-2012 Craig Mautner <cmautner@google.com> Merge "Introduce multiple displays with DisplayContent." into jb-mr1-dev
59c009776dae5ccbdfb93d7151ff2065ca049dc3 30-Jul-2012 Craig Mautner <cmautner@google.com> Introduce multiple displays with DisplayContent.

Fix a couple of bugs that turned up.
Remove touch/focus from display. Add iterators for access.
Respond to comments. Remove TODOs, and some deviceId parameters.

Change-Id: Idcdb4f1979aa7b14634d450fd0333d6eff26994d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
b696de5c10ebcc7bf42d8487fc0e56e0e937754d 28-Jul-2012 Jeff Brown <jeffbrown@google.com> Move and rename user activity event type constants.

Change-Id: Ie565808796773b6896e71ddfac6aaaf8031de846
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
6881a10557acf3b0270de54799d6f19437acf584 27-Jul-2012 Craig Mautner <cmautner@google.com> Small step towards supporting multiple displays

Change-Id: I353449c2b464394988c7e0203656b5851a0c9127
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
fa25bf5382467b1018bd9af7f1cb30a23d7d59f7 24-Jul-2012 Jeff Brown <jeffbrown@google.com> Add display manager skeleton.

The purpose of this change is to remove direct reliance on
SurfaceFlinger for describing the size and characteristics of
displays.

This patch also starts to make a distinction between logical displays
and physical display devices. Currently, the window manager owns
the concept of a logical display whereas the new display
manager owns the concept of a physical display device.

Change-Id: I7e0761f83f033be6c06fd1041280c21500bcabc0
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
aac0d4ed026d1cfbcf3fa81c6e4eb96f4347ca17 20-Jul-2012 Fabrice Di Meglio <fdimeglio@google.com> Replace left/right with start/end for Gravity / LayoutParams / Padding

- see bug #5429822 UI should be mirrored for RTL locales (Arabic, Hebrew, farsi)

Change-Id: Id9af5375fb9b0edeae5232c77e52ecd497bd2e67
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
f422a5669457c152e36e889c820d64b37e005167 17-Jul-2012 Jeff Brown <jeffbrown@google.com> Merge "Remove freezeDisplay(), which is no-op."
55e395ab33f24b009d87a4d45a5566394260fff7 16-Jul-2012 Jeff Brown <jeffbrown@google.com> Remove freezeDisplay(), which is no-op.

Change-Id: I981ee49e6e2d41a09feaee4b384392e83f7faf3d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c9c9a48e7bafae63cb35a9aa69255e80aba83988 16-Jul-2012 Svetoslav Ganov <svetoslavganov@google.com> Removing a workaround for incorrect window position on window move.

1. The window manager was not notifying a window when the latter
has been moved. This was causing incorrect coordinates of the
nodes reported to accessibility services. To workaround that
we have carried the correct window location when making a
call from the accessibility layer into a window. Now the
window manager notifies the window when it is moved and the
workaround is no longer needed. This change takes it out.

2. The left and right in the attach info were not updated properly
after a report that the window has moved.

3. The accessibility manager service was calling directly methods
on the window manager service without going through the interface
of the latter. This leads to unnecessary coupling and in the
long rung increases system complexity and reduces maintability.

bug:6623031

Change-Id: Iacb734b1bf337a47fad02c827ece45bb2f53a79d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
322e40315609acd5a608440bc469d873e09559ca 13-Jul-2012 Craig Mautner <cmautner@google.com> Further isolate layout side from animation side.

- Use local AppWindowAnimators in WindowAnimator rather than
using shared WindowManagerService objects.
- Use local WindowStateAnimators in AppWindowAnimator rather
than use AppToken's WindowState objects.
- Remove redundant WindowManagerService parameter passed to
AppWindowAnimator ctor.
- Keep from copying parameters from performLayout if the
parameters haven't changed since the last copy.
- Link WindowStateAnimator to AppWindowAnimator to keep
from going through WindowStateAnimator.mWin,
WindowState.mAppToken and AppWindowToken.mAppAnimator.
- Converted attached WindowState in WindowStateAnimator to
WindowStateAnimator to eliminate multiple conversions.

Change-Id: I5e35af88d8fdc1a7454984eaea91a1bc4f926978
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
fbf885b652272013f44da71e9f77923333bf62eb 10-Jul-2012 Craig Mautner <cmautner@google.com> Merge "Notify client side of window movement."
918b53bc531f5bd1ea102e8b827d693bd4d0555b 09-Jul-2012 Craig Mautner <cmautner@google.com> Isolate layout and animation wallpaper objects.

Provide separate copies of mWallpaperTarget, mWallpaperTokens, and
mLower/UpperWallpaperTarget in the layout and animation sides of
Window Manager.

Simplify constructors of WindowAnimator and WindowStateAnimator.

Change-Id: I7e35794a432c25c4194c046e9e27150d1c905403
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
2639da500e3d53ea3a17d888b1c0001d043c6b98 09-Jul-2012 Craig Mautner <cmautner@google.com> Fix hang on rotation.

A recent optimization to only send updates to WindowManagerService
when there is something to report backfired. One bit indicating
change had negative polarity so the update should also have been
sent when this bit was cleared. This change alters the bit to
positive polarity.

Fixes bug 6780496.

Change-Id: I3336812a60534ebffc9e94b2fb1d0df4d6969bca
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
12670b5fb401733d14684b8d02259462eb640dc7 04-Jul-2012 Craig Mautner <cmautner@google.com> Make setting wallpaper offset immediate.

Wallpaper offset was passing through H Handler before being set.
It isn't part of animation and wasn't going through animation anyways.
This change goes back to original implementation of setting
wallpaper offset directly from call.

Change-Id: Ied88e2dc042af814b5ba91c7efb839bd82682567
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a76fdb7713d900763cff090557a10d3942b9b3ca 04-Jul-2012 Craig Mautner <cmautner@google.com> Use new object to sync DimAnimator.

The controls for the DimAnimator were going through the H Handler
to sync with the Animator. We are switching to using the
LayoutToAnimator object for passing data from layout to animator.

Change-Id: Ib6d0afabba781c88bcc1c525e3ae424cf19ac1ad
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
711f90a7c1e99a435fa8f5335f13772f0b41270b 04-Jul-2012 Craig Mautner <cmautner@google.com> Swap source and destination transfer objects.

It will be better to have the object that moves layout parameters to
animation on the layout side, and the object that moves animation
parameters back to layout on the animation side. That way we can
do partial filling of these objects without calling across. We
may never do partial draining of these objects.

Change-Id: I88826fa97350f96e309beef386885f55a9a73305
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
6fbda63e68513ece4409dac845588711ab25c39d 03-Jul-2012 Craig Mautner <cmautner@google.com> Merge CL 202423/3 App launching has random pauses.

Change-Id: Iba5616182c02e51f4d9063d0a01b30b9f558549a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7b04c2cc816ab53bd303ca97dcbbb8c116047872 03-Jul-2012 Craig Mautner <cmautner@google.com> am 80059d6c: am 00b9e899: Merge "Clear startingDisplayed flag when removing window." into jb-dev

* commit '80059d6c1b60e9920b7ae133808c989b4d3fa8fe':
Clear startingDisplayed flag when removing window.
38b2478f63004c493d7f7f1ac0bf07f51d6f0757 03-Jul-2012 Craig Mautner <cmautner@google.com> Clear startingDisplayed flag when removing window.

The flag indicating that the Starting window is displayed was not
being cleared when the Starting window was removed. That caused the
goodToGo indication to falsely indicate that all windows were drawn
when in fact the destination activity had not yet been drawn. This
caused the animation to begin when it was still black behind the old
animation.

This fixes bug 6764727.

Change-Id: Iacef73b0335b9bde2cdc8d0b072034222cd728e8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5702d4dfb5b81491f873a3617f8d8fc8dc5279e6 30-Jun-2012 Craig Mautner <cmautner@google.com> Notify client side of window movement.

Add a one way method to notify Views that the window has moved
on the screen. Fixes issues arising from the IME popping up and
translating the window that uses it. Accessibility was left unaware
of these movements and was drawing the box around the wrong widgets.
Similarly PopupWindow used getLocationOnScreen to determine how
much screen real estate was above and below the anchor point to
determine where to put an anchored window.

Fixes bug 6623031.

Change-Id: I4731a94d5424c1ec77bf1729fba8fc9ea34cae46
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a4b7f2f75e7803193429ec1179fb5e2eb1c6fbda 21-May-2012 Dianne Hackborn <hackbod@google.com> Use two fingers to work some magic...

Change-Id: Ibcb3dbd3d158c22da8277e544d81fb47eadccd49
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
fca66cd828e214fe7494e46c7daa2879dfc3210d 26-Jun-2012 Dianne Hackborn <hackbod@google.com> Merge "DO NOT MERGE Fix issue #6697105: App launching sometimes has random pauses" into jb-dev
ad51a1e9230cdf95082b5e05690f0b72eaed3f35 26-Jun-2012 Jeff Brown <jeffbrown@google.com> am 0086ec0d: am d48cf0c0: Merge "Don\'t wait until boot timeout if there is no wallpaper." into jb-dev

* commit '0086ec0d3009bc8c80e1330cd73ba534aa45f489':
Don't wait until boot timeout if there is no wallpaper.
c585841115a859eadb2f6479cb4d09a1d3ea9cba 26-Jun-2012 Jeff Brown <jeffbrown@google.com> am db65cc52: am a3a59a2f: Merge "Don\'t enable input dispatch until display enabled." into jb-dev

* commit 'db65cc520ebb3f9cfafa4a9d5be9f07621814213':
Don't enable input dispatch until display enabled.
780c46fc9197f7ecb258e2c229824749f9e93806 24-Jun-2012 Jeff Brown <jeffbrown@google.com> Don't wait until boot timeout if there is no wallpaper.

When launching only core apps, the wallpaper service
is not started. Without this change the WM waits
up to 30 seconds for the wallpaper window to be created even
though it will never happen. This introduces a significant
delay before the boot animation is dismissed so the user can
enter a decryption password.

Bug: 6263070
Change-Id: Ia975127a0bf09cf99818f7cc4fd6c0264b740ec6
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
08a746a0c60d19eb2211924ffd9fe1e452a261a6 24-Jun-2012 Jeff Brown <jeffbrown@google.com> Don't enable input dispatch until display enabled.

Bug: 6263070
Change-Id: I05d036fc1d9ec06d164d6743d45bb3f199cfab47
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
9e809448761878b72b47c0a0e703de95a3cf9815 23-Jun-2012 Craig Mautner <cmautner@google.com> Step 1 in consolidating wallpaper animation.

- Merge testWallpaperAndBackgroundLocked into
updateWindowsAndWallpaperLocked. Eliminates mDetachedWallpaper,
mWindowAnimationBackground, and mWindowAnimationBackgroundColor.

- Merge multiple calls to perform layout into one.

- Cleaned up debug output.

Change-Id: I5dc2d8330dc092ee2b165867cddb7d16b431fa0b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4170c3744692b1bdb57c3eb895b860cd64ead18f 23-Jun-2012 Craig Mautner <cmautner@google.com> Merge "Move animation step from layout to animator."
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/services/java/com/android/server/wm/WindowManagerService.java
ca08198f419476264362fadd22decc5d3ab89709 22-Jun-2012 Dianne Hackborn <hackbod@google.com> am 176a8a8b: am 0b9b053c: Merge "Don\'t crash in window manager if we fail getting .apk resources." into jb-dev

* commit '176a8a8b7cba2654f50617b14a841ef977b95b11':
Don't crash in window manager if we fail getting .apk resources.
0b9b053ce6fdc48e922b6af37fe747b4ef40324a 22-Jun-2012 Dianne Hackborn <hackbod@google.com> Merge "Don't crash in window manager if we fail getting .apk resources." into jb-dev
1caa399baffe2a5dca018469761db6f77ea31ce8 22-Jun-2012 Craig Mautner <cmautner@google.com> Move animation step from layout to animator.

Set up the Choreographer call from the animator, not from the
layout side. Introduce new class for transferring information from
layout to animator.

Change-Id: I7da032990f4b5eaeefcf92185901d896f25db3d2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
2cb7980660e046b8bf680886b0da963e3fde8fb0 22-Jun-2012 Craig Mautner <cmautner@google.com> am a6b8189f: am 9ce1ea3a: Merge "Fix starting window problems." into jb-dev

* commit 'a6b8189f8e152caafe5900cff0f068517a70088d':
Fix starting window problems.
f41209568617f4acfaf6dea8f8b2cbe9c2994a3e 22-Jun-2012 Craig Mautner <cmautner@google.com> Fix starting window problems.

Three problems fixed:
1. When one Activity took over for another Activity not all of the
starting window state was being copied over. Now copying over more
parameters.

2. When the visibility of an Activity was being changed the dummy
animation was overwriting the existing animation. If that animation
was the starting window animating then it started over when the
dummy animation was assigned. Now the dummy animation no longer
replaces an existing starting window animation.

3. The test for whether to animate away the starting window only
looked to see if the Activity had already drawn a window but did
not include the starting window. This caused the starting window
to immediately be hidden when the Activity was removed if no
windows were drawn, thereby exposing the fading window behind.
Now the starting window is included in the hasAppShownWindows test
and is animated away if it is exposed.

Fixes bug 6691421.

Change-Id: I4d32a1546c201652574a44d9e7f2752f1f1eb5a6
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
0b800190d71bbe3459149f760f49dfa6208c0e21 22-Jun-2012 Dianne Hackborn <hackbod@google.com> Don't crash in window manager if we fail getting .apk resources.

This normally shouldn't noramlly happen, but it can in the case of
bug 6647334 (crash in LoadedApk.makeApplication) where the package
manager information becomes inconsistent, and it could also happen
if an app was uninstalled or started updating at just the right
time during a launch.

Bug: 6647334
Change-Id: Iba22efe1d646cdac46099b2135466309577dfa54
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
306211d7924a276b4cb9d1ff3c2fe70400e96e18 20-Jun-2012 Dianne Hackborn <hackbod@google.com> am b0222bb1: am 0fa4d30b: Merge "Fix issue #6686339: 2 taps required to launch notification..." into jb-dev

* commit 'b0222bb19e8d850ccbd74c4f0832d73ae552df8d':
Fix issue #6686339: 2 taps required to launch notification...
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/services/java/com/android/server/wm/WindowManagerService.java
2fa2a52838619d092e22e61e16a4ee2f35b22fdd 20-Jun-2012 Craig Mautner <cmautner@google.com> am 9a5a8aaf: am 5785e05d: Merge "Clear sendingToBottom when animation is complete." into jb-dev

* commit '9a5a8aafad89f3e05bb9c17c56ea4658413a4452':
Clear sendingToBottom when animation is complete.
3f99fde465e98fb6f5a3d6dd661836ba230bf03c 19-Jun-2012 Craig Mautner <cmautner@google.com> Clear sendingToBottom when animation is complete.

Was counting on moving the app to the top to clear the flag
indicating that the app was being sent to the bottom. Since this
did not always happen the sendingToBottom flag was occasionally
left set. In this case the focus was skipped for that app and
consequently input was never propagated to it.

This fix clears the sendingToBottom flag each time the app
animations are completed.

Fixes bug 6691421.

Change-Id: I6f851dc5bedca95182db8490d87c876a71ad5fde
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4f8ecd80296508a1dc69d3f3a23fd91e962c2784 19-Jun-2012 Jeff Brown <jeffbrown@google.com> Move power manager to a new package.

Change-Id: I5f5a6435e64354b7d6535e8e9a63934ba7a3f448
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
40af9c04c5e1abb1f3aaf74bba2697370c60359a 18-Jun-2012 Jeff Brown <jeffbrown@google.com> am 81c61fda: am c4b0d098: Merge "Fix an NPE and possible unsynchronized call of Locked method." into jb-dev

* commit '81c61fda9a1b45db4c06d2db2cf24b42045d4f76':
Fix an NPE and possible unsynchronized call of Locked method.
aa9c9efa8f82eb42c56afcc69ad287985377e1b0 18-Jun-2012 Craig Mautner <cmautner@google.com> Merge "More steps to isolate animation."
ee172414877d64ebfbcdbadf10691d04a5eee684 18-Jun-2012 Jeff Brown <jeffbrown@google.com> Fix an NPE and possible unsynchronized call of Locked method.

Bug: 6680398
Change-Id: Id5ef4fa82b2a5ef5e9c3934ca95156143f91e5e2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
01cd0e7df040659900e50f83c6b75d1d6fcc5655 18-Jun-2012 Craig Mautner <cmautner@google.com> More steps to isolate animation.

- Create class to transfer state from WindowAnimator to
WindowManagerService.

- Detached wallpaper state was shared between the two classes. This
CL isolates it.

Change-Id: I7bcee348bf9f9f8f0228f36c53d75e5c92fd84cb
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
734f0214ec04e6c734aeec78d15f6db478cfb55c 15-Jun-2012 Dianne Hackborn <hackbod@google.com> Merge "Help out issue #6654729: CAB + screen off during playback" into jb-dev
b80395c17de91151141411bda4252cdb10912580 15-Jun-2012 Dianne Hackborn <hackbod@google.com> Help out issue #6654729: CAB + screen off during playback

People generally expect, if they are using FLAG_KEEP_SCREEN_ON,
that the screen won't immediately dim after it is cleared, even
if it has been passed the user activity timeout since the last
user interaction. So include the flag to reset the user activity
timeout when releasing its wake lock.

Change-Id: If7a8fea8faef3edbf13dff10a2f248adc9e3ff0b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a676cdab11ace948a054b5ca342727a3d0eb29b2 14-Jun-2012 Michael Jurka <mikejurka@google.com> Merge "Tweak recents launch app animation" into jb-dev
b9a38c57fc47858eb16f4a8b7aa3d3dc9b98166c 14-Jun-2012 Michael Jurka <mikejurka@google.com> Tweak recents launch app animation

- Sometimes the black background would flash; changing
animation durations to make this much less likely
- Fixing issue in Recents where we sometimes forgot
to disable drawing caches on views after enabling them
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
f8d05b4ea61bb0db32c1a7f93f27a13f67c9ef0c 13-Jun-2012 Craig Mautner <cmautner@google.com> Merge "Update wallpaper visibility at time of hide/show." into jb-dev
507a2ee12b6d1d683e4a5806804c472b3fe32e61 13-Jun-2012 Craig Mautner <cmautner@google.com> Update wallpaper visibility at time of hide/show.

Call the Window client method dispatchAppVisibility when hiding or
showing wallpaper rather than wait until the next call to
performLayoutAndPlaceSurfaces.

Fixes bug 6645473.

Change-Id: I363f69f8db0affff92308e11ce52546401959d8f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
1c9581023ced89a209fca9c4e40305f8e0859732 13-Jun-2012 Craig Mautner <cmautner@google.com> Merge "Set detached wallpaper on the scale up animation." into jb-dev
a803371535e98e522c1044f0963ec8229e437b4f 13-Jun-2012 Craig Mautner <cmautner@google.com> Set detached wallpaper on the scale up animation.

This keeps the background wallpaper from disappearing when expanding an
app that has a wallpaper background (e.g. clock).

Fixes bug 6649988. The second half of the bug, the first half will be
reissued as a new bug.

Change-Id: I209c9038469e4133586a927c92ef64ae43fb937f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
9fec779587a425450bff021cdd8c83c3d3d3a869 12-Jun-2012 Craig Mautner <cmautner@google.com> Do not cancel animations when switching.

Was canceling ongoing animations when starting a new animation which
caused the window of the first animation to restart. This looked
janky. The original cancellation was put in to stop the incorrect
animation being selected when quickly switching between an incoming
app and the homescreen. Reversing the cancellation no longer exposes
the original problem it was put in to fix.

One way to duplicate what this is fixing.
1. Slow down animations to 10x.
2. Run ApiDemos/App/Alert Dialogs/List dialog
3. Tap outside the list dialog and then tap the home button.
Tapping outside the list dialog causes the list dialog to animate
away. Tapping the home button then causes the app to animate away.
Before this fix the list dialog would revert to full size before
the app animates away. With this fix the list dialog continues its
original animation as the app animates away.

Fixes bug 6600726.

Change-Id: I29c940254808a321c3b6c2e4f4b7c78a72b47899
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c016aaaa42f2d7f758bb6d973f035285e3d3dd87 06-Jun-2012 Michael Jurka <mikejurka@google.com> Tweak recents out animation a bit more

Bug: 6490204

-Fading to black in the recents layer
-Tweaking duration and interpolators
-Removing some unnecessary debug exceptions (Bug: 6642072)

Change-Id: Iba18fade7f874078111fc1d79a81830ee07617d4
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
fab75dc830039b5aa1463aea55ceee2de279ec52 08-Jun-2012 Craig Mautner <cmautner@google.com> Merge "Turn off dimming immediately for removed windows." into jb-dev
236a35b77a1b48b11e7ad5ce9774e41ef6500a29 08-Jun-2012 Craig Mautner <cmautner@google.com> Turn off dimming immediately for removed windows.

Dimming was only turning off immediately for app-animated windows.
For removed windows dimming wouldn't turn off until the window was
completely gone.

Fixes bug 6628057.

Change-Id: I3ba6501b10a31b6f8c91012e17ad8734a84050c4
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
86783474fdec98a22bc22e224462767eab13e273 07-Jun-2012 Svetoslav Ganov <svetoslavganov@google.com> Cannot interact with dialogs when IME is up and on not touch explored popups.

1. If the last touch explored location is within the active window we
used to click on exact location if it is within the accessibility
focus otherwise in the accessibility focus center. If the last touch
explored location is not within the active window we used to just
click there. This breaks in the case were one has touch explored
at a given place in the current window and now a dialog opens *not*
covering the touch explored location. If one uses swipes to move
accessibility focus i.e. to traverse the dialog without touching
it one cannot activate anything because the touch explorer is using
the last touch explored location that is outside of the active
window e.g the dialog.

The solution is to clear the last touch explored location when a
window opens or accessibility focus moves. If the last touch
explored location is null we are clicking in the accessibility
focus location.

bug:6620911

2. There is a bug in the window manager that does not notify a
window that its location has changed (bug:6623031). This breaks
accessibility interaction with dialogs that have input because
when the IME is up the dialog is moved but not notified. Now
the accessibility layer gets incorrect location for the
accessibility focus and the window bounds.

The soluion is when the accessibility manager service calls
into the remove thress to obtain some accessibility node infos
it passes the window left and top which it gets from the
window manager. These values are used to update the attach info
window left and top so all accessibility node infos emitted
from that window had correct bounds in screen coordinates.

bug:6620796

Change-Id: I18914f2095c55cfc826acf5277bd94b776bda0c8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ad5725d7985a784056b02b97ab76357a667a6ad4 05-Jun-2012 Craig Mautner <cmautner@google.com> Eliminate wallpaper exposure during transition.

Make sure that the wallpaper target exists and is visible before
exposing the wallpaper.

Fixes bug 6570335.

Change-Id: I1dddfe26683e84fd813e7bee884ba2bd4bb85272
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ab886f588d4086214e66eed548ea3edd77f8d2ba 04-Jun-2012 Daniel Sandler <dsandler@android.com> Don't do closing animation on an opening app.

Check to make sure that the closing wallpaper animation isn't used on
an opening app token. This can happen when a previous animation hasn't
completed when the next animation is starting.

Fixes bug 6557751.

Change-Id: Ib8bd4dd7de1e361f6fc0cab11d0997e70f9ddd0b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
6593be0c200f69d932e40e05e9df54b89c157c48 04-Jun-2012 Dianne Hackborn <hackbod@google.com> Merge "Work on issue #6579997: Mariner entrance animation" into jb-dev
da652f6e51e5b255019ac020d56e262e477c2a46 03-Jun-2012 Craig Mautner <cmautner@google.com> Merge "Revert change to correct animations." into jb-dev
3aa7fcac1c46353c2f147d978d9eb2f2748def4a 03-Jun-2012 Craig Mautner <cmautner@google.com> Revert change to correct animations.

Incorrect animation was introduced with CL 196207 (perhaps in
combination with a later CL). Reverting part of that CL fixes
the incorrect animation and so far has not reintroduced the jank
that was fixed by that CL. If the jank reappears it should be
fixed in a different fashion than in CL 196207.

Fixes bug 6597505.

Change-Id: Ie8012237a8d49810ede51bd8d78ef8c2fd91ddd4
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
84375876fcef73c5fa9c3de205c7db908ee14e15 02-Jun-2012 Dianne Hackborn <hackbod@google.com> Work on issue #6579997: Mariner entrance animation

Add a new variation of ActivityOptions that allows you to
supply custom animation resources and get a callback when the
animation starts.

Use this in SearchPanelView to determine when to start hiding
the search panel instead of having a fixed delay.

Fix some issues in the activity manager where we would cancel
the options in cases where we should actually keep them to give
to the window manager for a transition. (Basically when the
activity being started is not actually ending up launched, but
just results in a shift in the activity stack.)

Note that this is not quite what the design calls for -- the
entire search UI is waiting and then disappearing when the
animation starts, instead of the ring first disappearing while
waiting for the time to fade out the circle.

Change-Id: Iee9a404ba530908d73cdbd4a9d0d2907ac03428f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
881656831c9734bfa4a42c56574bbd871c967a3e 31-May-2012 Craig Mautner <cmautner@google.com> Use Surface layer for Surface operation.

Previous fix exposed an existing bug where we were using mAnimLayer to
determine the highest Surface layer. This fix uses mSurfaceLayer to set
the layer limits for making the screenshot.

Fixes bug 6586168.

Change-Id: Iaa3b43867aef795ca617ff4b8076428dfc91eaf2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7e4ff4b986d626493afb676dd4824d2b3663260a 30-May-2012 Jeff Brown <jeffbrown@google.com> Fix comparison of device source bits.

Bug: 6576743
Change-Id: I6952b052e2ab9e62ddd46ab76f4df37ecc656757
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
de1ddd0f93fae6ba517d516993e7fb495424f574 29-May-2012 Craig Mautner <cmautner@google.com> Merge "Better handle changing app transitions." into jb-dev
1d961d46d68eb3134e4bd6c3751f9730e9d32f17 27-May-2012 Craig Mautner <cmautner@google.com> Better handle changing app transitions.

When we are in the middle of an app transition and need to change to a
new one we were not ending the old one in a clean state. Also,
wallpapers were defaulting to the wrong animation in certain
situations.

Remove ':' style iterators.

Fixes bug 6486708.

Change-Id: Ied17e8410486020295db380ff68df5dad08bc5cc
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
1dee8974693fff55e276e0aed1202e43904bb944 29-May-2012 Craig Mautner <cmautner@google.com> Merge "Track animating apps up until animation starts." into jb-dev
06a94f710d4ee6366ebfbd6666c5a58916511eef 29-May-2012 Craig Mautner <cmautner@google.com> Track animating apps up until animation starts.

ActivityStack sets the mNextAppTransition value before moving the apps
to their proper position. This makes the test for mNextAppTransition
being TRANSITION_UNSET incorrect. Better to just look for animating.

Fixes bug 6565418.

Change-Id: I4651b7d3678e46fc712a8e901992fb01b94c415e
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
67e6070fa10bbd313c8ebe0de4e0440b688c569e 24-May-2012 Craig Mautner <cmautner@google.com> Merge "Change method of tracking moving AppWindowTokens." into jb-dev
ef25d7a01910d5547b60c9cc52d4fa4a9e40b6fa 16-May-2012 Craig Mautner <cmautner@google.com> Change method of tracking moving AppWindowTokens.

Stop trying to keep track of the AppTokens that have been moved
to the top and bottom and then try and match the WindowStates when
transitions are goodToGo. Instead rebuild the WindowState order based
on the AppToken order when we are goodToGo.

When moving AppWindowTokens lower in mAppTokens create a new ArrayList
of AppWindowTokens to keep track of the apps in Z order while
animating.

Fixes bug 6481078.

Change-Id: I29b33a507b45752f15feb10a9f4b47a3f5eb9f0e
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
208236dd9600efb125639bf7ca5715fb341ee8d8 23-May-2012 Craig Mautner <cmautner@google.com> Merge "Pull showStrictModeViolation off of local threads." into jb-dev
0447a81e6dd9671ab1290deba682423e2aac5a07 23-May-2012 Craig Mautner <cmautner@google.com> Pull showStrictModeViolation off of local threads.

By moving the StrictModeViolation display onto the WindowManager
Handler we avoid potential deadlocks as found in the bug below.

Fixes bug 6537798.

Change-Id: Ia46a43d1f7f6e55256f770b9e196602092669b49
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ac92087a9a1c464d4b0a58c82dae01cbaa088e89 22-May-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6499411: Characters not displayed (but suggestion bar is working)

The problem was that when dismissing the lock screen, the window manager
would briefly turn off force hiding when it started animating the transition
and then turn it back on until the transition was done.

This would cause it to briefly switch focus to the app behind and then
take focus off it. The app would find out it got focus, and re-start
input on itself, asking the input method service to do so. At this
point the input method service would ask the window manager if the
caller really had focus, and it may or may not be told no depending
on the timing. If it is told no, then it doesn't allow the focus
switch to happen at that point, ignoring the new input connection,
and ultimately when focus does really switch the IME is left talking
with an old dead input connection.

I added some code to the input connection to make sure when we are
no longer using one that we mark it inactive and can't use it. This
bug was especially difficult to track down because it would only
visibly break when a GC happened during this time, causing the weak
reference on the input connection to become null. With this change
it will now always break (though in the scenario here only if you
hit the race condition correctly).

Change-Id: I81a6164dc140c548da1a9736e42cd253e8238a80
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
9faa9374c1398ca4a0f3fbfc4feaa5cddeb073b0 22-May-2012 Svetoslav Ganov <svetoslavganov@google.com> Merge "Changing the interaction model of the touch explorer." into jb-dev
e15ccb93add99ebb9cd7aec03a04faa37f45b39d 17-May-2012 Svetoslav Ganov <svetoslavganov@google.com> Changing the interaction model of the touch explorer.

1. Now the user have to double tap to activate the last
item. If the last touched window is not active because
it does not take input focus the click on the last
touch explored location. Othewise the click is on the
accessibility focus location.

bug:5932640

Change-Id: Ibb7b97262a7c5f2f94abef429e02790fdc91a8dd
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
abe3927701c0aff839498272565aeee714aa6e9d 18-May-2012 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #6515427: Add android.hardware.television and fix..." into jb-dev
0cf2c8a53350a800055e76c1c9bf0a6d44480768 18-May-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6515427: Add android.hardware.television and fix...

...logic for notouch in Configuration

Added new TELEVISION feature.

We now force the configuration to "television" if the TELEVISION
feature is set, and "notouch" if the TOUCHSCREEN feature is not set.

Also cleaned up documentation, deprecated some configurations that
are not used.

Change-Id: If1c7a284b580a8a66bda2a75f0c7fa841b3dc9b7
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
bf08af3323117e15a65b74e66b7499d31537f9e1 17-May-2012 Craig Mautner <cmautner@google.com> Eliminate deferred surface destruction.

Removing the code that delays a surface destruction when
WindowManager.FLAG_KEEP_SURFACE_WHILE_ANIMATING is set. The lock
screen that continued to animate after destroySurfaceLocked is no
longer used and this code was causing problems.

Also mDrawState was being set to NO_SURFACE in destroySurfaceLocked
even if the surface ended up not being destroyed. Later when it was
reused the false value of mDrawState was messing things up.

The screen lock bug referenced below no longer levaes the user stuck
with a black lockscreen. However it occasionally powers back up in the
launcher screen rather than the lock screen.

Fixes bug 6485955.

Change-Id: I684104c7e7c39c161a5118aa890889fbae92e635
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
c8179e78052af3d68725e1160214a736f143f8a2 12-May-2012 Michael Jurka <mikejurka@google.com> Merge "Improve transition out of recents" into jb-dev
d5895a7e8a94e58451af640fe796d1822cbd793f 12-May-2012 Michael Jurka <mikejurka@google.com> Improve transition out of recents

- During the transition, fade the bg to black
- Exiting activity fades to black
- Recents background no longer fades away, because
then it would fight against the fade to black
happening behind it
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
4fe5ebcc962ad7edb205bf988dd463854dea1044 10-May-2012 Craig Mautner <cmautner@google.com> Merge "Update DimAnimator layer when its window changes." into jb-dev
acafd19c5ea05a8d465f97204f8d63468bdaa2a4 10-May-2012 Craig Mautner <cmautner@google.com> Update DimAnimator layer when its window changes.

Prior to this fix once dimming had been turned on it stayed at the
same layer and associated with the same window until it was turned
off. Now the DimAnimator layer is updated if either the window layer
changes or the dimming window changes.

Fixes bug 6467865.

Change-Id: I3e1765b92b51be26e3718c8a87e2583041a36af9
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
21385cd83d7d7938b57a4acbaa236dd4c7804ed4 03-May-2012 Michael Jurka <mikejurka@google.com> Making transition out of recents look better

- Fading out recents first, then scaling up app
thumbnail
- Fade Recents out over 130ms
- Delay the window animation for 200ms first,
then animate for 200ms (previously we didn't delay
and then animated for 300ms)

Bug: 6390075

Change-Id: Ia8c753bf7ee03d2acef6eb2772b28d88fe10a682
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
393295fabff828d3bc974a617d152ff0895a4071 09-May-2012 Craig Mautner <cmautner@google.com> Merge "Keep layout from overwriting translate dimensions" into jb-dev
e0a99414bd3737ad976bf4a040c184bebd8e2e3d 09-May-2012 satok <satok@google.com> Fix the issue that the insets linger after closing the voice input

Bug: 6456954
Change-Id: Idf7700271cf882dfbf35c9d16f0f173a791221bc
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a83580614f4f75f7d474e81c7c10c2c784df1380 09-May-2012 Craig Mautner <cmautner@google.com> Keep layout from overwriting translate dimensions

If the layout goes through more than one pass after detecting a window
movement but before animation begins then the later pass overwrites
the animation offsets. The incorrect values are large leading to an
animation starting location in the bottom right corner.

Fixes bug 6450310.

Change-Id: I0f74e67b3e9a15a9246151abf6d47384509340e9
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
79b7742cf17c79c529bbcbd1acc2d871a90e8fbc 09-May-2012 Craig Mautner <cmautner@google.com> Merge "Fix wallpaper exposure bugs." into jb-dev
0afddcb7f11ddfcaa5d1f5a5db75fce1b5d40253 09-May-2012 Craig Mautner <cmautner@google.com> Fix wallpaper exposure bugs.

Qualify the test for wallpaper animation to exclude the dummy
animation. This keeps us from treating a dummy-animating wallpaper
as an exiting wallpaper and providing the wrong animation.

Hide wallpapers when the wallpaper target window is hidden. This
fixes a timing issue where the wallpaper was exposed for one pass
through performLayout after the launcher was hidden.

Fixes bug 6454992.

Change-Id: Ib4f9205c01a37e6f48f1f93ddcf2476e40ff942f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c042ee2acd8529b95c5dc99240d626e61d2500cd 08-May-2012 Jeff Brown <jeffbrown@google.com> Disable input dispatch until boot finished.

Bug: 6263070
Change-Id: I25e15e3d8af8eb3343c7b684fec345337d9f6aab
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e19dbd9f9d0fea5959d8384d5d9d577d25cc8963 03-May-2012 Jeff Brown <jeffbrown@google.com> Merge "Separate the internal and external display rotations." into jb-dev
93de746e5554bc9397ca8109f57875d92e64eabc 03-May-2012 Jeff Brown <jeffbrown@google.com> Separate the internal and external display rotations.

When attached to an HDMI touch screen, the input system needs
to know the size and rotation of the external display independent
of the internal display. The size was already being reported
separately but not the rotation. The inconsistency can cause problems
if the internal display's natural rotation is portrait but
the external display's natural rotation is landscape.

Change-Id: Id344f04c1ba032625f6265766be66f9ddaa2cc0b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
be4f5bb7fc08ca25d67525fdd97d15f73d150891 03-May-2012 Craig Mautner <cmautner@google.com> Merge "Fix Home key causes wrong animation" into jb-dev
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/services/java/com/android/server/wm/WindowManagerService.java
83339b465c3299abc47ced7dffdf470c5b0c0750 02-May-2012 Craig Mautner <cmautner@google.com> Fix Home key causes wrong animation

Wallpaper logic assumed that if mWallpaperTarget was non-null then
any wallpaper animation should be exiting. However, if the existing
wallpaper target was already animating away then mWallpaperTarget
remains non-null until it is completely gone. Pressing Home during
this time was causing the next animation to exit rather than reverse
and enter.

This fix looks to see if the wallpaper target is animating and if it
is to treat it as null for the purpose of determining which direction
the animation should go.

Fixes bug 6407941.

Change-Id: I731267328db0f9972a5aed6f214962f96737dd07
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
79c6346100b555a8a3d51b3b1c34dbbe99305b9a 28-Apr-2012 Dianne Hackborn <hackbod@google.com> Merge "When a window is first shown only draw once while animating." into jb-dev
de7ff082c403682d6091888617111dcc1494088d 28-Apr-2012 Craig Mautner <cmautner@google.com> Merge "Call deferred windowFocusChange when draw complete" into jb-dev
12d3a94397c33fdb773a1eaaaa13cab80bf0c571 27-Apr-2012 Dianne Hackborn <hackbod@google.com> When a window is first shown only draw once while animating.

On some hardware allocating a new graphics buffer is quite
expensive, which blocks updates to the UI. This can cause
glitches when performing window animations.

To reduce these glitches, the view hierarchy will now only
allow itself to be drawn once if its window is being shown
while the window manager is animating, not resuming draws
until it is told that the animation is done.

Change-Id: Ie15192f6fddbd0931b022a72c76ddd55ca266d84
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c8e372031cccfbd5cc7ae626255442423240338f 27-Apr-2012 Craig Mautner <cmautner@google.com> Merge "Don't resize WindowStates without a Surface." into jb-dev
51bb12b3e5c51f1aeccd20d4a226ebc4c25eac50 27-Apr-2012 Craig Mautner <cmautner@google.com> Call deferred windowFocusChange when draw complete

Move the test for deferred window change notification after the drawing
update. Previously there was never a second check after the drawing
completed so we never sent the notification to the departing window.

Fixes bug 6335849.

Change-Id: I8a7eafdb184567a47ae04f1e597bae4cccf6cf62
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
1efacf7fcab53f0096550edc2282afc3df408223 27-Apr-2012 Craig Mautner <cmautner@google.com> Don't resize WindowStates without a Surface.

Check to make sure that a WindowState has a Surface before adding it to
mResizingWindows.

Fixes bug 6300793.

Change-Id: Ieb39422523360dcdd5f5bf8109f061ae1ced62b2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
1ded0b1f6af65c2f95f8327f7f3df4cee1bf2346 26-Apr-2012 Dianne Hackborn <hackbod@google.com> Add traces for window manager and activity manager.

Change-Id: I525d762db328e4c597da27b6b56d9a808e199756
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
38cb84fd4b39c08cbd5b65b7383e712b9f476e3f 25-Apr-2012 Winson Chung <winsonc@google.com> Merge "Reverting min scale in the previous animation changes."
108b0607cd82c1022f6ca211ed02cf731f01adc0 25-Apr-2012 Winson Chung <winsonc@google.com> Reverting min scale in the previous animation changes.

Change-Id: Ia21169386a038026d76a0bb3cf8c74576786e5ba
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
069ac9a78d62a68d5eb640d3b87793f4ac924f6d 25-Apr-2012 Winson Chung <winsonc@google.com> Merge "Updating activity/task transition animations."
dc6f79bf4374f2fcea2b9d4d0aa7f2e39cc42456 18-Apr-2012 Winson Chung <winsonc@google.com> Updating activity/task transition animations.

Change-Id: I0d4295d269222310a5a6594fb379b9592dd9ced0
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
35af2fff433e6f83f70b8bb15b3bf4fc19d13104 24-Apr-2012 Craig Mautner <cmautner@google.com> Don't start a dimming operation when hiding.

Check to see if app token is hiding before going ahead with turning on
dimming. Before this fix went in we were turning dimming back on right
after turning it off. Then we didn't turn it off again until all
animations had completed leading to a delayed dim-off experience.

Fixes bug 6378033.

Change-Id: Ic819a0093ba95f62df369266c07525835703c5fa
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
fbf378c736a973b8edaf1fc4c187d11dc0f5e291 24-Apr-2012 Craig Mautner <cmautner@google.com> Various debugging enhancements.

Also moved DummyAnimation into AppWindowAnimator where it belongs.

Change-Id: I7da254a8b99030b898e2ff8d983500d7ce0b2b65
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
8ff0c9204e565d7389b10495cf885c772d204be5 21-Apr-2012 Dianne Hackborn <hackbod@google.com> Merge "You can now long press on the power off menu to reboot to safe mode."
19caadc08f09cc9f6665fbbb0d61e02861ce8562 21-Apr-2012 Dianne Hackborn <hackbod@google.com> You can now long press on the power off menu to reboot to safe mode.

Change-Id: I3aa575285058cf5a3d89486d6b944f6ea13d645c
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4d7349bb6df5a01ba451aa1abd4c9f6349a57016 20-Apr-2012 Craig Mautner <cmautner@google.com> Remove flicker from transitions.

Change state progressions to handle animation/layout separation.
Also added debug as needed.

Fixes bug 6360835.
Fixes bug 6206366.
Fixes bug 6286371.
Fixes bug 6240494.

Change-Id: I1079756a7e3e35ebb9f711f02d005bde9bf65ef0
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
68c33ca7ce1f142eb5f1e1f90118aeba4c9db1e3 19-Apr-2012 Dianne Hackborn <hackbod@google.com> Add new API to find smallest/largest screen size.

Change-Id: I790801fceaf84ee2e3b1c9d32828285ad3231d0e
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
08ce91a1a4c4b69a30a46095ed701d804dd6302e 19-Apr-2012 Dianne Hackborn <hackbod@android.com> am 7eda9de1: am 2fe57183: am 30eec832: Merge "Transparent activity orientation problem when previous landsacpe fullscreen activity not yet destroyed."

* commit '7eda9de1a638e4ed1ce5dc65fecd673400b9f3c0':
Transparent activity orientation problem when previous landsacpe fullscreen activity not yet destroyed.
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/services/java/com/android/server/wm/WindowManagerService.java
0445bc6e4eeba8af74e7eea7c9d68e1ede74f90d 18-Apr-2012 p13451 <cheoloh.park@gmail.com> Transparent activity orientation problem when previous landsacpe fullscreen activity not yet destroyed.

After terminating landsacpe fullscreen activity,
when user launch transparent activity via portrait home app, transparent activity is shown as landscape mode.

At this time AppWindowToken of previous acitivity has not been deleted, because Activity.onDestory() has not been returned yet.
In this case, getOrientationFromAppTokensLocked() returned ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE.

Ignore hidden application is terminated on the top.
See also http://code.google.com/p/android/issues/detail?id=28927

Change-Id: I51239431120ec6ba8f8ff76871efb2347b9810ca
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a51a9564fd53b661446cd63eea23208656acc678 18-Apr-2012 Craig Mautner <cmautner@google.com> Add call-stack reporting methods into Debug

Added two public methods to Debug. These methods return a String
indicating the caller (getCaller()) or callers (getCallers(int depth))
of the calling method. The String indicates the class, method and line
number of the caller(s). Similar to using Throwable.fillInStackTrace()
but much more concise.

Change-Id: I53d0085aa50e4501d28e8eb3ad5b91ef700ac218
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c843642fbb76619520f960043adaa268e252a657 17-Apr-2012 Craig Mautner <cmautner@google.com> Merge changes I4752bdf1,I37690cf2

* changes:
Move Surface operations into existing transaction.
Clear orientation variable until rotation is done.
acaf9cca865902e6f1823e771f4234bfda53cfd1 17-Apr-2012 Craig Mautner <cmautner@google.com> Move Surface operations into existing transaction.

Several Surface operations - notably setPosition, setSize, and show -
had been moved outside of a Surface.openTransaction/closeTransaction
window. This corrects that problem.

In addition, before animations were separated from layout the Surface
frame was computed prior to returning from relayoutWindow(). After
separation the frame was being computed during animation. This checkin
restores the frame calculation in layout.

Fixes bug 6343291.

Change-Id: I4752bdf1fed0f2b46c5eb9508825c9b1b0fd702f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
eabfb3a36e9469c5e219f92b39b7200104319185 17-Apr-2012 Dianne Hackborn <hackbod@google.com> Add new scale-up window manager animation.

Like zoom thumbnail, but without the thumbnail.

Change-Id: I9486dd204398b87c9e70ff0d05d03f4a22449cd6
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
3255a28b6a18bb97f0e533dc1673c5e28837b4f2 17-Apr-2012 Craig Mautner <cmautner@google.com> Clear orientation variable until rotation is done.

In the old code orientationChangeComplete was set to true on each pass
through perfomLayout. If any window was rotating the variable was set
to false on the way through the performLayout. Since we can now make
passes through performLayout before any animation step occurs we were
seeing mOrientationChangeComplete true prior to rotation completing.

This change sets mOrientationChangeComplete false at the start of a
rotation and sets it to true if we ever get through an animation step
without encountering any rotating windows.

Change-Id: I37690cf20868dfbaac94a81640bc4d9cb9fb8f00
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7d8df3905d294127cc58100912a57c816bfb2502 07-Apr-2012 Craig Mautner <cmautner@google.com> Animate from Choreographer only.

Animation steps are now executed on a Thread launched from the
Choreographer rather than being called at the end of the WindowManager
layout process. Animations and layout are still tightly coupled in
that they share considerable state information and neither can be
executed without holding a lock on WindowServiceManager.mWindowMap.

Change-Id: Ie17d693706971507b50aa473da1b7258e9e67764
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7358fbfeb2febb60085067fcacc192f429b06545 13-Apr-2012 Craig Mautner <cmautner@google.com> Minor cleanups.

- Replace HashSet with ArrayList.
- Check for Watermark and SurfaceSession initialization once, not every
time through layout.
- Move watermark rendering into animation.
- Add surface operation debugging.

Change-Id: I4b7e7c0b8d89d43c67a42753832f90b8632d4f5d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
2f63cfda7645cf8ac6734b751fb9dcee42d6b302 12-Apr-2012 Justin Mattson <jmatt@google.com> am 4ea7bfea: Merge "Check if WallpaperService is enabled" into ics-aah

* commit '4ea7bfea312e4ddf815eabdef04d3f3b4878a51a':
Check if WallpaperService is enabled
1e1edaa60dc183b1b8f0b8588deb8c42c9169cfb 12-Apr-2012 Craig Mautner <cmautner@google.com> Merge "Check WindowState when looking for animation."
f20588fdc65a5651c3a5ab5c0c20165c0e33c394 12-Apr-2012 Craig Mautner <cmautner@google.com> Check WindowState when looking for animation.

The method setTokenVisibilityLocked returns true when animations are
delaying the exit of an app. Previously this only checked AppToken
animations but that caused exiting WindowState animations to be
ignored.

In particular if an application both hid an AppToken and then
dismissed the AppToken, the AppToken was being removed from
mClosingTokens before the animation finished. This caused
rebuildAppWindowListLocked to lose a WindowState. Furthermore
Surfaces were not being removed when a WindowState was lost and
we were leaking Surfaces.

Fixes bug 6297563.

Change-Id: Ie75c71064518199237ec4a17d3f65e2a2dd29674
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
f8d4fbb9c87201350534861c4d988e63691fe24f 11-Apr-2012 Craig Mautner <cmautner@google.com> Check for existing dimming before stop dimming.

Add a test to make sure that we are dimming before we send the message
to stop it. This prevents a CPU consuming loop when dimming is already on.

Fixes bug 6320003.

Change-Id: If26dc5b0800300d8e38c166824651223eded4cfa
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
f0cabba38bcb1aefad191915e214e836fa5ed2bd 10-Apr-2012 Craig Mautner <cmautner@google.com> Merge "Fix NPE in setTransparentRegion."
1f4e0ccba08e4abb55a38a8b5936dbb244475fb9 10-Apr-2012 Craig Mautner <cmautner@google.com> Fix NPE in setTransparentRegion.

Check for null Surface before using it.

Fixes bug 6312835.

Change-Id: Iaaac2a5d88e81b88e369815e09818c268085e4b7
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
8330e40b9897afb1e2b2e6354ed3c35e7c557486 10-Apr-2012 Craig Mautner <cmautner@google.com> Merge "Reduce load on CPU when animating rotation."
73850cb6991074e33c31d310ccb63a1f863f7b4e 10-Apr-2012 Craig Mautner <cmautner@google.com> Reduce load on CPU when animating rotation.

This change keeps requestTraversalLocked from being called on virtually
every call to animate while rotating.

Change-Id: I6d2db37db3bb82f4f9ecc84b17dbf121819a6c1b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c38cf4c7dbe7d96255d42dabf8ca801830813f5e 10-Apr-2012 Daniel Sandler <dsandler@android.com> Merge "New Android Dreams architecture, disabled for now."
4233f262499aa1dea332fe60d7a30ab4cdc4e3ed 10-Apr-2012 Justin Mattson <jmatt@google.com> Check if WallpaperService is enabled

If WallpaperService is disabled, don't delay starting SurfaceFlinger
until it is.

Change-Id: I95db6b7bc791329e2bae33472cfeb125e5f6f324
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
27fd3420ac0498ff5086f71023f443966541aa04 09-Apr-2012 Jeff Brown <jeffbrown@google.com> Fix lid switch interpretation.

Also remove unnecessary permission check for method that is
only called internally.

Change-Id: I32f63fc3e96b06709d18b046ee2d3c8f310de70d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
bec53f7066852c1c5877c51fcd8c55840891d866 05-Apr-2012 Craig Mautner <cmautner@google.com> Animate from local list of WindowStateAnimators.

Stop animate() from using the mWindows maintained by
WindowManagerService. Animating WindowStateAnimators are now drawn from
a HashSet maintained by WindowAnimator and containing just those
WindowStateAnimators that have Surfaces.

When starting a move animation do not place parameters directly into
the WindowStateAnimator, instead pass them through the Handler.

Also removed synchronization points from mWindows/mAppTokens
add/remove.
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7a3bc87468d2d2c48e9ae3071c82f7aa5251e7d5 06-Apr-2012 Craig Mautner <cmautner@google.com> Merge "Fix so that windows again animate when moving."
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/services/java/com/android/server/wm/WindowManagerService.java
6af9b92b75c820661ea995a98898395f22871498 06-Apr-2012 Craig Mautner <cmautner@google.com> Fix looping to turn off dimming.

Dimming was constantly being turned off if it wasn't time to turn it
on. This caused endless reentry into the Window Manager and consumed
lots of CPU.

Fixes bug 6293953.

Change-Id: Id87e60c7c70e96e66ce0b6297442f5ac0d2ff477
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
42c45856f5d8927e188ed1c9c3c8dd711af5796e 06-Apr-2012 Dianne Hackborn <hackbod@google.com> Fix so that windows again animate when moving.

Change-Id: I2441d0c892687b8cda239815caf77837cd21093e
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e9bdb31ea1dc3c1c2b1833a4bf0031d85928a45b 06-Apr-2012 Jeff Brown <jeffbrown@google.com> Merge "Refactor input system into its own service."
4532e6158474a263d9d26c2b42240bcf7ce9b172 05-Apr-2012 Jeff Brown <jeffbrown@google.com> Refactor input system into its own service.

Extracted the input system from the window manager service into
a new input manager service. This will make it easier to
offer new input-related features to applications.

Cleaned up the input manager service JNI layer somewhat to get rid
of all of the unnecessary checks for whether the input manager
had been initialized. Simplified the callback layer as well.

Change-Id: I3175d01307aed1420780d3c093d2694b41edf66e
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
594316361d38d88b53c85bd5c8d58a92345e8187 04-Apr-2012 Craig Mautner <cmautner@google.com> First separation of animation from AppWindowToken.

New class AppWindowAnimator pulls animation out of AppWindowToken.

Change-Id: Ic1ccb6ec2bf091f1f901fe3c20cbeb242376ae6b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
d09cc4ba247e896cc95a57ed7a3247b55b1b68fc 04-Apr-2012 Craig Mautner <cmautner@google.com> Move more items between layout and animate sides.

- Isolate DimAnimator animation from the layout side.
- Isolate mWallpaperForceHidingChanged and mOrientationChangeComplete
from the animation side.
- Eliminate a redundant setting of mOrientationChangeComplete to true.
It was already true at that point.
- Synchronize changes to mWindows and mAppTokens on mAnimator. This is
a nop until we go to multiple threads.
- Synchronize AppWindowToken.freezingScreen on mAnimator.
- Modification to repeat layout debugging including temporary enabling
of spew on layout repeats.

Change-Id: Ic8d82b1c197144aaf6957caa5f71e175288220f2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
1d6013357847983180a317e2acaf807bde8b7ea7 02-Apr-2012 Craig Mautner <cmautner@google.com> Merge "Refactor to convert four state booleans to int."
749a7bb28b2aff7a77a8c7dce01e086c2bd82c6b 02-Apr-2012 Craig Mautner <cmautner@google.com> Refactor to convert four state booleans to int.

Replace four booleans (mDrawPending, mCommitDrawPending, mReadyToShow
and mHasDrawn) with a single int that can take on the four states.

Move mLastHidden from WindowState to WindowStateAnimator.

Change-Id: Ieff319dfa19123bf5a6cdc98e9ab28fd432b8153
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ea7ff4d2fe58505ec66c0e994ac1e03561b2b836 02-Apr-2012 Craig Mautner <cmautner@google.com> Merge "Defer a couple of Surface actions for WSAnimator."
48ba1e7f530dab01bd2e733b6466246380720a92 02-Apr-2012 Craig Mautner <cmautner@google.com> Defer a couple of Surface actions for WSAnimator.

Perform the set-transparent-region-hint operation outside of the
WindowManagerService loop. This is to isolate the Surface operation
from the WindowManagerService inner loop.

Similarly, defer the setWallpaperOffset call so it's animation is not
coupled to the WindowManagerService inner loop.

Note that both operations are still being done on the
WindowManagerService thread.

Change-Id: I97f030b2a9b7cffe91c77342a299bfac6e59e9f8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5d724f50d4d3907c4742dadd666f5355f046b5b1 02-Apr-2012 Craig Mautner <cmautner@google.com> Merge "Further isolate the Surface from WindowState."
c8bc97e53044cd62c0e023fdc441fd13127d0283 02-Apr-2012 Craig Mautner <cmautner@google.com> Further isolate the Surface from WindowState.

Replace references to mWinAnimator.mSurface with new member
mHasSurface.

Clean up odd looping structures.

Simplify logging.

Change-Id: I9cc52a657044220d7b92528928b11bb18a724aef
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e6c966caa3aff3099e6fb00caefa10387f57b9c3 02-Apr-2012 Michael Jurka <mikejurka@google.com> Merge "Add frame counter to dumpGfxInfo"
61d6c8ca49d4a3d5bf4c961878a3f71145d75058 31-Mar-2012 Dianne Hackborn <hackbod@google.com> Merge "Add new feature to let apps layout over status bar / system bar."
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/services/java/com/android/server/wm/WindowManagerService.java
4185012ad323847fb60d32224a642df629c0e06c 30-Mar-2012 Craig Mautner <cmautner@google.com> Merge "Move variables into animation class."
a608b882327fbb393bde3854953cd322a6fea675 30-Mar-2012 Craig Mautner <cmautner@google.com> Move variables into animation class.

Moved drawPending and commitDrawPending and associated methods from
WindowState to WindowStateAnimator.

Created mechanism for passing results from WindowAnimator to
WindowManagerService. Initial results passed are mUpdateRotation and
mWallpaperMayChange.

Change-Id: Ib03d28f921580ac9426ea9233bea6eafc9ea964c
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a3fabff98590d26f0c362cb09dc378fece66215c 28-Mar-2012 Michael Jurka <mikejurka@google.com> Add frame counter to dumpGfxInfo

Change-Id: I016f706e32cbdbce014795d8fc537b15c389dc7a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
15d5a964fd120766d049fddfc051d10eef5e440d 30-Mar-2012 Craig Mautner <cmautner@google.com> Merge "Remove obsolete variable masking valid one."
d87946ba48b62a6a83fd971ef7c4c419407db836 30-Mar-2012 Craig Mautner <cmautner@google.com> Remove obsolete variable masking valid one.

The mUpdateRotation variable was still in the WindowManagerService
mInnerFields object. This was masking the true mUpdateRotation found in
WindowAnimator.

Fixes Bug 6240025.

Change-Id: I6531002f870f30d22e19ba9af5cac86e1c7b9bcb
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a08f3e866a46c990e786defa95013ee0313b0887 30-Mar-2012 Jeff Brown <jeffbrown@google.com> Merge "Enable vsync traversals by default."
ebb2d8d708c5c58c79ae88ac2bd10450a856f702 24-Mar-2012 Jeff Brown <jeffbrown@google.com> Enable vsync traversals by default.

Improved how the various callbacks are managed and sequenced
to reduce code duplication.

Added a heuristic to avoid postponing traversals until
the next vsync frame if we did not actually do any drawing during
the previous frame. This helps in the very common case where
drawing occurs in response to input.

Change-Id: I277d9eeaf50408f8745a3cfd181db1d140770658
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c2f9be0b7fe14258e01d73f6bc43dd94c3e711d4 28-Mar-2012 Craig Mautner <cmautner@google.com> Move Surface operations out of WindowState.

Migrated the bulk of Surface operations from WindowState to
WindowStateAnimator. There remain a multitude of cross-referencing
between the two classes and most of the other classes in the wm
package.

Change-Id: I4bfdfb84be31341371f3ef311aca8fc6a4966692
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e7ae2505405cf30d9d3140278d5b9a2604d866df 27-Mar-2012 Craig Mautner <cmautner@google.com> Move wallpaper animations int WindowAnimator.

More refactoring. This time wallpaper animations were broken up from
WindowManagerService and the layout piece kept there while the
animation piece was moved into WindwoAnimator.

Also, applyAnimationLocked and applyEnterAnimationLocked were moved
from WindowManagerService to WindowState.

Change-Id: I05935023702ce05fdfdc804342ec14f719cdfea4
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
b3cbd0b4d827577b3b8ad34106779c67a48701dd 27-Mar-2012 Craig Mautner <cmautner@google.com> Merge "Refactor animation out of WindowState."
a2c77053b8dfa5f06bdd927bdbab4df2d00bb4e2 26-Mar-2012 Craig Mautner <cmautner@google.com> Refactor animation out of WindowState.

Remove the animation stepping from WindowState and move it into a new
class, WindowStateAnimator. Update all references to moved variables
in related files.

Change-Id: I7540d8f897b370c73975f3ffe450140861cb0cd1
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4accb6a88bcd8521db1cd7cf438abd292e38741e 26-Mar-2012 Michael Jurka <mikejurka@google.com> Fix bug: don't show system bar in app thumbnails

Bug: 5953608
Change-Id: Ib730638fe130f287ff446db0c6cd42efc5746c5c
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
cf8cbbe77447d9cca28e789c5ec4e714694ab37d 26-Mar-2012 Craig Mautner <cmautner@google.com> Skip layout if performShow fails.

In cases where a Surface does not go from hidden to shown, do not set
the perform layout flag. This keeps us out of repeated passes through
the layout code.

Fixes bug 6222487.

Change-Id: I22601bef5733d2f996a8cbdd50d6b89517bc3122
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
d5f2374e13a7bcefbc7252b814d128794f22af93 24-Mar-2012 Craig Mautner <cmautner@google.com> Merge "Reset layout needed at each animation step."
bb1449b392b4fb14f17fa747c2261d7195405df3 24-Mar-2012 Craig Mautner <cmautner@google.com> Reset layout needed at each animation step.

The member variable WindowAnimator.mPendingLayoutChanges was never
being reset to 0. Consequently once it was set it was causing endless
calls to the layout method.

Fixes bug 6208114, 6220403, 6219546.

Fixed NPE in RecentsPanelView.

Change-Id: Ie529b8f31e535543cb5ae0af9447146306b14eeb
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
8078d8c8a282ca81344febe7256f63b1e805e3aa 20-Mar-2012 Dianne Hackborn <hackbod@google.com> Add new thumbnail animation.

Use it for recent tasks switching.

Not perfect yet by far, but something.

Also fix issue #6186758: Twitter crashes after tapping on a tweet on JRM75D

Change-Id: I49bf6c94aafde875ac652dedaf96d6c08cc9e7d2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
764983d16925daeeba3f29fd1f844187655d1386 22-Mar-2012 Craig Mautner <cmautner@google.com> Separate animation into separate class.

Introduction of the class WindowAnimator which takes care of all
animations stepping and Surface operations.

Change-Id: I78f1c269fa57df0616c08adbe156e3059709ae48
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
03273d00ce1d7b4ebde95994732dd80204ba7e68 21-Mar-2012 Craig Mautner <cmautner@google.com> Continue animations started from AppWindowToken.

Animations that were started from AppWindowToken.showAllWindowsLocked
were not setting mInnerFields.mAnimating and hence the animations were
not progressing. This resulted in popups such as menus and time/date
settings not showing up.

Fixes bug 6205076.

Change-Id: I4daae5895e64182328671e282331f14dd5561d5e
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
2fb98b147b58210604dfaf1482f635ce8d8a0575 21-Mar-2012 Craig Mautner <cmautner@google.com> Minor refactoring prior to major refactoring.

Removal of blur layer.
Deferral of Surface actions in BlackFrame from ctor to first use.
Combine common test into single method okToDisplay().
Remove redundant logic in DimAnimator.

Change-Id: I43af0415794a8f142803ce94d7e17539aafac67d
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
22ce1414a0073b5cddadf1da8475f6fb7b409e44 20-Mar-2012 Craig Mautner <cmautner@google.com> Fix flickering when starting and ending apps.

Surfaces were displaying animations in their entirety for a single
frame before the animation kicked in. This caused a flash on the
screen. By setting the animation to invisible (alpha=0) at their
start it makes no difference if they are displayed.

Fixed bug 6176540.

Removed redundant mDimAnimator.show call.

Change-Id: I47c1b0d38273b011d9115822a8476671d6a050fc
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
0059d3508f3c5346d4ea07d4ada3e1827e4c8a01 16-Mar-2012 Craig Mautner <cmautner@google.com> Fix black screen on app transition.

The layer adjustment to an animating window upon completion was masking
the window behind the mWindowAnimationBackgroundSurface, a DimSurface.
The DimSurface was not being hidden because the step was happening too
late. Swapping the order of performAnimationsLocked and
updateWindowsAppsAndRotationAnimationsLocked fixes this ordering issue.

Fixes bug 6185920.

Change-Id: I0ff64c019e821fa3a92505ac6351f2648897e592
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
bf90eaa5d2410bfb60ef84a0efcf3b5eb5022d9f 15-Mar-2012 Craig Mautner <cmautner@google.com> Separate layout ops from surface ops.

Further work to isolate layout from animation and surface operations.
Remove cruft and minor refactoring.

Change-Id: I6f910ed72c7c614996641c353870c2b2ab5e8bb4
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e32c30784191a9244a08450759471c934c85034c 12-Mar-2012 Craig Mautner <cmautner@google.com> Separate out animations from layout.

(Dianne) pulled the animation steps out of the layout. Changes to
exposed layers cause repeated calls to layout code.

Combined animation steps into start and finish animation code.

Change-Id: I3602d1d6249d20987d102a54e3a67a7a39361b55
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ad3a9bb628e912b39e10f8d8a8bde0badefd8bd0 09-Mar-2012 Craig Mautner <cmautner@google.com> Fix state machine sequence causing wallpaper flash.

Fixes bug 6127355.

Change-Id: Ie6894329829f78b3ff8936cfe5ed2933490db5d8
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
df813c03b16ed32c25a8c8fee82a7a98088ac940 09-Mar-2012 Jeff Brown <jeffbrown@google.com> Merge "Use the Choreographer for Drawable animations."
bb9908b828a8cfd5965553be66faa6af89973697 08-Mar-2012 Romain Guy <romainguy@google.com> Dispatch screen state change events to Views
Bug #6120957

Using this new callback, views can interrupt and resume their
animations or other periodic tasks based on the current state
of the display.

Change-Id: I398f4abd421e9c5f207107bf1009a7b92cf45daa
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7ae9d5faad5816f7e567ec1ec77e78d746cf7e5c 06-Mar-2012 Jeff Brown <jeffbrown@google.com> Use the Choreographer for Drawable animations.

Change-Id: Ifcbf33434bf3c32d1900fd0b3f5bde004604ce8a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7e4e561bc717a6eea4e0d06ec4173ad27420425f 05-Mar-2012 Romain Guy <romainguy@google.com> Ignore draw requests when the display is off

When WindowManagerService's events are enabled/disabled, the state of the
display is dispatched to the known windows. This allows ViewRootImpl to
ignore draw requests until the screen is turned back on. This can potentially
lead to significant battery savings. For instance, a launcher widget showing
a repeating animation will cause the CPU and the GPU to wake up regularly
without this change.
(Change submitted by Intel and merged manually)

Change-Id: I7f93b0e60c3e6de1705f619e80860c36b1cdb978
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
86add4350c228a9a33c71d695098ea8ba7c7c275 03-Mar-2012 Craig Mautner <cmautner@google.com> Fix reference to wrong ArrayList.
Fixes bug 6107296.

Change-Id: I44f2793c1c92686b276e491436a10be4f18c0d48
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a731cd302dc39deaf835aeb52af12f391806a4bf 03-Mar-2012 Craig Mautner <cmautner@google.com> Fix rotation so orientation changes aren't dropped.
Modify test so that rotation animation is entered one final time after rotation completes. This last time causes mUpdateRotation to be set true forcing a test for orientation change.
Fixes bug 6109189.

Change-Id: I25475f336a3439a56b1c540205d09ee48c1d2b7c
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
dbb7991b4e4638b284814b50e79cacc1e1c9d8cd 02-Mar-2012 Craig Mautner <cmautner@google.com> Separate animation steps into start, step and finish phases.
Fixes bug 6089126.

Change-Id: Iafbde36ff719640335a7ecf762e1d991cf7915e4
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
343511c9ec6a7a1d3760f784824a64e732f3b7a2 29-Feb-2012 Craig Mautner <cmautner@google.com> Detect animation completions like we used to.
Previous approximations weren't indicating completion and windows weren't being layered correctly as a result.

Change-Id: I08fcd278485bb87dc10bca257b9f8073108753f3
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ba64dfe8728318f1a0db7547d0cc3f27f3a22766 28-Feb-2012 Craig Mautner <cmautner@google.com> debug

Change-Id: I1f496bb71068b6c3a09095c39fb04c9f4153e051
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
83eaab5b43e479c85dc112a1f9b3e53e907bae1f 28-Feb-2012 Craig Mautner <cmautner@google.com> Fix bug introduced when moving animation step out from between assignments to wasAnimating and nowAnimating.
Now wasAnimating once again contains the animation state prior to the animation step.

Change-Id: I2b53bd3f62228183233ab36f0ebe44c0344d2351
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
b8678d76c3e09d0d65255f3971b6112a48e19099 23-Feb-2012 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 210c1a26 to master

Change-Id: Ic44193e62215086c22225f2def5eee3159d26ae8
5489e4af193e7e57ac5af4f6ea2632f5df5bda80 22-Feb-2012 Craig Mautner <cmautner@google.com> Merge "- Consolidate all animations in a single place outside of layout loop. - Move mPolicy.startAnimationLw and mPolicy.finishAnimationLw into same method as mPolicy.animatingWindowLw. - Fix first parameter of performLayoutLockedInner(initial, ...) to pass true on initial pass."
f3b7653c1564fc9914640c1c734a15b97566042b 21-Feb-2012 Dianne Hackborn <hackbod@google.com> am 01011c3d: Fix issue #6037252: Screen shifts after all apps are upgraded

* commit '01011c3d7ce4f76c1a76b33a04fc63da784ddbea':
Fix issue #6037252: Screen shifts after all apps are upgraded
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/services/java/com/android/server/wm/WindowManagerService.java
2f995a7eaa1aba2c038c698039ed6837dfe7e51e 21-Feb-2012 Craig Mautner <cmautner@google.com> - Consolidate all animations in a single place outside of layout loop.
- Move mPolicy.startAnimationLw and mPolicy.finishAnimationLw into same method as mPolicy.animatingWindowLw.
- Fix first parameter of performLayoutLockedInner(initial, ...) to pass true on initial pass.

Change-Id: If1b47bb8a7e03cf427769c657e371abc0910b3e3
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
9806a2307f3e47e847ad5e62e302eab36d3eb3e4 17-Feb-2012 Jeff Brown <jeffbrown@google.com> Ignore broken input channel when finishing input event.

There are occasional races during application shut down where the
input dispatcher will close an input channel before the application
has finished its last event. So just ignore EPIPE.

Also tweak the logging for failed input event injection to make
it clearer which pid was trying to perform the injection.

Bug: 6013004
Change-Id: I7bbb01441d41762b03eafd4d39dcf0323e1cadf3
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4a06c8008b2edd6677f9a411af79b0a4971b87fe 16-Feb-2012 Jeff Brown <jeffbrown@google.com> Simplify Choreographer API.

Removed the listeners and schedule animation / draw methods.
Instead all requests are posted as one-shot callbacks, which is a
better match for how clients actually use the Choreographer.

Bug: 5721047
Change-Id: I113180b2713a300e4444d0d987f52b8157b7ac15
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4dcece8e509027cd28e20b1f9f14d2c0446d84c0 10-Feb-2012 Dianne Hackborn <hackbod@google.com> Fix issue where screen rotations would stop animating.

If we went through the update loop multiple times, and had finished
animating the first time, we would blow away that information the
second time and never kill the animation.

Also moved killing the animation back up to the animation step --
this involves destroying surfaces and such, and so really should
be done as part of the surface transaction. We can also consider
the screen rotation animation object to be owned by the animation,
so it can destroy it when done.

Change-Id: If24356c509c66d046f2ddfd9ad5bfe12504d7716
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
61ac6bb250494db602b485491a493b64776eaf3b 03-Feb-2012 Craig Mautner <cmautner@google.com> Extract code from performLayoutAndPlaceSurfacesInnerLocked() into multiple methods.

Change-Id: I80152c38741ce73b92da9483cfed84efbac34f89
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
659793bcd0e0d08306d841f3836a891e56e4e756 02-Feb-2012 Chet Haase <chet@google.com> Merge "Add Developer Option setting for Animator scaling."
c38fa1f63674971f9ac6ced1a449fb81026b62f7 02-Feb-2012 Chet Haase <chet@google.com> Add Developer Option setting for Animator scaling.

This new setting allows users to set a scale factor for the
duration and startDelay of all Animator-based animations. This
setting is very similar to the Transition animation scale and
Window animation scale settings, except this one applies specifically
to Animator animations. The property is only accessible by users
through the Settings UI, not programmatically. The value applies
system-wide and is picked up per-process at the time of the first
ValueAnimator construction.

This is an update to a previous CL; this approach uses the WindowManager
to store the animator scale settings, instead of SystemProperties.

Change-Id: I8295fab060aa6d597ae507ded8f9c9d6077be966
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
8bcd54b98ad5d98d47364ff14e06910deadf9302 01-Feb-2012 Dianne Hackborn <hackbod@google.com> Use Choreographer for window manager animation timing.

Change-Id: Ic34aff698c63d383ecd06af7da9957475683a1db
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
08cec4ee46f8b99a202b775c4eed8699be5165e8 24-Jan-2012 Dianne Hackborn <hackbod@google.com> am a5853595: am 47163685: Merge "Another attempt at issue #5823276: home repaints after full-screen app is exited" into ics-mr1

* commit 'a5853595165a6395ca41bbc17a3dd88e12259ad1':
Another attempt at issue #5823276: home repaints after full-screen app is exited
4fdbe9e55026b490d74eb36b0afb1e95836c501c 24-Jan-2012 Dianne Hackborn <hackbod@google.com> am 47163685: Merge "Another attempt at issue #5823276: home repaints after full-screen app is exited" into ics-mr1

* commit '47163685eb90f9520e7ae0ac0984b4e1535e8e5b':
Another attempt at issue #5823276: home repaints after full-screen app is exited
47163685eb90f9520e7ae0ac0984b4e1535e8e5b 24-Jan-2012 Dianne Hackborn <hackbod@google.com> Merge "Another attempt at issue #5823276: home repaints after full-screen app is exited" into ics-mr1
b7ff51bde92b76757a002bb5b1889f5790986513 24-Jan-2012 Dianne Hackborn <hackbod@google.com> Another attempt at issue #5823276: home repaints after full-screen app is exited

This is between the two previous attempts. I returned the part from the
original that was breaking gallery, but have some new code to detect when
something about the window params has changed that would require a
layout pass to make sure we still do a layout then, even if the window is
not currently visible.

Change-Id: I07745e1f66022583e3076b84cc8bbe8bd2acd48f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
eda775cc89b862e0637af132d78168e1b28820f8 24-Jan-2012 Jim Miller <jaggies@google.com> am 9f080e2a: am 44760b10: Merge "Revert "Fix 5797764: Increase lock screen\'s thread priority"" into ics-mr1

* commit '9f080e2a5bc6a268934e32201c69ea8a86900396':
Revert "Fix 5797764: Increase lock screen's thread priority"
879693917dcd007e3ba9ece63d9e8244758171ef 24-Jan-2012 Jim Miller <jaggies@google.com> am 44760b10: Merge "Revert "Fix 5797764: Increase lock screen\'s thread priority"" into ics-mr1

* commit '44760b106a4bafcf83fb356bf91683db40e0e5a2':
Revert "Fix 5797764: Increase lock screen's thread priority"
44760b106a4bafcf83fb356bf91683db40e0e5a2 24-Jan-2012 Jim Miller <jaggies@google.com> Merge "Revert "Fix 5797764: Increase lock screen's thread priority"" into ics-mr1
54dbbce1c3cd3b534b0bf7cb15c85f966ed029b7 24-Jan-2012 Jim Miller <jaggies@google.com> Revert "Fix 5797764: Increase lock screen's thread priority"

This reverts commit 6d6a70a33746ef5147ab146f1802f0db424dd2f1

This doesn't appear to have a measurable impact for this issue.
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
fd1c5ed3705b885ce50b5ecad04ce699248b1d84 13-Jan-2012 Dianne Hackborn <hackbod@google.com> New screen rotation animation design.

We now have an animation that can start as soon as we detect to
rotate the screen, and have a different phase once the new UI
is ready to complete the transition into it.

Change-Id: I05b9c12a699232acbddc36b4a994a4452db71476
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
8ffd2cccf0f0458b941d2a3c69d30a6ae06fc33b 23-Jan-2012 Jim Miller <jaggies@google.com> am b1c7785c: am eaa11a72: Merge "Fix 5797764: Increase lock screen\'s thread priority" into ics-mr1

* commit 'b1c7785c1110e171d3dd3deb259b1caeed0b9da6':
Fix 5797764: Increase lock screen's thread priority
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.
374fa7dbbc91730315daeca7f2de7e64b932f51f 21-Jan-2012 Jim Miller <jaggies@google.com> am eaa11a72: Merge "Fix 5797764: Increase lock screen\'s thread priority" into ics-mr1

* commit 'eaa11a723150f1ea79446d7ba4bf77eb47b73337':
Fix 5797764: Increase lock screen's thread priority
eaa11a723150f1ea79446d7ba4bf77eb47b73337 21-Jan-2012 Jim Miller <jaggies@google.com> Merge "Fix 5797764: Increase lock screen's thread priority" into ics-mr1
6d6a70a33746ef5147ab146f1802f0db424dd2f1 20-Jan-2012 Jim Miller <jaggies@google.com> Fix 5797764: Increase lock screen's thread priority

This increases lock screen's thread priority from THREAD_PRIORITY_FOREGROUND
to THREAD_PRIORITY_DISPLAY to ensure it runs before other activities that
might stall lock screen when the screen turns on.

Change-Id: I14cf9f3f5c092817bc6cf2d0a254001a5d34f744
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
4be9cff46e82bbb608f91fd3c9ed9fca3cf14e8b 20-Jan-2012 Dianne Hackborn <hackbod@google.com> am 1bae8066: Merge "Fix issue #5823276 again: home repaints after full-screen app is exited" into ics-mr1

* commit '1bae80668cc1d12bb4a4b93bce1960b2601de131':
Fix issue #5823276 again: home repaints after full-screen app is exited
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/services/java/com/android/server/wm/WindowManagerService.java
b800f277cb02f0639b66ecaf0798b30419486ab7 20-Jan-2012 Justin Ho <justinho@google.com> am 820b45c0: Merge "DO NOT MERGE Revert "Fix issue #5823276: home repaints after full-screen app is exited"" into ics-mr1

* commit '820b45c0a21980a43532b9fb9823f8aa08c64a15':
DO NOT MERGE Revert "Fix issue #5823276: home repaints after full-screen app is exited"
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/services/java/com/android/server/wm/WindowManagerService.java
3bb3d41adbd78ab690378531d37aec369c79ead7 19-Jan-2012 Jim Miller <jaggies@google.com> am 230a7092: Merge "Fix 5863053: Add method to lock screen immediately." into ics-mr1

* commit '230a709285abc5dfd92f05d91a8997d52a59d3c7':
Fix 5863053: Add method to lock screen immediately.
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/services/java/com/android/server/wm/WindowManagerService.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
defda4de3d5965e87bdd8fedb248d6cd948ecb9d 13-Jan-2012 Dianne Hackborn <hackbod@google.com> am 2e282f35: Merge "Fix issue #5823276: home repaints after full-screen app is exited" into ics-mr1

* commit '2e282f35b009fe4c23daca35592dae2032641643':
Fix issue #5823276: home repaints after full-screen app is exited
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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
bf30ac71a9bcfc97391dda650176f9a1f7146ecc 30-Nov-2011 Dianne Hackborn <hackbod@google.com> am 88f10c6c: Merge "Fix issue #5679504: Device stuck and sudden reboot - Watchdog reset?" into ics-mr1

* commit '88f10c6ce5a97b1990934148deb8ed6aa6ef7a48':
Fix issue #5679504: Device stuck and sudden reboot - Watchdog reset?
1fbee79eb31011fa260d9fe088c165cc9171d98b 30-Nov-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5679504: Device stuck and sudden reboot - Watchdog reset?

Calls to get the display size no longer need to acquire the global
window lock.

Change-Id: I751ea6ed0e20f1f521783f4bd5a8f9c31cd43573
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5e3064c67fc56440a7d199aab00ea5f74dca5039 29-Nov-2011 Dianne Hackborn <hackbod@google.com> am b54980d1: Merge "Fix issue #5588689: Black camera preview after coming back from gmail" into ics-mr1

* commit 'b54980d1d4d903f68cdfa952256afff01902cd94':
Fix issue #5588689: Black camera preview after coming back from gmail
6d05fd3c795088ac60f86382df5a66d631e8a0cb 19-Nov-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5588689: Black camera preview after coming back from gmail

Make surface management between SurfaceView and the window manager
much more controlled, to ensure that SurfaceView always gets to report
the current surface is destroyed before the window manager actually
destroys it.

Also a small tweak to allow windows that have a wallpaper background
to still have a preview window. This makes launching home after it
has been killed feel much more responsive.

Change-Id: I0d22cf178a499601a770cb1dbadef7487e392d85
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
2502262ddfd8dfedccd61df8967a35eba8e9a0ca 15-Nov-2011 Michael Jurka <mikejurka@google.com> am 4b7494e0: Merge "Updating recent apps visuals on tablet" into ics-mr1

* commit '4b7494e07a44c0aa363379be463de70455a895f3':
Updating recent apps visuals on tablet
bfd24acd318ef958bb7997c9cbf95c5fb15b10ac 13-Nov-2011 Michael Jurka <mikejurka@google.com> Updating recent apps visuals on tablet

- getting rid of blue glow (5529032)
- moving app icon position
- show message if there are no recent apps (5533332)
- fixing rare IllegalStateException on orientation change (5584344)

Change-Id: I2210e584957869c8f02339e6841daf39364a9dad
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
391545ed2251909a9576d942eff82c67bf5fe6d9 12-Nov-2011 Dianne Hackborn <hackbod@google.com> am be70785f: Make activity manager more robust in the face of app activity leaks.

* commit 'be70785f9b2dbd2c52fd8676d99bc64b22784201':
Make activity manager more robust in the face of app activity leaks.
be70785f9b2dbd2c52fd8676d99bc64b22784201 11-Nov-2011 Dianne Hackborn <hackbod@google.com> Make activity manager more robust in the face of app activity leaks.

This came up from bug #5601885: Memory increase (leak?) in system_server
Stingray MR1

This isn't *really* a leak in the system process -- it is a leak in an
application process that is causing the system process to keep around
a bunch of ActivityRecord objects longer than it should, until that app
process is ultimately killed.

Unfortunately these days leaking an ActivityRecord also often means
leaking a thumbnail, which is a big slab of memory.

So make the activity manager better about this, using a weak reference
from the handle the object has so we can still clean away most of the
state associated with the ActivityRecord even if the client side leaks
its own reference.

Change-Id: Idbab45e09749cdfb54899203da7981e7b3576e25
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e5249ecbf4977cd185df6b0a52d713ded27c56b9 10-Nov-2011 Dianne Hackborn <hackbod@google.com> am 0f70e482: Merge "Fix issue #5470311: Activity with android:configChanges defined..." into ics-mr1

* commit '0f70e482c8aa7ce9c5676b1226ff98b63fb991e7':
Fix issue #5470311: Activity with android:configChanges defined...
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/services/java/com/android/server/wm/WindowManagerService.java
308b327fb6aa01bf4b34a937d74d62ad7dcc0629 05-Nov-2011 Mathias Agopian <mathias@google.com> am 3f24589e: Merge "workaround to set the WM refresh rate to 48 Hz for tuna devices only" into ics-mr1

* commit '3f24589edd860618ccf65d6653b002d13810e78b':
workaround to set the WM refresh rate to 48 Hz for tuna devices only
222357f33a105ce08177b94334c7d14af29df8f6 05-Nov-2011 Mathias Agopian <mathias@google.com> workaround to set the WM refresh rate to 48 Hz for tuna devices only

this is TEMPORARY until we can do this properly.

Bug: 5572464
Change-Id: I6537706d636a83a4a50e2900d6b829dd89b6f245
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a243a6befe8f7d4352130edbfdec443366ba1ef1 04-Nov-2011 Dave Burke <daveburke@google.com> am a3af4c94: am 3ee47188: Frame rate to 48 fps

* commit 'a3af4c94dfbf3336004a38011f6453bfcd7fd638':
Frame rate to 48 fps
a3af4c94dfbf3336004a38011f6453bfcd7fd638 04-Nov-2011 Dave Burke <daveburke@google.com> am 3ee47188: Frame rate to 48 fps

* commit '3ee471889b09d90affddd00c409a515a64b6861b':
Frame rate to 48 fps
3ee471889b09d90affddd00c409a515a64b6861b 04-Nov-2011 Dave Burke <daveburke@google.com> Frame rate to 48 fps

Change-Id: I95645b3921db22dfeca97ad2743299ccda5de83b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
88175571f23ca7cff6d21cd1d5d6345cfacaa84a 01-Nov-2011 Dianne Hackborn <hackbod@google.com> am f136aa34: Merge "Various performance and other work." into ics-mr1

* commit 'f136aa341abaaf7fd6f7632d41a30b2989d93985':
Various performance and other work.
2c84cfc001fb92a71811bf7384b7f865ff31ff9d 31-Oct-2011 Dianne Hackborn <hackbod@google.com> Various performance and other work.

- IME service now switches between visible and perceptible depending on
whether it is being showm, allowing us to more aggressively free its
memory when not shown.

- The activity display time is no longer delayed by the activity
transition animation.

- New -R (repeat) option for launching activities with the am command.

- Improved some documentation on Loader to be clear about some methods
that apps should not normally call.

- FrameworkPerf test now allows you to select individual tests to run.

Change-Id: Id1f73de66dc93d63212183958a72119ad174318b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
92537e6ff21d4b20738fae851c2174ea568eb843 31-Oct-2011 Ed Heyl <ed@google.com> merged by hand (services/java/com/android/server/PowerManagerService.java needs to be reviewed)

Change-Id: I86d1111d86cd1646ebc8a88d58aa393089e9f928
a8e5a2bcd6a0d35893187c6df42425c03be005da 28-Oct-2011 Chet Haase <chet@google.com> Optimize handling of scrolled wallpapers

Swiping the home screen causes the WindowManagerService to do
a bunch of work to keep the wallpapers in sync. First, it lays out
and places all windows. Also, it notifies the SystemUI process that
the wallpaper position has changed.

The layout/place operation is too much work - we only need to set
the position values for the wallpaper, not relayout the whole system.

The notification mechanism must exist, but should be optional. Most
wallpapers don't care (especially static ImageWallpapers). So we'll
give them a new API (WallpaperService.Engine.setWantsOffsets()) to
allow wallpapers to opt out of this process and avoid the performance
overhead.

Change-Id: I66c38375438937f14f6f5550565b28eb204b1e06
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
d070dca89fdd40b6abf0862af6c49538775905d1 13-Sep-2011 Mike Lockwood <lockwood@android.com> Fix problems dispatching media button events on headless devices

Change-Id: I57444f2b0b51b08fda561d5acecb66316fb3f4a7
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a0a8b249bcae9d05c4c973e7bfe23fcb40227f52 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.

Change-Id: I96606609a4ede57a2c4c7fb2b6ff060ebf31e3b4
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
c6592d2eb808befedc3d9c842b61e21cc6bedbf3 26-Oct-2011 Dianne Hackborn <hackbod@google.com> am 67a1b7d6: Merge "Fix issue #5508024: Rotation jank seen in live wallpapers" into ics-mr0

* commit '67a1b7d6e5857d0ecdd1aa9d50d10189e5776c11':
Fix issue #5508024: Rotation jank seen in live wallpapers
3ec891ae8067dd7afac5c0b5a8af0b726f4a4726 25-Oct-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5508024: Rotation jank seen in live wallpapers

Fix a few places where we would unfreeze the screen too early.
Now that we are no longer relying on surface flinger freezing, we
can't depend on it keeping the screen frozen until surfaces get
drawn.

Change-Id: Icb03bf30c9599a5e2016817bfa5ca6458adc7249
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
cef37fb481d16eda2b304887a8738ed599bc1b21 24-Oct-2011 satok <satok@google.com> Fix a bug where surface crashes when the enter animation starts while the exit animation has not yet finished

Bug: 5446482
Change-Id: I2e9f2e91ab5e8b22896d12e08fac76c72c997274
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
36991744a221c30a47085442e6416bdde40b85e8 12-Oct-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5445966: WindowManager reporting -long on prime when it shouldn't be.

The window manager now uses the app screen dimensions to compute
the various configuration properties, as it should.

This means that prime is official a "not long" device. Poor prime.
It probably feels inadequate now.

Because it is.

Oh and all that other stuff? Debugging logs. Turned off. And
why the heck not, debugging logs are great.

Change-Id: Iaaf8ef270d986d34fd046d699ef4c0ecea1981fc
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e2909e121c45d58fe587849b1474c80745fcd2b9 11-Oct-2011 Jamie Gennis <jgennis@google.com> SurfaceFlinger: update orientation via transactions

This change merges the ISurfaceComposer::setOrientation functionality
into ISurfaceComposer::setTransactionState. It enables the window
manager to atomically update both the display orientation and the
position and size of the windows in a single transaction with
SurfaceFlinger.

Bug: 5439574
Change-Id: I18a8ccc564d7d760ef8afb2d015ccdb7a7963900
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
58f42a59bda3bc912d0d2f81dc65a9d31d140eaa 10-Oct-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5405788: Device continuously opening and closing...

...the "Complete action using" dialog

When an application goes idle, it sends back to the activity manager
the configuration it last used, to make sure the two don't get out
of sync. Fix a bunch of edge cases here in dealing with that, and
be sure to also send the current configuration when launching an
activity so the client is always up-to-date when launching.

Also a small fix to not show the upgrading dialog during first boot.

Change-Id: I14ed366a87cd689d1c78787369e052422290ac6f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
4dfce20cac7492882d366d053006795aefad59da 05-Oct-2011 Jeff Brown <jeffbrown@google.com> Make SENSOR orientation modes trump rotation lock.
Bug: 5371750

Change-Id: I4d18b6c8ba1de0afd5929ddb8d7123272e35fbe2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
edc633170fb28fd17395472d000875f19d157e18 05-Oct-2011 Dianne Hackborn <hackbod@google.com> Merge "Always unfreeze display."
161dc80ea754d987a905bc5814872168d581040d 05-Oct-2011 Dianne Hackborn <hackbod@google.com> Always unfreeze display.

Change-Id: I7a0f3be49fe723fe59cf6268861bc5fe7f49bc62
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
09e5b9daf3c675b8943015abb3b420fd45f19fe8 05-Oct-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5388352: font size change back to normal

This is another place where we are messed up by the stupid default
Configuration having a 1.0 font scale. Argh.

Change-Id: Iaa2550d4edab92fb8a52f98fbb9fd8ef5fab94b5
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
09bd49a8a74cafe7f03aee769bfe0748bf3c2b51 16-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5328235: Wrong values for smallestScreenWidthDp

Maybe.

Change-Id: I88dfde1626376b3003bdd7a8068c55545255851e
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
d02a9e95f4cf6295f1a060b4e31c6fbe41123649 12-Sep-2011 Dianne Hackborn <hackbod@google.com> Get rid of some animation flickers and other bad things.

Change-Id: If7606286bf0bd01cf023d57719ccb27e39d5564c
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
8962028b6e2f4176e6ceded281e584d223e44982 11-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix inflating of animations.

Need to define attributes for animation set, to have correct indices.

Also small fixes elsewhere.

Change-Id: If596147e8aee4ebffe4e184872070341eff6df73
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
905577f6345c014fc2489a8068ea967ba8c18012 08-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5263361: Browser instance not created in application picker

The resolver activity was hiding the following activity from recents.

Also some other fixes: a little better memory use debugging, removed
some unneeded code from window manager, moved some system activities
into their own process, added some more running process information for
manage apps.

Change-Id: I66687d16989ff965d524b92dc360f37c19199717
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7de6578f1c4bf97c9f856f819d4985d25163012a 02-Sep-2011 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #4974633: Block the HOME button using TYPE_KEYGUARD"
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/services/java/com/android/server/wm/WindowManagerService.java
0e60db221c80bb1c57eaa7989b7079e5ba5a27a4 01-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4974633: Block the HOME button using TYPE_KEYGUARD

Applications shouldn't be able to change their window type after
the window is added to the window manager.

Change-Id: Iac63da65f96fb30683f68f8d89c3fd29199a750c
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
9d4bc852ea459c2a4347a87ce0357b3328a25db8 31-Aug-2011 Jeff Brown <jeffbrown@google.com> Merge "Fix input channel leak. Bug: 5156144"
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/services/java/com/android/server/wm/WindowManagerService.java
9e4e727b4a164c17944e8ae6eb2d2532a98737f8 30-Aug-2011 Dianne Hackborn <hackbod@google.com> Fix issues #5233826 and #5209847 -- live wallpapers.

5233826 when a live wallpaper starts, it does so regardless of its visibility

The WallpaperService is now very forceful about telling a wallpaper it is
not visible when it first starts.

5209847 Make launcher turn off the wallpaper in all apps.

Fix a bug in the window manager that would not correctly handle the wallpaper
flag changing.

Change-Id: Ie3314043a84664be72a1304a1705408efd789a15
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
67ed6c7224b902ae56a109701a241210e18cf721 28-Aug-2011 Adam Powell <adamp@google.com> Fix bug 5133509 - Align holo menu panel windows along the bottom of
the screen

Alter preferred options panel gravity policy.

Integrate new menu panel assets for holo apps.

Change-Id: I9fa98ed9359148ea6d1f1d1e727ddcd437b16e2f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
cfb9f2bca39772aecd072e2a30342a67b6319bbb 24-Aug-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5192141: systemui asplodes after enough tapping on the windowlist button

Change-Id: I5afb2d54b531d9eac9435660616579324f239812
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
d9be36c897680361da2daadba9bbc9da3c16329b 17-Aug-2011 Christopher Tate <ctate@google.com> Don't crash if a drag recipient throws an uncaught exception

There turn out to be two distinct bugs leading to runtime restarts.

The first, dating from at least Android 3.1, is that following certain kinds
of app crashes we properly clean up the drag-state bookkeeping, but aren't
prepared in the case of the drag-target timeout clock firing with a now-
null drag state in effect. We now catch that edge condition and don't NPE
(and note that there was already similar code around the separate timeout
when an app is *starting* the drag process).

The second bug is that some new-in-ICS code in the input channel management
wasn't prepared for certain cases where the current touch window could have
become unusable and its input channel torn down summarily in the case of the
aforesaid app crash during drag. The code now makes sure that there really
is an input channel that needs to be flushed / cancelled prior to attempting
that operation.

Fixes bug 5173534

Change-Id: Idaae158ecfb4b93456ab1425769b669962893c00
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
8b65c902ee25e9c38f64eef9f7af0cf9e86491e3 15-Aug-2011 Jeff Brown <jeffbrown@google.com> Merge "Use PARCELABLE_WIRTE_RETURN_VALUE flag in InputChannel. Bug: 5161290"
0a0ab128a65900a23f1018a14f5cbecec6443dd3 13-Aug-2011 Jeff Brown <jeffbrown@google.com> Use PARCELABLE_WIRTE_RETURN_VALUE flag in InputChannel.
Bug: 5161290

Replace mDisposeAfterWriteToParcel with code that takes advantage
of the standard Parcel API support for releasing resources after
writing a Binder reply.

This change makes it less likely that InputChannels will leak
accidentally when passed across a Binder.

Change-Id: Id37706e7b88d074e8e4ac687c88f0db8963200f2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7c0d8472d003334fafd14f7c1e7d95dbd213088b 13-Aug-2011 Dianne Hackborn <hackbod@google.com> Merge "Fix some crashes that are happening in the system process."
8e8d65ff5fdef12c6af3d003dfef19aadc39bea9 12-Aug-2011 Dianne Hackborn <hackbod@google.com> Fix some crashes that are happening in the system process.

- When shutting down, if the screen goes to sleep there is code
that tries to do a notifyAll without holding the lock:

java.lang.IllegalMonitorStateException: object not locked by thread before notifyAll()
at java.lang.Object.notifyAll(Native Method)
at com.android.server.am.ActivityStack.checkReadyForSleepLocked(ActivityStack.java:776)
at com.android.server.am.ActivityStack$1.handleMessage(ActivityStack.java:282)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at com.android.server.ServerThread.run(SystemServer.java:603)

- If an invalid Uri object is sent to the system process it can crash because
the Uri class throws an assertion while unmarshalling. Change this to an
IllegalArgumentException so it gets sent back to the caller:

java.lang.AssertionError
at android.net.Uri$PathPart.readFrom(Uri.java:2224)
at android.net.Uri$HierarchicalUri.readFrom(Uri.java:1106)
at android.net.Uri$1.createFromParcel(Uri.java:1689)
at android.net.Uri$1.createFromParcel(Uri.java:1681)
at android.content.IContentService$Stub.onTransact(IContentService.java:53)
at android.content.ContentService.onTransact(ContentService.java:120)
at android.os.Binder.execTransact(Binder.java:338)
at dalvik.system.NativeStart.run(Native Method)

- StrictMode can try to access the first index in the stack crawl of a stack crawl
array of length 0. Not sure why this happens, but make the code more robust:

java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at android.app.ApplicationErrorReport$CrashInfo.<init>(ApplicationErrorReport.java:341)
at android.os.StrictMode$ViolationInfo.<init>(StrictMode.java:1978)
at android.os.StrictMode$AndroidBlockGuardPolicy.startHandlingViolationException(StrictMode.java:1097)
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1068)
at libcore.io.BlockGuardOs.read(BlockGuardOs.java:137)
at libcore.io.IoBridge.read(IoBridge.java:426)
at java.io.FileInputStream.read(FileInputStream.java:179)
at java.io.InputStream.read(InputStream.java:148)
at com.android.internal.os.ProcessStats.readFile(ProcessStats.java:804)
at com.android.internal.os.ProcessStats.getCpuSpeedTimes(ProcessStats.java:564)
at com.android.internal.os.ProcessStats.getLastCpuSpeedTimes(ProcessStats.java:545)
at com.android.server.am.ActivityManagerService.updateCpuStatsNow(ActivityManagerService.java:1470)
at com.android.server.am.ActivityManagerService.batteryNeedsCpuUpdate(ActivityManagerService.java:1522)
at com.android.internal.os.BatteryStatsImpl$MyHandler.handleMessage(BatteryStatsImpl.java:110)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1302)

(Also fix this code to not cause strict mode to trigger at all, because there is
no need, because this is just reading stuff from /proc.)

- The system seems to crash during boot if it thinks it needs to rotate
the screen, when it is trying to take the freeze snapshot way too early.
There is no need to freeze the screen during boot or if the screen is off:

java.lang.NullPointerException
at android.view.Surface.init(Native Method)
at android.view.Surface.<init>(Surface.java:256)
at com.android.server.wm.ScreenRotationAnimation.<init>(ScreenRotationAnimation.java:91)
at com.android.server.wm.WindowManagerService.startFreezingDisplayLocked(WindowManagerService.java:8758)
at com.android.server.wm.WindowManagerService.startAppFreezingScreenLocked(WindowManagerService.java:3971)
at com.android.server.wm.WindowManagerService.startAppFreezingScreen(WindowManagerService.java:4003)
at com.android.server.am.ActivityRecord.startFreezingScreenLocked(ActivityRecord.java:515)
at com.android.server.am.ActivityStack.ensureActivityConfigurationLocked(ActivityStack.java:3997)
at com.android.server.am.ActivityManagerService.updateConfigurationLocked(ActivityManagerService.java:12535)
at com.android.server.am.ActivityManagerService.updateConfiguration(ActivityManagerService.java:12439)
at com.android.server.wm.WindowManagerService.systemReady(WindowManagerService.java:6161)
at com.android.server.ServerThread.run(SystemServer.java:521)

Change-Id: I85062bb5f6b0909a0f52feedaa75e7611d9d7fbd
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
e99adc70c8e0a64cb8d13a2ec4c125adaf18904d 12-Aug-2011 Michael Jurka <mikejurka@google.com> On device startup, be in touch mode

- Solves bug where an icon showed focus state on startup in Launcher. Once the keyboard arrows are used, Launcher enters non-touch mode as usual

Change-Id: I0080f3b72f6c22833c600a1026af0abc35024510
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a44abeb125a0c8a8e5a065f868d316e41354286a 09-Aug-2011 Dianne Hackborn <hackbod@google.com> Improve window manager debug output.

Cleaned this up while I was debugging another issue.

Change-Id: I0663b9ed581c6868b59655a0f994d870971ec1a6
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7d608423b721e0153f37bfd5eba78fcd2489562d 08-Aug-2011 Dianne Hackborn <hackbod@google.com> Move OOM kernel settings to activity manager.

The activity manager now take care of plugging the correct settings
into the OOM killer in the kernel. This is a lot cleaner because
it is really central to how the activity manager works, and nobody
else cares about them.

Taking advantage of this, the activity manager computes what it
thinks are appropriate OOM levels based on the RAM and display
size of the device.

Also a small optization to the package manager to keep a binding
to the package install helper for a bit after done using it, to
avoid thrashing on it.

And some new APIs that are now needed by Settings.

Change-Id: I2b2d379194445d8305bde331c19bde91c8f24751
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
dfee59afb3e4cdcde38f6338f9360655de76da92 06-Aug-2011 Adam Powell <adamp@google.com> Fix bug 5011824 - New Holo overflow menu for physical menu key devices

The new Holo-style overflow menu now appears from the edge of the screen
where the device's physical menu key can be found. The policy determining
this lives in getPreferredOptionsPanelGravity() in WindowManagerService.

Change-Id: I8851a2265547156591e82044e50b5cfc58d3eefa
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
6311d0a079702b29984c0d31937345be105e1a5e 03-Aug-2011 Dianne Hackborn <hackbod@google.com> Clear the bitmap from the canvas in a lot of places.

Change-Id: I6b2071ac7b348c473b9bdd1b972d095aebbb4fb3
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
bc68a59c024bdb745dac8e2ec7408a9f30595f1a 25-Jul-2011 Jeff Brown <jeffbrown@google.com> Report the external display size to the input reader.

The input reader needs this information so that it knows how to
interpolate touches on an external touch screen.

Changed Display so that it asks the WindowManager what the real
display size is (as opposed to the raw display size). This means
it now takes into the forced display size set by
adb shell am display-size.

Replaced all calls to getRealWidth() / getRealHeight() /
getRealMetrics() in the WindowManager and replaced them with direct
usages of the mCurDisplayWidth / mCurDisplayHeight so that the WM
doesn't end up making a reentrant Binder call into itself.

Fixed the table status bar HeightReceiver so that it updates the
height on all configuration changes since it is possible that the
display size changed independently of an external HDMI display
being plugged / unplugged.

Improved the Display class documentation to make the distinctions
betweeen the various sizes clearer.

Change-Id: I3f75de559d3ebffed532ab46c4ae52c5e7f1da2b
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
28637bacfdde4b2b110462c97fdd52854c5288d5 07-Jul-2011 Jim Miller <jaggies@google.com> Fix 4689527: Fix rendering issue with thumbnails on phones

This fixes a bug where the phone thumbnail scale was being miscalculated
for the square aspect of thumbnails on phones. The code now constrains
thumbnails to fit the smaller of screen width and screen height.

Change-Id: I174abacd4cf3dcf124e10fe8980fb01fe299ec6a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
58b868417755805ebdfe4feb65664ad98c00bf35 23-Jun-2011 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #4770360: older app compatibility mode is really tiny on ICS phones"
2b31d53161789358de57fd396716a6503855c5da 23-Jun-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4770360: older app compatibility mode is really tiny on ICS phones

We were applying the density compat mode scaling multiple times to
display metrics, causing bad values.

Change-Id: Iafafd9a5e94b9d774cd2715bf968e91602a1bd82
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
bd67cddd0d7b1f6e971228eeb883291875ba721f 22-Jun-2011 Dianne Hackborn <hackbod@google.com> Merge "Don't report a resize unless the window's surface actually changed."
b961cd2c80abf1d2834e5ad690904da4fe56d755 21-Jun-2011 Dianne Hackborn <hackbod@google.com> Don't report a resize unless the window's surface actually changed.

Change-Id: I133cf8e417753dba60d23a3bfc1c84ace983b335
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7961be75f4161769f620e44dec3f5911e50ebe03 21-Jun-2011 Svetoslav Ganov <svetoslavganov@google.com> AccessibilityNodeInfo bounds inconsistent with compatibility mode.

1. In compatibility mode a window wide scaling is applied to stretch
the content. However, AccessibilityNodeInfos retrieved from that
window contain bounds in application's view of the world and need
to be scaled to properly relect what a sighted user sees.

Change-Id: Iebbb99526fc327f45b5cede89ba8c32e6ebd8845
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
bc38d3e44e698f4db749c2feed34e13a94c54a1b 11-Jun-2011 Jeff Brown <jeffbrown@google.com> Merge "Optimize orientation changes."
24572375323dee79e3b456af07640ca194fd40bf 10-Jun-2011 Jeff Brown <jeffbrown@google.com> Optimize orientation changes.

Modified setRotation to allow it to restart a rotation in
progress as long as the rotation animation has not yet started.
This enables the system to recover more quickly from mispredicted
orientation changes.

Removed the call to System.gc() when freezing the display, which
added 60-80ms before we even started the orientation change.
We used to need this to make it less likely that an upcoming GC
would cause a pause during the window animation, but this is
not longer a concern with the concurrent GC in place.

Changed the wallpaper surface to be 32bit. This accelerates
drawing and improves the overall appearance slightly.

Reduced code duplication in the WallpaperManager.

Change-Id: Ic6e5e8bdce4b970b11badddd0355baaed40df88a
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7bbf6f7d11877496502c20e8998a6984ab05cd39 10-Jun-2011 Dianne Hackborn <hackbod@google.com> am 8297f669: am 3aabdeac: am 5ba2e872: Merge "Fix for not reporting correct "sw" in compat mode." into honeycomb-mr2

* commit '8297f669356ee997c5faa745815e8b9a7009fba7':
Fix for not reporting correct "sw" in compat mode.
f741e679c496f7345304a6543f01d7048e31d1a7 10-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of e2aa0490 to master

Change-Id: Id0448a1598fc93aca0652b29253e02586e35a067
48a7651823030ed3c0f4c084b423430044425fea 09-Jun-2011 Dianne Hackborn <hackbod@google.com> Fix for not reporting correct "sw" in compat mode.

Change-Id: Ia225c94b36ccc3589d417aafd5680247678eddfd
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
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/services/java/com/android/server/wm/WindowManagerService.java
aefc94f19acc29ae9b6abc32dcdbb2ff453984cb 08-Jun-2011 Dianne Hackborn <hackbod@google.com> am 4bd50588: am fc3fa5dc: am 1b405592: Merge "Fix issue #4539687: At least one compatibility-mode app (Androminion)..." into honeycomb-mr2

* commit '4bd505883df3d8ca7583d854f1c71302c615519d':
Fix issue #4539687: At least one compatibility-mode app (Androminion)...
bc7386c2615a7c496deea59ac1b5ab2da7f7b61f 07-Jun-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4539687: At least one compatibility-mode app (Androminion)...

...will only launch when held in portrait mode.

There was a bug in the window manager that caused all of the careful code to
update the configuration in sync with movements between activities to break.
Now it is fixed, so this app works, and we no longer see the bad slow orientation
changes when switching between activities that want to be in different
orientations.

Change-Id: I5d93f99649849bdaca2e8bebade6b91b8b6cf645
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
7218d830e27d81141588cd6e37f206d141a18f62 04-Jun-2011 Jeff Brown <jeffbrown@google.com> resolved conflicts for merge of ca2b552d to master

Change-Id: I2f3693a59042ac5aa2d7bcdc3a504c78dc99a18b
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.
1a84fd1fb7a51f3fe4f8865e1cdd09f3490f696c 02-Jun-2011 Jeff Brown <jeffbrown@android.com> Add a preference panel for mouse speed.

Bug: 4124987
Change-Id: I3ce175d268a1d043cf5878481261b1049a15a149
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ed60f81940c5f2125518c7c31ad4f61b8a9baf3e 02-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 76450622 to master

Change-Id: I26ccd8f264e65f100d894f43cf597a781552db83
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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
8c1132e3ceed8e1a8c696e2afe0e6fe456ccd7ef 26-May-2011 Daniel Sandler <dsandler@android.com> Merge "Framework support for Android Dreams."
2a3c67c0e99bd3d8c6c538ff323a27df19cad109 26-May-2011 Joe Onorato <joeo@google.com> am cfb046de: am 2c09a9c0: am 5520610c: Merge "Make adb shell am display-size persistent." into honeycomb-mr2

* commit 'cfb046dead49568de6f6808a697e0508ef39a3a6':
Make adb shell am display-size persistent.
571ae90801d943a4c0c8897d1cf74c9cfe04b1ec 24-May-2011 Joe Onorato <joeo@google.com> Make adb shell am display-size persistent.

Change-Id: If3d5d18729f4e89eb7e689994deadd996fd487e9
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
d37b84edf55e5c242de23f1e7dfc61cc150e7b54 19-May-2011 Dianne Hackborn <hackbod@google.com> am ba8fc5b0: am 8416e5cf: am 6ad07db7: Merge "Fix fake display size when rotated." into honeycomb-mr2

* commit 'ba8fc5b059228402afa965e175d5f6655e3fe555':
Fix fake display size when rotated.
8f7c271ac9daa35708246bf279f71db5ff103b58 19-May-2011 Dianne Hackborn <hackbod@google.com> Fix fake display size when rotated.

Change-Id: Ic8a1dbe32cf0cb3c5cdc9b9294b98e810558f875
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
fb03c4fafee3a5bd6a26ec0b85162b45fd9dd57e 18-May-2011 Dianne Hackborn <hackbod@google.com> am 4f9bb17f: am c2db2144: am a429d5df: Merge "Improve compat mode scaling implementation." into honeycomb-mr2

* commit '4f9bb17f7e74746c4296100f2fbd47f0f6ead3a7':
Improve compat mode scaling implementation.
ffb3d939cc78cae523f14a0f8ab37061b5bffc20 18-May-2011 Dianne Hackborn <hackbod@google.com> Improve compat mode scaling implementation.

Rip out the old funky code for trying to restrict the app window
sizes to be within the compat mode range. Instead, we know rely
entirely on scaling -- we deal with windows always with the scaling
applied so that the window manager doesn't have to deal with them
specially. Instead, we just apply the inverse scale at the few
points we need to do something the app sees.

Change-Id: I785409dd4513b5f738684e1635dc8f770c249651
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
9d31154d0b0ecbc5a36733ac3a8b70dcae18bf9c 17-May-2011 Dianne Hackborn <hackbod@google.com> am b68c768d: am 41744836: am 7916ac65: Add new command line option to change global screen size.

* commit 'b68c768ddb57407bc253230c677056329c9e4bae':
Add new command line option to change global screen size.
7916ac65dc492e4e1431879875c77d7121fbf82e 17-May-2011 Dianne Hackborn <hackbod@google.com> Add new command line option to change global screen size.

For example:

adb shell am display-size 1024x600

Change-Id: I5df462acd3323bdaaaefa3126faea7dd8595b726
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
ac8dea12c17aa047e03a358110aeb60401d36aa2 21-Apr-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE. Integrate from master: Rework display size access.

Applications now get the display size from the window manager. No
behavior should be changed yet, this is just prep for some real
changes.

Change-Id: I47bf8b55ecd4476c25ed6482494a7bcc5fae45d2
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
ebff8f92f13513ce37bd74759eb1db63f2220590 13-May-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE. Integrate add new screen width/height in "dp" configs.

You can now specify resource configuration variants "wNNNdp"
and "hNNNdp". These are the minimum screen width/height in "dp"
units. This allows you to do things like have your app adjust
its layout based only on the about of horizontal space available.

This introduces a new configuration change flag for screen size.
Note that this configuration change happens each time the orientation
changes. Applications often say they handle the orientation change
to avoid being restarted at a screen rotation, and this will now
cause them to be restarted. To address this, we assume the app can
handle this new config change if its target SDK version is < ICS.

Change-Id: I4acb73d82677b74092c1da9e4046a4951921f9f4
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
44bc17c6b517aef35a390c81b5aa79c4f284f744 21-Apr-2011 Dianne Hackborn <hackbod@google.com> Rework display size access.

Applications now get the display size from the window manager. No
behavior should be changed yet, this is just prep for some real
changes.

Change-Id: I2958a6660895c1cba2b670509600014e55ee9273
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
3fc982f41fda1f254bfbc35490d81cd82a0ed90a 31-Mar-2011 Dianne Hackborn <hackbod@google.com> Add new resource configurations for screen width/height in "dp".

You can now specify resource configuration variants "wNNNdp"
and "hNNNdp". These are the minimum screen width/height in "dp"
units. This allows you to do things like have your app adjust
its layout based only on the about of horizontal space available.

This introduces a new configuration change flag for screen size.
Note that this configuration change happens each time the orientation
changes. Applications often say they handle the orientation change
to avoid being restarted at a screen rotation, and this will now
cause them to be restarted. To address this, we assume the app can
handle this new config change if its target SDK version is < ICS.

Change-Id: I22f8afa136b4f274423978c570fa7c9855040496
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
0029c66203ab9ded4342976bf7a17bb63af8c44a 30-Mar-2011 Jeff Brown <jeffbrown@google.com> Add input filter mechanism for accessibility.

This patch adds a mechanism for capturing, filtering, transforming
and injecting input events at a very low level before the input
dispatcher attempts to deliver them to applications. At this time,
the mechanism is only intended to be used by the accessibility
system to implement built-in system-level accessibility affordances.

The accessibility input filter is currently just a stub.
It logs the input events receives and reinjects them unchanged,
except that it transforms KEYCODE_Q into KEYCODE_Z.

Currently, the accessibility input filter is installed whenever
accessibility is enabled. We'll probably want to change that
so it only enables the input filter when a screen reader is
installed and we want touch exploration.

Change-Id: I35764fdf75522b69d09ebd78c9766eb7593c1afe
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
5c9248f668201a751500f67cc60bd45ff905751a 09-Mar-2011 Jim Miller <jaggies@google.com> Merge "Fix 4027057: Improve resolution of RecentApps thumbnail images." into honeycomb-mr1
e70d506ab329f1f96b0ee132317aa36edea1b94e 09-Mar-2011 Jim Miller <jaggies@google.com> Fix 4027057: Improve resolution of RecentApps thumbnail images.

This fix ensures captured thumbnails in portrait mode have the
same resolution as those in landscape by fixing the horizontal
resolution and vertical resolution of the target image.

The returned image is now always the same size and matches
the landscape screen exactly. In portrait mode, it grabs
the upper portion of the screen based on the vertical dimension
of the target image.

Change-Id: I203c39843f2f21ca28f6ef0dffec308ce5cb39fb
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
3de6a9b692437d5ce14d672cad4eff4c7ed0ae23 09-Mar-2011 Jim Miller <jaggies@google.com> Merge "Fix 4025684: Don't include wallpaper dimensions in bounds calculation" into honeycomb-mr1
2aded18b0ef9f189771f70f05091493a44ec46ae 09-Mar-2011 Jim Miller <jaggies@google.com> Fix 4025684: Don't include wallpaper dimensions in bounds calculation

This fixes a bug where we would capture the statusbar region in
thumbnails because the wallpaper was used in the bounds calculation.

Change-Id: I572221e83c4c363afe90e59bece9a291ce694a15
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
cc1d9f7942f7e70c240f0cc745840262345f506f 08-Mar-2011 Dianne Hackborn <hackbod@google.com> Fix issue #3505861: Need to decide large/xlarge screen size limits

Decided.

Change-Id: I8292d65e3d47755778fdf85207c49f160c756452
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
648251710162cdaf7371012a1cbb79b9bc5bc0e4 03-Mar-2011 Dianne Hackborn <hackbod@google.com> Fix issue #3485923: Gmail crash

Allow application to try to recover if a surface OOM error
happens on the client side.

Change-Id: I0308bd99647a35e4bcac448340b7fc6330a828f6
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
cbf9cb35bb7064f303c6dd9da4485cd5344b6779 03-Mar-2011 Dianne Hackborn <hackbod@google.com> Merge "Fix issue #3400119: API to specify a black background behind a window transition"
de75cb4738376c4cfe15c56aba7cd78d90e3100e 03-Mar-2011 Dianne Hackborn <hackbod@google.com> Fix issue #3400119: API to specify a black background behind a window transition

There is now an API, which is used for task switching.

Also improved how we handle rotation animation when we can't take a
screen shot, to cleanly revert to the old freeze behavior. This removes
the need to special case the emulator.

Change-Id: I7227432a2309370437ec6ac78db02c6f1e7eedd5
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
05dc66ada6b61a6bdf806ffaa62617ac5394695d 02-Mar-2011 Jeff Brown <jeffbrown@google.com> Fade out the mouse pointer after inactivity or other events.

Fades out the mouse pointer:
- after 15 seconds of inactivity normally
- after 3 seconds of inactivity in lights out mode
- after a non-modifier key down
- after a touch down

Extended the native Looper to support enqueuing time delayed
messages. This is used by the PointerController to control
pointer fade timing.

Change-Id: I87792fea7dbe2d9376c78cf354fe3189a484d9da
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
99aac7beca18b6d73e40db5e8e49f52f94be638e 26-Feb-2011 Dianne Hackborn <hackbod@google.com> You can now specify a custom display size as NxM.

Change-Id: Ieb6df51aab009689f0f19b8887025261c5ceb69f
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
3c85a4e6396dabf7f0061ff2c6e9f9b35793eadd 22-Feb-2011 Mike Lockwood <lockwood@android.com> Merge "KeyguardManager: Add isKeyguardLocked() and isKeyguardSecure()"
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/services/java/com/android/server/wm/WindowManagerService.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/services/java/com/android/server/wm/WindowManagerService.java
6e1eb76f02ccc9dbc309b938f62d39312da8cafe 18-Feb-2011 Dianne Hackborn <hackbod@google.com> Explode WindowManagerService.

Change-Id: I3d73ed4c9a1b5d730aeffeb2df24ce5e6117d698
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
a924dc0db952fe32509435fdb8dc9c84a9e181f3 17-Feb-2011 Dianne Hackborn <hackbod@google.com> Start window manager refactoring.

Move all of the pieces into a new com.android.server.wm package.

Change-Id: I942b7bcfb84ee0f843f47d58e55ffc5a93c0da94
/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java