314 Commits

Author SHA1 Message Date
Dianne Hackborn
eabfb3a36e Add new scale-up window manager animation.
Like zoom thumbnail, but without the thumbnail.

Change-Id: I9486dd204398b87c9e70ff0d05d03f4a22449cd6
2012-04-16 17:32:50 -07:00
Craig Mautner
7d8df3905d 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
2012-04-14 10:45:48 -07:00
Craig Mautner
7358fbfeb2 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
2012-04-13 10:01:32 -07:00
Dianne Hackborn
0c2acffec8 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
2012-04-12 15:26:11 -07:00
Dianne Hackborn
187ae2105e Revert to ICS screen rotation animation.
Change-Id: Ida76f17a00e4c8ab828deae51095107e4eeaa321
2012-04-12 13:08:26 -07:00
Justin Mattson
2f63cfda76 am 4ea7bfea: Merge "Check if WallpaperService is enabled" into ics-aah
* commit '4ea7bfea312e4ddf815eabdef04d3f3b4878a51a':
  Check if WallpaperService is enabled
2012-04-11 17:44:53 -07:00
Craig Mautner
1e1edaa60d Merge "Check WindowState when looking for animation." 2012-04-11 17:18:44 -07:00
Craig Mautner
f20588fdc6 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
2012-04-11 17:15:09 -07:00
Craig Mautner
f8d4fbb9c8 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
2012-04-11 09:25:53 -07:00
Craig Mautner
f0cabba38b Merge "Fix NPE in setTransparentRegion." 2012-04-10 14:33:07 -07:00
Craig Mautner
1f4e0ccba0 Fix NPE in setTransparentRegion.
Check for null Surface before using it.

Fixes bug 6312835.

Change-Id: Iaaac2a5d88e81b88e369815e09818c268085e4b7
2012-04-10 14:24:38 -07:00
Craig Mautner
8330e40b98 Merge "Reduce load on CPU when animating rotation." 2012-04-10 13:01:12 -07:00
Craig Mautner
73850cb699 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
2012-04-10 12:56:27 -07:00
Daniel Sandler
c38cf4c7db Merge "New Android Dreams architecture, disabled for now." 2012-04-10 05:33:07 -07:00
Justin Mattson
4233f26249 Check if WallpaperService is enabled
If WallpaperService is disabled, don't delay starting SurfaceFlinger
until it is.

Change-Id: I95db6b7bc791329e2bae33472cfeb125e5f6f324
2012-04-09 18:36:15 -07:00
Daniel Sandler
7d276c377c 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
2012-04-09 15:33:26 -04:00
Jeff Brown
27fd3420ac Fix lid switch interpretation.
Also remove unnecessary permission check for method that is
only called internally.

Change-Id: I32f63fc3e96b06709d18b046ee2d3c8f310de70d
2012-04-09 11:22:12 -07:00
Craig Mautner
3de422fe4f Fix endless looping in layout.
An odd alignment of the stars can end up with all of mAppToken.allDrawn
animating and mAppToken.startingDisplayed all false, and animation not
null. In such a case we can continue returning false but still pass
the test in WindowAnimator.updateWindowsAndRotation setting
wasAnimating to true. The combination continually sets the
FINISH_LAYOUT_REDO_WALLPAPER bit in mPendingLayoutChanges.

Fixes bug 6304838.

