684 Commits

Author SHA1 Message Date
Dianne Hackborn
f265ea9d83 App ops: vibration, neighboring cells, dialing, etc.
Improve handling of vibration op, so that apps are
better blamed (there is now a hidden vibrator API that
supplies the app to blame, and the system now uses this
when vibrating on behalf of an app).

Add operation for retrieving neighboring cell information.

Add a new op for calling a phone number.  This required
plumbing information about the launching package name through
the activity manager, which required changing the internal
startActivity class, which required hitting a ton of code that
uses those internal APIs.

Change-Id: I3f8015634fdb296558f07fe654fb8d53e5c94d07
2013-02-01 15:14:29 -08:00
Svetoslav
cb9a61bdc4 Display magnifier does not release its surface on destroy.
Change-Id: I0b9448c8859b0167632652060b08072dc8c9c0a5
2013-01-22 18:11:42 -08:00
Svetoslav Ganov
80943d8daa 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
2013-01-22 17:56:53 -08:00
Craig Mautner
07f943d417 Merge "Add Overrides, remove trailing whitespace." 2013-01-15 09:10:10 -08:00
Craig Mautner
6cfa7292cf Add Overrides, remove trailing whitespace.
Once and for all.

Change-Id: I0835515696c1a8ec7dff719fb734cbbd0b4252d6
2013-01-15 09:05:42 -08:00
Craig Mautner
5ae8e45ff3 Merge "Make DimLayer track changes to WindowState layer." 2013-01-11 16:41:40 -08:00
Craig Mautner
13131e74ea Make DimLayer track changes to WindowState layer.
The DimLayer behind popups was not changing when the popup layer
changed. It will now.

Fixes bug 7974415.

Change-Id: Ia486efa83d623716a09d73a22493a4222823c573
2013-01-11 11:03:33 -08:00
Craig Mautner
b5eb550fb1 Call assignLayersLocked when InputMethod is moved.
Call was removed by over-ambitious editing in CL 259410.

Fixes bug 7966824.

Change-Id: I9feb2ec27907f4e03b9424710adc2743a8b512d8
2013-01-10 17:29:30 -08:00
Craig Mautner
c34bc1178b Turn off debug logging.
Change-Id: I8dcfbb1f91d63e9126822a0c45b34cb21c09fa2a
2013-01-08 15:02:13 -08:00
Craig Mautner
ef6550195f 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
2013-01-08 00:36:16 -08:00
Craig Mautner
73164dc7bc Merge "Combine DimAnimator and DimSurface into DimLayer" 2013-01-08 00:23:46 -08:00
Craig Mautner
1420b93fa5 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
2013-01-08 00:22:22 -08:00
Craig Mautner
581068131c Remove some TODOs.
Change-Id: I52f5a8a76593dde177c2e931f656b13134a3bd2b
2013-01-07 23:39:11 -08:00
Craig Mautner
9a29a5d679 Convert three booleans into single state variable.
Make app transition states easier to understand.
Remove unnecessary dependence on ActivityOptions.

Change-Id: If3942133e919a4121340f8ef5ca1c50df22f370d
2013-01-07 23:39:10 -08:00
Craig Mautner
4b71aa1f8a Move app transition constants
Move app transition constants from WindowManagerPolicy to
AppTransition.

Change-Id: I8ae6c4d0da1db826c44eb4ea0c6b85016b50b1a3
2013-01-07 23:38:57 -08:00
Craig Mautner
72669d1801 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
2012-12-20 10:15:58 -08:00
Craig Mautner
321bdf52a1 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 render the remaining
layers faster.

- Refactoring of animations to:
  o Remove unused setInterpolator() calls on AnimationSet constituents.
  o Remove unnecessary setFillBefore() calls.
  o Consolidate setDuration() calls into AnimationSet.
  o Create Interpolators once.
  o Group animation set calls with their Animations.
  o Use same animation timing and Interpolator for all animations.

This is a partial fix for 7729214.

Change-Id: Ic3c47bcf7c84944128effb699efcdd1f89200fc4
2012-12-20 09:32:02 -08:00
Craig Mautner
a2303750fb Merge changes I1dfe21e5,Ia0218bf8
* changes:
  Clean up warnings.
  Minor refactorings.
2012-12-19 16:40:18 -08:00
Craig Mautner
0bf6ec9e37 Clean up warnings.
Change-Id: I1dfe21e5f64364c90565b594e28074cabe7daa64
2012-12-18 10:03:21 -08:00
Svetoslav Ganov
545252f4fd 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
2012-12-14 16:27:27 -08:00
Craig Mautner
2268e7ee5c Minor refactorings.
Change-Id: Ia0218bf86d142be80dd12d04de97da5d19293815
2012-12-13 15:42:46 -08:00
Craig Mautner
ae44659f30 Call adjustWallpaperWindowsLocked once per pass.
Also refactor a few methods and improve logging.

