484 Commits

Author SHA1 Message Date
Jeff Brown
fa25bf5382 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
2012-07-25 18:56:16 -07:00
Fabrice Di Meglio
aac0d4ed02 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
2012-07-19 19:21:26 -07:00
Jeff Brown
c69238ebc8 Merge "Remove dithering support." 2012-07-16 16:18:13 -07:00
Jeff Brown
3cc321ecf5 Remove dithering support.
The dithering flag is no longer implemented in Surface Flinger
so this is all dead code.

Change-Id: I74c0e452923207e5b7cfe0eeca9457e5cb990947
2012-07-16 16:17:25 -07:00
Jeff Brown
f422a56694 Merge "Remove freezeDisplay(), which is no-op." 2012-07-16 15:52:54 -07:00
Jeff Brown
55e395ab33 Remove freezeDisplay(), which is no-op.
Change-Id: I981ee49e6e2d41a09feaee4b384392e83f7faf3d
2012-07-16 14:57:22 -07:00
Svetoslav Ganov
c9c9a48e7b 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
2012-07-16 08:46:11 -07:00
Craig Mautner
322e403156 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
2012-07-13 13:35:20 -07:00
Craig Mautner
fbf885b652 Merge "Notify client side of window movement." 2012-07-10 14:48:06 -07:00
Craig Mautner
4bf18a7c97 Handle keyguard visibility states separately.
Previous to this change the forceHiding variable was a boolean. This
change recognizes the different configurations of the keyguard by
defining separate states for forceHiding and testing for window
visibility differently in each state.

Fixes bug 6786114.

Change-Id: I078e0df7865ddafe498ee46e02110c3a017386d0
2012-07-10 14:08:16 -07:00
Craig Mautner
918b53bc53 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
2012-07-09 14:15:54 -07:00
Craig Mautner
2639da500e 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
2012-07-09 09:39:06 -07:00
Craig Mautner
12670b5fb4 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
2012-07-03 19:15:35 -07:00
Craig Mautner
a76fdb7713 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
2012-07-03 19:03:02 -07:00
Craig Mautner
711f90a7c1 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
2012-07-03 18:43:52 -07:00
Craig Mautner
078ea0a644 Step 2 in consolidating wallpaper animation.
Separate updateWindowsAndWallpaperLocked into two methods,
updateWindowsLocked and updateWallpaperLocked. Eliminates mForceHiding.

Change-Id: I3958cfae09283aaa7f1781d1b54ef224d8e80f3f
2012-07-03 18:28:46 -07:00
Craig Mautner
6fbda63e68 Merge CL 202423/3 App launching has random pauses.
Change-Id: Iba5616182c02e51f4d9063d0a01b30b9f558549a
2012-07-03 09:31:09 -07:00
Craig Mautner
7b04c2cc81 am 80059d6c: am 00b9e899: Merge "Clear startingDisplayed flag when removing window." into jb-dev
* commit '80059d6c1b60e9920b7ae133808c989b4d3fa8fe':
  Clear startingDisplayed flag when removing window.
2012-07-02 17:09:18 -07:00
Craig Mautner
38b2478f63 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
2012-07-02 16:21:28 -07:00
Craig Mautner
5702d4dfb5 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
2012-06-30 14:10:16 -07:00
Dianne Hackborn
a4b7f2f75e Use two fingers to work some magic...
Change-Id: Ibcb3dbd3d158c22da8277e544d81fb47eadccd49
2012-06-25 19:19:15 -07:00
Dianne Hackborn
fca66cd828 Merge "DO NOT MERGE Fix issue #6697105: App launching sometimes has random pauses" into jb-dev 2012-06-25 17:35:21 -07:00
Jeff Brown
ad51a1e923 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.
2012-06-25 15:31:23 -07:00
Jeff Brown
c585841115 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.
2012-06-25 15:31:19 -07:00
Craig Mautner
f12100e025 Eliminate jank by setting force hiding differently
Only force hide windows when the keyguard is animating in.

Fixes bug 6721572.

