History log of /frameworks/base/services/java/com/android/server/wm/WindowStateAnimator.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/WindowStateAnimator.java
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/WindowStateAnimator.java
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/WindowStateAnimator.java
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/WindowStateAnimator.java
0fa77c1e0fc218040efc570936e988dbeece399c 12-Jun-2012 Craig Mautner <cmautner@google.com> Remove over aggressive optimization.

It turns out that sometimes the wallpaper target is migrated to the
bottom of the window stack and then mWallpaperTarget is set to null.
In particular this happens when the launcher all-apps screen is
brought up. When this happens the layer of the wallpaper is
correctly set below the previous wallpaper target.

An optimization in WindowAnimator was keeping the layer update from
propagating to the Surface object. This fix removes that optimization.

Fixes bug 6631717.

Change-Id: I800dd043ce8df83b4e5edbf710503135396bc01e
/frameworks/base/services/java/com/android/server/wm/WindowStateAnimator.java
c38869abe5d89b7f9e66f23599889e17b93b5eec 12-Jun-2012 Craig Mautner <cmautner@google.com> Revert "Merge errors."

This reverts commit b0419a52008e57475ee254def1da20451da22d4c.
/frameworks/base/services/java/com/android/server/wm/WindowStateAnimator.java
a5bbb8987b98fdbef45549103f70979f4e1e9e4d 12-Jun-2012 Craig Mautner <cmautner@google.com> Merge errors.

Change-Id: I33d0b1aa5dc5018cc879d2e9878e4825adaa4074
/frameworks/base/services/java/com/android/server/wm/WindowStateAnimator.java
b9836b9185132974f6cfa9296bb3c28d1c9b668a 11-Jun-2012 Craig Mautner <cmautner@google.com> Fix exposing wallpaper on rotations and other.

1. Rotations do not go through standard closing of animations so the
wallpaper was not being hidden when the wallpaper target surface was
destroyed. This fix adds hiding the wallpaper when the wallpaper
target is destroyed.

2. The wallpaper target is nulled when switching from launcher home
screen to launcher all apps. In this case the wallpaper remains
visible but below visible layers. It should be hidden so that when
those layers adjust it is not exposed. (Separate fix for adjusting
wallpaper in this case will come).

Fixes bug 6629464.

Change-Id: I522f97dafc0cdcc0f933a825ec9a29d8f63590b5
/frameworks/base/services/java/com/android/server/wm/WindowStateAnimator.java
ff92f04e76cb141caba6bf767618b1c5153242c1 08-Jun-2012 Craig Mautner <cmautner@google.com> Hide wallpaper when wallpaper target gets hidden.

Another location that potentially hides the wallpaper target while
leaving the wallpaper itself still visible. Causes the wallpaper to
show up when upper surfaces are transparent all the way down.

Fixes bug b6621986.

Change-Id: If75053160f041eb78868eda36b7820fb2110d069
/frameworks/base/services/java/com/android/server/wm/WindowStateAnimator.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/WindowStateAnimator.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/WindowStateAnimator.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/WindowStateAnimator.java
3e52fc25154540faf3c0cb927ff45532cdebdddf 16-May-2012 Dianne Hackborn <hackbod@google.com> Fix some issues with updating the offsets of a window.

- Apply the correct crop rect at this point.
- Apply the correct position by taking into account the frame left/top.
- Don't directly apply the new values if the window is currently
animating, since we need to go through the whole animation step
to determine what the correct position is (taking into account
any transformations).

Change-Id: I15d79354d9779867c49c7c0880faccdead7b021d
/frameworks/base/services/java/com/android/server/wm/WindowStateAnimator.java
521e0d794d298201716d30c66164f0c60d6a74c0 14-May-2012 Jamie Gennis <jgennis@google.com> WindowManager: unset the wallpaper window crop

This change removes the window crop of the wallpaper when setting its position.

Change-Id: I0f4dc10ea9a724b210f75286580ef391145286df
/frameworks/base/services/java/com/android/server/wm/WindowStateAnimator.java
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/WindowStateAnimator.java
9aa695871c9d5a0a4784dd60f77a44922cfd2498 10-May-2012 Craig Mautner <cmautner@google.com> Fix wallpaper glitch and moving window animation.

1. Previous fix to hide wallpaper at the same time the wallpaper target
was hidden was too aggressive. In the case where one wallpaper target
was replacing another we would lose the wallpaper for an instant.

2. Previous fix to keep from overwriting the moving window boundaries
was incomplete. The default values for the parent window were 0,0
which caused the lock window animation to translate down and to the
right. Defaulting the parent window boundaries to the full screen
and restoring it to the full screen after each animation fixes this.

Fixes bug 6472070.

Change-Id: I0b13c642c1aaab666cdd0f4a1e7fb4b716e6b17f
/frameworks/base/services/java/com/android/server/wm/WindowStateAnimator.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/WindowStateAnimator.java
3a67f35f5e912b9c1ec44adbdc5531427318b12d 07-May-2012 Craig Mautner <cmautner@google.com> Change DimAnimator to reflect rotations.

Enlarge DimAnimator to cover corners when frozen surface rotates.
Update DimAnimator size following rotation to reflect new dimensions.

Fixes bug 6449788.
Fixes bug 6449035.

Change-Id: I217d7c96af940e6affc395b79dc665d00318b18c
/frameworks/base/services/java/com/android/server/wm/WindowStateAnimator.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/WindowStateAnimator.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/WindowStateAnimator.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/WindowStateAnimator.java
de6198ebd7f9ea5b7940d38bf5839dfbc6a192c4 19-Apr-2012 Craig Mautner <cmautner@google.com> Defer the Surface.show until animation phase.

This fixes a rotation bug introduced by delaying rendering animation
into the Surface. Now instead of delaying the rendering we delay the
show by eliminating a point where we were showing the Surface too soon.

Change-Id: I63ad3b494963111ffc96569093c8d43517c5408b
/frameworks/base/services/java/com/android/server/wm/WindowStateAnimator.java
9546e457fcfed1da9448d72758642793d9e271bb 18-Apr-2012 Craig Mautner <cmautner@google.com> Delay rendering into Surface until draw completed.

Hold off on updating surface with animation until the Surface draw has
completed. Previously we were calling Surface.setAlpha/setLayer/
setMatrix prior to the app drawing into the surface. This fixes a bug
that caused a flash of the target animation image before the animation
had begun.

Change-Id: Id9142e09b0b22d631dc002eba4dc787455dea03a
/frameworks/base/services/java/com/android/server/wm/WindowStateAnimator.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/WindowStateAnimator.java
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/WindowStateAnimator.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/WindowStateAnimator.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/WindowStateAnimator.java
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/WindowStateAnimator.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/WindowStateAnimator.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/WindowStateAnimator.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/WindowStateAnimator.java
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/WindowStateAnimator.java
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/WindowStateAnimator.java
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/WindowStateAnimator.java
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/WindowStateAnimator.java
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/WindowStateAnimator.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/WindowStateAnimator.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/WindowStateAnimator.java
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/WindowStateAnimator.java