Change-Id: Ic54a1ff99f6de732b31cda5c06d36e8de01a269c
2012-12-12 10:09:19 -08:00
Craig Mautner
28db197580 Merge "Share the pending layout changes" 2012-12-11 10:51:30 -08:00
Craig Mautner
74c9671855 Merge "Recouple layout and animation a bit." 2012-12-11 10:42:42 -08:00
Craig Mautner
ccc9e9b936 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
2012-12-11 09:49:38 -08:00
Craig Mautner
66f78d7a97 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
2012-12-04 16:46:50 -08:00
Craig Mautner
968683335e Recouple layout and animation a bit.
Share state between layout and animation and stop copying
redundant data between the two.

Change-Id: If07d3fc3ddfd33e3d46bf45d24d7aca58067ee66
2012-12-04 16:20:08 -08:00
Craig Mautner
9339c401cf 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
2012-12-04 16:13:45 -08:00
Craig Mautner
bebd1a092e am d3b9dd6c: am 40627de3: Merge "Remove unnecessary references in WindowManagerService"
* commit 'd3b9dd6ca6325abe5cf2049c2894a86b256a3db1':
  Remove unnecessary references in WindowManagerService
2012-12-04 10:39:59 -08:00
Craig Mautner
d3b9dd6ca6 am 40627de3: Merge "Remove unnecessary references in WindowManagerService"
* commit '40627de3044c4a23c20c2229cab20aab21ff2b03':
  Remove unnecessary references in WindowManagerService
2012-12-04 10:38:32 -08:00
You Kim
cb6291c9b1 Remove unnecessary references in WindowManagerService
Clean message routines in WindowManagerService.

Change-Id: I3e3106b6499c67d1fd7133c987c0452a73141a3f
Signed-off-by: You Kim <you.kim72@gmail.com>
2012-12-05 00:10:03 +09:00
Dianne Hackborn
f9ae5f75af 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
2012-12-03 16:08:35 -08:00
Dianne Hackborn
bb4ca5271a 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
2012-12-03 14:09:06 -08:00
Svetoslav Ganov
152e9bb81a 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
2012-12-03 10:38:48 -08:00
Craig Mautner
52a839de9e 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.
2012-11-30 18:46:58 -08:00
Craig Mautner
3351ab27b9 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.
2012-11-30 16:46:03 -08:00
Craig Mautner
7b1aa77a9b 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
2012-11-30 16:14:45 -08:00
Dianne Hackborn
00d6a76c3d am a55097f8: am ed74c10f: am aae329ef: Merge "Don\'t apply transformation fudge when not rotating." into jb-mr1.1-dev
* commit 'a55097f8bb7871ef909c7005b6fa1b6b7cf06b16':
  Don't apply transformation fudge when not rotating.
2012-11-29 18:01:07 -08:00
Dianne Hackborn
a55097f8bb am ed74c10f: am aae329ef: Merge "Don\'t apply transformation fudge when not rotating." into jb-mr1.1-dev
* commit 'ed74c10f135c768b24c4b1a14042b8292a9662fa':
  Don't apply transformation fudge when not rotating.
2012-11-29 17:59:30 -08:00
Dianne Hackborn
aae329ef0f Merge "Don't apply transformation fudge when not rotating." into jb-mr1.1-dev 2012-11-29 17:53:47 -08:00
Dianne Hackborn
4b16969b00 Don't apply transformation fudge when not rotating.
There is this stupid fudge factor applied to window transformations
when doing a screen rotation animation.  We need this when rotating,
but when not rotating it causes very visible artifacts.  Historically
the non-rotation case only happened due to configuration changes, so
wasn't that big a deal.  Now however that we use this when switching
users, it is more annoying.  So get rid of it for such cases.

Change-Id: I6b343866c1bad9b16984b4a629917c2f1bb37b9e
2012-11-29 17:51:24 -08:00
Craig Mautner
d08fc86964 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
2012-11-29 14:27:43 -08:00
Craig Mautner
8f0bdb5bb6 Merge "Extract AppTransition from WindowManager" 2012-11-29 11:43:49 -08:00
Craig Mautner
24d966a3b6 Merge "Fix math errors causing black screen. DO NOT MERGE" into jb-mr1.1-dev 2012-11-29 09:57:15 -08:00
Craig Mautner
9dd9e0c99d 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
2012-11-29 00:11:50 -08:00
Craig Mautner
8c6008e7e8 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.
2012-11-27 18:43:59 -08:00
Craig Mautner
ae336a08dd 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.
2012-11-27 16:23:15 -08:00
Craig Mautner
e855214249 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
2012-11-27 12:47:27 -08:00
Craig Mautner
164d4bb4c3 Extract AppTransition from WindowManager
Refactor of WindowManagerService to move app transitions out.

Change-Id: Id3e377526a69f95a3ee4c0d97ca6fd84005beb6a
2012-11-26 13:51:23 -08:00
Craig Mautner
625ac3086a Merge "Retain dimming while animating and obscured." 2012-11-26 11:35:31 -08:00