Change-Id: Iad7b8b811bcf0840726cbf6c6f279dabd08a3aba
2012-06-25 11:13:24 -07:00
Jeff Brown
780c46fc91 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
2012-06-24 13:51:41 -07:00
Jeff Brown
08a746a0c6 Don't enable input dispatch until display enabled.
Bug: 6263070
Change-Id: I05d036fc1d9ec06d164d6743d45bb3f199cfab47
2012-06-24 12:23:58 -07:00
Craig Mautner
9e80944876 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
2012-06-22 17:13:04 -07:00
Craig Mautner
4170c37446 Merge "Move animation step from layout to animator." 2012-06-22 15:46:28 -07:00
Hiroshi Lockheimer
0f5541775c am 3fee3eb7: am 5beeb04b: Merge "Don\'t display based on a dummy animation." into jb-dev
* commit '3fee3eb7e0a83cd7fc8df3994692232ba6953c02':
  Don't display based on a dummy animation.
2012-06-22 15:39:55 -07:00
Hiroshi Lockheimer
5beeb04b52 Merge "Don't display based on a dummy animation." into jb-dev 2012-06-22 15:33:15 -07:00
Craig Mautner
9c5bf3b36f Don't display based on a dummy animation.
The Starting window was being made visible early because the app
token had the dummy animation set. When the real animation started
the Starting window picked it up and became transparent causing
the underlying window to become visible again => jank.

Fixes bug 6691421.

Change-Id: I95fe88d2887760e6da3adedeb6be300eb6755283
2012-06-22 15:19:13 -07:00
Dianne Hackborn
357d99c61d 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
2012-06-22 12:50:50 -07:00
Dianne Hackborn
ca08198f41 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.
2012-06-22 10:43:07 -07:00
Dianne Hackborn
0b9b053ce6 Merge "Don't crash in window manager if we fail getting .apk resources." into jb-dev 2012-06-22 10:38:45 -07:00
Craig Mautner
1caa399baf 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
2012-06-22 09:46:48 -07:00
Craig Mautner
2cb7980660 am a6b8189f: am 9ce1ea3a: Merge "Fix starting window problems." into jb-dev
* commit 'a6b8189f8e152caafe5900cff0f068517a70088d':
  Fix starting window problems.
2012-06-21 19:00:50 -07:00
Craig Mautner
f412095686 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
2012-06-21 18:25:39 -07:00
Dianne Hackborn
0b800190d7 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
2012-06-21 15:29:36 -07:00
Dianne Hackborn
306211d792 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...
2012-06-20 12:10:39 -07:00
Dianne Hackborn
0fa4d30b03 Merge "Fix issue #6686339: 2 taps required to launch notification..." into jb-dev 2012-06-20 12:06:38 -07:00
Dianne Hackborn
6e2281d44c 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
2012-06-19 17:54:24 -07:00
Craig Mautner
2fa2a52838 am 9a5a8aaf: am 5785e05d: Merge "Clear sendingToBottom when animation is complete." into jb-dev
* commit '9a5a8aafad89f3e05bb9c17c56ea4658413a4452':
  Clear sendingToBottom when animation is complete.
2012-06-19 15:13:46 -07:00
Craig Mautner
3f99fde465 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
2012-06-19 14:10:01 -07:00
Jeff Brown
4f8ecd8029 Move power manager to a new package.
Change-Id: I5f5a6435e64354b7d6535e8e9a63934ba7a3f448
2012-06-18 19:43:44 -07:00
Jeff Brown
40af9c04c5 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.
2012-06-18 14:20:27 -07:00
Craig Mautner
aa9c9efa8f Merge "More steps to isolate animation." 2012-06-18 13:56:32 -07:00
Jeff Brown
ee17241487 Fix an NPE and possible unsynchronized call of Locked method.
Bug: 6680398
Change-Id: Id5ef4fa82b2a5ef5e9c3934ca95156143f91e5e2
2012-06-18 12:59:13 -07:00
Craig Mautner
01cd0e7df0 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
2012-06-18 10:19:11 -07:00
Jeff Brown
d7a04de167 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
2012-06-17 15:55:46 -07:00