Change-Id: Ie7a7b39ea218213f51dc3df3eefe4ff03f1d885d
2012-04-06 18:04:13 -07:00
Craig Mautner
bec53f7066 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.
2012-04-06 14:03:25 -07:00
Craig Mautner
7a3bc87468 Merge "Fix so that windows again animate when moving." 2012-04-06 08:00:47 -07:00
Jeff Brown
ac14351e16 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
2012-04-05 19:33:11 -07:00
Craig Mautner
6af9b92b75 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
2012-04-05 19:25:51 -07:00
Dianne Hackborn
42c45856f5 Fix so that windows again animate when moving.
Change-Id: I2441d0c892687b8cda239815caf77837cd21093e
2012-04-05 18:29:35 -07:00
Jeff Brown
e9bdb31ea1 Merge "Refactor input system into its own service." 2012-04-05 15:30:10 -07:00
Jeff Brown
4532e61584 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
2012-04-05 14:42:11 -07:00
Craig Mautner
e4d8a5dd42 Fix failure to animate away exiting AppWindowToken
A previous check in changed the collection we were pulling exiting
AppWindowTokens from. Instead of pulling them from mExitingAppTokens
they came from mAppTokens and hence were not animated away.

Fixes bug 6296433.

Change-Id: I23347085658fce5412abb8ea119ce7e6152cab8b
2012-04-05 13:10:37 -07:00
Dianne Hackborn
f87d19621d 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
2012-04-04 16:00:45 -07:00
Craig Mautner
594316361d First separation of animation from AppWindowToken.
New class AppWindowAnimator pulls animation out of AppWindowToken.

Change-Id: Ic1ccb6ec2bf091f1f901fe3c20cbeb242376ae6b
2012-04-04 11:56:44 -07:00
Craig Mautner
d09cc4ba24 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
2012-04-04 10:23:31 -07:00
Craig Mautner
1d60133578 Merge "Refactor to convert four state booleans to int." 2012-04-02 13:57:42 -07:00
Craig Mautner
749a7bb28b 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
2012-04-02 13:49:53 -07:00
Craig Mautner
ea7ff4d2fe Merge "Defer a couple of Surface actions for WSAnimator." 2012-04-02 13:24:55 -07:00
Craig Mautner
48ba1e7f53 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
2012-04-02 13:18:16 -07:00
Craig Mautner
5d724f50d4 Merge "Further isolate the Surface from WindowState." 2012-04-02 12:58:23 -07:00
Craig Mautner
c8bc97e530 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
2012-04-02 12:54:54 -07:00
Michael Jurka
e6c966caa3 Merge "Add frame counter to dumpGfxInfo" 2012-04-02 09:45:36 -07:00
Dianne Hackborn
61d6c8ca49 Merge "Add new feature to let apps layout over status bar / system bar." 2012-03-30 17:36:32 -07:00
Dianne Hackborn
3a3a6cfd8e 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
2012-03-30 15:22:04 -07:00
Craig Mautner
4185012ad3 Merge "Move variables into animation class." 2012-03-30 13:22:21 -07:00
Craig Mautner
a608b88232 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
2012-03-30 13:19:45 -07:00
Michael Jurka
a3fabff985 Add frame counter to dumpGfxInfo
Change-Id: I016f706e32cbdbce014795d8fc537b15c389dc7a
2012-03-30 05:06:55 -07:00
Craig Mautner
15d5a964fd Merge "Remove obsolete variable masking valid one." 2012-03-29 18:03:32 -07:00
Craig Mautner
d87946ba48 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
2012-03-29 18:00:19 -07:00
Jeff Brown
a08f3e866a Merge "Enable vsync traversals by default." 2012-03-29 15:12:33 -07:00
Jeff Brown
ebb2d8d708 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
2012-03-29 13:10:55 -07:00
Craig Mautner
c2f9be0b7f 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
2012-03-29 11:31:12 -07:00
Craig Mautner
e7ae250540 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
2012-03-29 11:31:11 -07:00
Craig Mautner
b3cbd0b4d8 Merge "Refactor animation out of WindowState." 2012-03-26 17:27:16 -07:00
Craig Mautner
a2c77053b8 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
2012-03-26 12:14:43 -07:00
Michael Jurka
4accb6a88b Fix bug: don't show system bar in app thumbnails
Bug: 5953608
Change-Id: Ib730638fe130f287ff446db0c6cd42efc5746c5c
2012-03-26 09:42:35 -07:00