2609 Commits

Author SHA1 Message Date
Svetoslav
8e3feb15c5 Added accessibility APIs for introspecting interactive windows.
1. The old introspection model was allowing querying only the active window
   which is the one the user is touching or the focused one if no window is
   touched. This was limiting as auto completion drop downs were not inspectable,
   there was not way to know when the IME toggles, non-focusable windows were
   not inspectable if the user taps them as until a screen-reader starts
   introspecting the users finger is up, accessibility focus was limited to
   only one window and the user couldn't use gestures to visit the whole UI,
   and other things I can't remember right now.

   The new APIs allow getting all interactive windows, i.e. ones that a
   sighted user can interact with. This prevents an accessibility service
   from interacting with content a sighter user cannot. The list of windows
   can be obtained from an accessibility service or the host window from an
   accessibility node info. Introspecting windows obey the same rules for
   introspecting node, i.e. the service has to declare this capability
   in its manifest.

   When some windows change accessibility services receive a new type
   of event. Initially the types of windows is very limited. We provide
   the bounds in screen, layer, and some other properties which are
   enough for a client to determined the spacial and hierarchical
   relationship of the windows.

2. Update the documentation in AccessibilityService for newer event types.

3. LongArray was not removing elements properly.

4. Composite accessibility node ids were not properly constructed as they
   are composed of two ints, each taking 32 bits. However, the values for
   undefined were -1 so composing a 64 long from -1, -1 prevents from getting
   back these values when unpacking.

5. Some apps were generating inconsistent AccessibilityNodeInfo tree. Added
   a check that enforces such trees to be well formed on dev builds.

6. Removed an necessary code for piping the touch exploration state to
   the policy as it should just use the AccessibilityManager from context.

7. When view's visibility changed it was not firing an event to notify
   clients it disappeared/appeared. Also ViewGroup was sending accessibility
   events for changes if the view is included for accessibility but this is
   wrong as there may be a service that want all nodes, hence events from them.
   The accessibility manager service takes care of delivering events from
   not important for accessibility nodes only to services that want such.

8. Several places were asking for prefetching of sibling but not predecessor
   nodes which resulted in prefetching of unconnected subtrees.

9. The local AccessibilityManager implementation was relying on the backing
   service being ready when it is created but it can be fetched from a context
   before that. If that happens the local manager was in a broken state forever.
   Now it is more robust and starts working properly once the backing service
   is up. Several places were lacking locking.

bug:13331285

Change-Id: Ie51166d4875d5f3def8d29d77973da4b9251f5c8
2014-03-20 16:52:59 +00:00
John Spurlock
1af30c7ac4 Add stream-level suppression to vibrate/audio services.
- Add new audio restriction layer to app-ops.  Restrictions add
additional constraints to audio operations at a stream-level.
Restrictions do not affect the persistable state, and are purely
additive: that is, they can only impose additional contstraints, not
enable something that has already been disabled.  Restrictions
also support a whitelisted set of exempt package names.

- Add new audio stream-level checks to app-ops.

- Implement a provisional OP_PLAY_AUDIO suppression to three
java entry points MediaPlayer, AudioTrack, & SoundPool.

- Enhance vibrator api to take stream information as an optional
hint - the constants correspond to AudioManager stream types.
OP_VIBRATE now supports the stream-level restriction check.

- Simplify Vibrator subclasses by adding default implementations
for two .vibrate calls.

- Migrate NoMan's zen-mode control to use the new app-ops
stream-level restriction mechanism.

Change-Id: Ifae8952647202f728cf1c73e881452660c704678
2014-03-19 15:32:51 -04:00
Craig Mautner
da09ae385a Show the keyguard if unsecure window on top
When traversing windows save the fact that windows above the topmost
fullscreen window do not hide the lockscreen. If there is such a
window don't show it.

(cherry picked from commit ab55e524b89c13082193940a5bf8480a2c2522d9)

Fixes bug 13225149.

Change-Id: Ib6f33cbcfb2f60d8957a9184729ecdec80c6a236
2014-03-14 16:20:00 -07:00
Jeff Brown
9a3ed5bd3c am 70c27436: am daa1c969: am aaf23a9a: am c3f5d694: Merge "Hang off call by power button while screen is on"
* commit '70c274361ec6089c5ed9d1a62877d51b9ec1dcc8':
  Hang off call by power button while screen is on
2014-03-11 00:37:57 +00:00
Jeff Brown
daa1c96954 am aaf23a9a: am c3f5d694: Merge "Hang off call by power button while screen is on"
* commit 'aaf23a9a653457cccf54293b2ff76196718c7a1a':
  Hang off call by power button while screen is on
2014-03-11 00:11:10 +00:00
Jeff Brown
2901e0442a am 9e3de5f7: am 6f9f8e7a: am 01b5e765: Merge "Declare KEYCODE_SLEEP and KEYCODE_WAKEUP." into klp-modular-dev
* commit '9e3de5f70d77f7152b25fec6c27b73d037c1376d':
  Declare KEYCODE_SLEEP and KEYCODE_WAKEUP.
2014-03-08 05:43:12 +00:00
Jeff Brown
6212a49a94 Declare KEYCODE_SLEEP and KEYCODE_WAKEUP.
These new keys behave in similarly to KEYCODE_POWER but do not
simply toggle between awake and asleep states.

Sleep puts the device to sleep if it is awake.
Wakeup wakes up the device if it is asleep.

Bug: 12938999
Change-Id: I260fb918cc858882fe06fa880910df5763a76c5d
2014-03-07 14:02:55 -08:00
Jeff Brown
71c8fb92a1 am 2b27ef97: am c969450a: am 840c8474: Merge "Add config_supportAutoRotation." into klp-modular-dev
* commit '2b27ef979dba3808cdae6dce32fe27b59197e34c':
  Add config_supportAutoRotation.
2014-03-07 19:29:48 +00:00
Craig Mautner
00156ec200 Merge commit 'c29ab2dd' into manualmerge
resolved conflicts for merge of c29ab2dd to master

Change-Id: I231bde04ed804097e546d6275d248310593dc3c5
2014-03-06 22:29:37 -08:00
Jeff Brown
840c84749a Merge "Add config_supportAutoRotation." into klp-modular-dev 2014-03-07 04:40:10 +00:00
Jeff Brown
bcdfc62ae3 Add config_supportAutoRotation.
On some products, it may not make sense to use the accelerometer
to perform auto-rotation.  In that case, the product's config.xml
framework resource overlay should set config_supportAutoRotation
to false.

Setting this to false also disables auto-rotation settings.

Bug: 13211999
Change-Id: If9d7d72f2a2c576b14a4ff0afb61ea52c42c3357
2014-03-06 19:57:59 -08:00
Craig Mautner
f453f3a168 Merge "Show the keyguard if unsecure window on top" into klp-modular-dev 2014-03-07 01:25:50 +00:00
Will Haldean Brown
568628dc2c Manually merge commit '2faf28cf' into master
Original commit message:

  Add swipe-to-dismiss support to PhoneWindow.

  This adds a new window feature -- FEATURE_SWIPE_TO_DISMISS -- and a
  theme attribute to activate that feature. When the feature is
  activated, a SwipeDismissLayout is inflated as the DecorView layout.
  SwipeDismissLayout intercepts touch events and steals ones that are
  large swipes to the right if its children don't. PhoneWindow
  registers handlers that listen for these swipe events, translate the
  window when necessary, and finish the activity at the end of the
  gesture.

Conflicts:
	core/java/android/view/Window.java
	core/res/res/values/attrs.xml

Change-Id: I943290b436864ca4a1bd401b88d696e08c921cdd
2014-03-04 15:25:43 -08:00
Will Haldean Brown
bd79652a9a Merge "Add swipe-to-dismiss support to PhoneWindow." into klp-modular-dev 2014-03-04 21:22:30 +00:00
John Spurlock
3b86923854 am c6ecac77: am 38f81ccc: am fee6f69e: Merge "Volume panel should not clear system ui flags." into klp-dev
* commit 'c6ecac77cfa35bbc72a4b7e1e3374ad00f83b305':
  Volume panel should not clear system ui flags.
2014-03-04 19:19:14 +00:00
John Spurlock
ed7d7cba9d am c3371eb5: am 49eac16e: am 8ec59a72: Merge "Show hideycling for non-primary users." into klp-dev
* commit 'c3371eb5d4bde6dc11499efb313f7529a6bf6d59':
  Show hideycling for non-primary users.
2014-03-04 19:19:10 +00:00
John Spurlock
c6ecac77cf am 38f81ccc: am fee6f69e: Merge "Volume panel should not clear system ui flags." into klp-dev
* commit '38f81ccc768958b1a9100cb2caa93ec3aedd9b5e':
  Volume panel should not clear system ui flags.
2014-03-04 19:15:56 +00:00
John Spurlock
c3371eb5d4 am 49eac16e: am 8ec59a72: Merge "Show hideycling for non-primary users." into klp-dev
* commit '49eac16ec00ea63feaafc137a1d313fcb4374b36':
  Show hideycling for non-primary users.
2014-03-04 19:15:53 +00:00
John Spurlock
fee6f69e83 Merge "Volume panel should not clear system ui flags." into klp-dev 2014-03-04 19:09:20 +00:00
Will Haldean Brown
ca6234e084 Add swipe-to-dismiss support to PhoneWindow.
This adds a new window feature -- FEATURE_SWIPE_TO_DISMISS -- and a
theme attribute to activate that feature. When the feature is
activated, a SwipeDismissLayout is inflated as the DecorView layout.
SwipeDismissLayout intercepts touch events and steals ones that are
large swipes to the right if its children don't. PhoneWindow registers
handlers that listen for these swipe events, translate the window when
necessary, and finish the activity at the end of the gesture.

Change-Id: I512e758f3c3ffd3b353dba3b911c0e80a88d6f5f
2014-03-04 09:26:15 -08:00
John Spurlock
ca4d040342 Volume panel should not clear system ui flags.
Remove private WM flag (used only by the volume panel) to force
the clearable system UI flags clear.

Instead, always lay out the volume panel as if the bars are visible,
as we do for system dialogs - and don't clear the flags.

Reverts part of I25f29af5b6518aba695b64a75977ae240b742118

Bug:11986621
Change-Id: I842729d729d2a6eb2a687d0b930ddb160c6a1b57
2014-03-04 10:12:01 -05:00
John Spurlock
a3e41e7088 Show hideycling for non-primary users.
User 0 owns the window (system_server) but should be allowed
to display on a user's behalf.

Use the corresponding private flag for this system window, since
we cannot classify it by type (TYPE_TOAST) in policy.

Bug:12015090
Change-Id: I33aedb4624288415a5e1ae937676b693024546a9
2014-03-04 10:08:56 -05:00
Craig Mautner
ab55e524b8 Show the keyguard if unsecure window on top
When traversing windows save the fact that windows above the topmost
fullscreen window do not hide the lockscreen. If there is such a
window don't show it.

Fixes bug 13225149.

Change-Id: Ib6f33cbcfb2f60d8957a9184729ecdec80c6a236
2014-03-03 13:26:03 -08:00
George Mount
e180337ee9 Change Activity Scene Transitions to be more automatic redo.
This reverts commit 206e30cd93afe3eb72ec94178324417db5424ed2
along with removing the additional startActivity* methods
and replaces them with ActivityOptions makeSceneTransitionAnimation
methods.

Change-Id: I52bec31ae3c4cea6d549810ae5a7acd8aea176d8
2014-02-26 15:30:22 -08:00
George Mount
206e30cd93 Revert "Change Activity Scene Transitions to be more automatic."
This reverts commit f10587faadb9080a7bf9991cbe04bac5525da482.

Change-Id: I2785a3d2d6b667cad6d61dcbbc1c624161735fa4
2014-02-26 08:56:30 -08:00
George Mount
121e25dcf0 Merge "Change Activity Scene Transitions to be more automatic." 2014-02-25 23:47:57 +00:00
George Mount
f10587faad Change Activity Scene Transitions to be more automatic.
Shared element transitions are enabled by default
when the Window has a TransitionManager.

Shared element location and size are captured and
transferred to the target Activity.

ActionBar is treated as a shared element.

Change-Id: I0f22ea4e5cbe80254e848444e3f235cb742684f4
2014-02-25 11:12:16 -08:00
Kenny Guy
1a447535ce Hide managed profiles from user switchers.
Hide managed profiles from lockscreen user switcher on tablets.
Hide managed profiles from power menu user switcher on phones.
Add flag to enable multi user ui turned off by default.

Change-Id: I4c69a6f7b0f39c249fc85fd940318df1ddab073f
2014-02-24 19:24:42 +00:00
Craig Mautner
5eb4adcbda resolved conflicts for merge of d2794f5e to master
Change-Id: I24339e45e5fc697abf294286e2d6b57620ed9d1a
2014-02-21 17:52:15 -08:00
Craig Mautner
42bf39edbd Reset deferred task removal when app token added.
A task is scheduled for deletion after the final activity has
been removed and has animated away. But if another activity is then
added to the task the deletion flag must be reset.

Also added improved debugging.

Fixes bug 12987986.

Change-Id: I207ea6e9592a9e036d67aa5d1465b4acc5bdd120
2014-02-21 16:46:22 -08:00
Jeff Brown
10102e4c0e resolved conflicts for merge of baaa080b to master
Change-Id: I3ee12321e298f7a2ea577a99f30c49f3bb497fae
2014-02-20 18:05:03 -08:00
Jeff Brown
2687550272 Add a new "doze mode" based on Dream components.
When a doze component has been specified in a config.xml resource
overlay, the power manager will try to start a preconfigured dream
whenever it would have otherwise gone to sleep and turned the
screen off.  The dream should render whatever it intends to show
then call startDozing() to tell the power manager to put the display
into a low power "doze" state and allow the application processor
to be suspended.  The dream may wake up periodically using the
alarm manager or other features to update the contents of the display.

Added several new config.xml resources related to dreams and dozing.
In particular for dozing there are two new resources that pertain to
decoupling auto-suspend mode and interactive mode from the display
state.  This is a requirement to enable the application processor
and other components to be suspended while dozing.  Most devices
do not support these features today.

Consolidated the power manager's NAPPING and DREAMING states into one
to simplify the logic.  The NAPPING state was mostly superfluous
and simply indicated that the power manager should attempt to start
a new dream.  This state is now tracked in the mSandmanSummoned field.

Added a new DOZING state which is analoguous to DREAMING.  The normal
state transition is now: AWAKE -> DREAMING -> DOZING -> ASLEEP.
The PowerManager.goToSleep() method now enters the DOZING state instead
of immediately going to sleep.

While in the doze state, the screen remains on.  However, we actually
tell the rest of the system that the screen is off.  This is somewhat
unfortunate but much of the system makes inappropriate assumptions
about what it means for the screen to be on or off.  In particular,
screen on is usually taken to indicate an interactive state where
the user is present but that's not at all true for dozing (and is
only sometimes true while dreaming).  We will probably need to add
some more precise externally visible states at some point.

The DozeHardware interface encapsulates a generic microcontroller
interface to allow a doze dream for off-loading rendering or other
functions while dozing.  If the device possesses an MCU HAL for dozing
then it is exposed to the DreamService here.

Removed a number of catch blocks in DreamService that caught Throwable
and attempted to cause the dream to finish itself.  We actually just
want to let the process crash.  Cleanup will happen automatically if
needed.  Catching these exceptions results in mysterious undefined
behavior and broken dreams.

Bug: 12494706
Change-Id: Ie78336b37dde7250d1ce65b3d367879e3bfb2b8b
2014-02-20 13:39:13 -08:00
John Spurlock
ed0cd0c38d Merge "Don't call back into AM to get current user." 2014-02-19 16:17:31 +00:00
John Spurlock
4355a533bc Don't call back into AM to get current user.
Bug:13079471
Change-Id: I733d6e3c41c91008406261eac827e6b65bb400db
2014-02-19 09:49:25 -05:00
John Spurlock
1db8b68237 Content inset hint should consult PolicyControl.
Missed instance of sysuivis modification from prior commit.

Change-Id: I40af7da262a00a3a379234f42444e49883d76270
2014-02-18 11:20:57 -05:00
John Spurlock
d9b70bdc1a Simplify immersive mode confirmation cling logic.
Instead of keeping track of confirmations per-package, track
a global confirmation per-user.  If the panic signal is received,
reshow the cling at most once per-user per-reboot.

Ensure the nav bar becomes visible after the panic signal.
Usually this happens as a side effect of showing the keyguard.
However, in the case where there is no keyguard (Security = None)
show the transient nav bar temporarily as a hint.

Also listen to the correct observer uri to pick up confirmation
setting changes.

Bug:12242125
Change-Id: Ic95e2a8630ec3802b8ef462fcaa92366b9343a3f
2014-02-12 10:33:21 -05:00
John Spurlock
b8c37e2507 Fix NPE in PolicyControl.
Bug:12957738
Change-Id: I8051a7a0656f50ed63321f9a79faf0383d7c66b4
2014-02-10 15:36:24 -05:00
John Spurlock
0e29ad02f9 Merge "Global system setting to override certain window policy." 2014-02-06 00:53:42 +00:00
John Spurlock
c6d1c60fb1 Global system setting to override certain window policy.
Specifically, the ability to force immersive-mode-like behavior
on the status bar, the navigation bar (or both) on a
package-by-package basis - and to disable immersive mode
confirmations for specific packages.

Change-Id: I2df7092a91eceeb815367ef917dd7289f4f2b27e
2014-02-05 16:45:23 -05:00
George Mount
0a778eda69 Cross-Activity Scene transition API.
First pass at API for cross-Activity Scene transitions.
Remaining work:
  Transition back
  Automatically capture hero element info
  Transfer of surface texture to synchronize between Activities
  Possibly use scene names to indicate preferred transition

Change-Id: I59d07de1fae694a46b92b1c82525daa301ec1377
2014-02-04 16:18:43 -08:00
Alan Viverette
8eea3ea559 Add APIs for obtaining themed Drawable from Theme, Context
BUG: 12611005
Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
2014-02-03 18:42:24 -08:00
John Spurlock
40e61fb7c8 Remove unused line from PhoneWindowManager.
Change-Id: I2b2dc1f08e32b2731409fcf192712ca0cc269f0a
2014-02-03 09:44:00 -05:00
Jim Miller
76bd2d9b52 am cd655f12: Merge "Fix broken homekey on devices without keyguard" into klp-modular-dev
* commit 'cd655f12e730a76e2a97ce6af775b852adc493ce':
  Fix broken homekey on devices without keyguard
2014-01-13 22:28:03 +00:00
Jim Miller
fb5fceaedc Fix broken homekey on devices without keyguard
Fixes bug 12447288

Change-Id: I580dbeac03b56c01d33844f094eaac20d7aba119
2014-01-11 02:33:04 +00:00
Craig Mautner
1f7488e219 resolved conflicts for merge of 4504de5d to master
Change-Id: I8d96fd2b479aebd6de913e617ca190f66c25aaa5
2014-01-10 11:15:19 -08:00
Craig Mautner
4504de5d5a Implement ActivityView.
With an existing ActivityContainer a caller can now create an
ActivityView which consists of a new VirtualDisplay immediately
attached to the ActivityContainer.

Change-Id: Id70333dcbef55d524a87df8f8c92d72ca5579364
2014-01-10 10:54:55 -08:00
shower
3ac2f66f4c Hang off call by power button while screen is on
Enable power button end call and screen is off.  User use power button
to turn on screen will end call.  Should turn on screen and not end call

Change-Id: Idf34f7724dbf1796205332c5c7ef663102f8a30c
Signed-off-by: shower <shower929@gmail.com>
2014-01-03 15:33:50 +08:00
Mike Lockwood
e63f6f7c8d DO NOT MERGE: Remove obsolete "headless" support
Change-Id: I829fe48e6ebcb819e260646bb19ac6ddfcf07f83
2013-12-09 15:14:37 -08:00
John Spurlock
0513d5abb6 Show hideycling for non-primary users.
User 0 owns the window (system_server) but should be allowed
to display on a user's behalf.

Use the corresponding private flag for this system window, since
we cannot classify it by type (TYPE_TOAST) in policy.

Bug:12015090
Change-Id: I33aedb4624288415a5e1ae937676b693024546a9
2013-12-09 11:59:45 -05:00
Adam Powell
cfbe9be5b3 Add support for cross-activity scenes and transitions
* Add theme attributes for specifying a top-level TransitionManager
  for an activity window.

* Add window feature for automatic content transitions. This
  automatically assigns/creates a Scene for setContentView calls.

* Add named transitions. This allows apps to define APIs for
  handshake-agreements about which exit/entrance transitions to play.

* Add new transition type for ActivityOptions. This lets the system
  use ActivityOptions to communicate transition specifics and
  arguments to the called activity.

* Have ActivityManager pass appropriate ActivityOptions through to the
  called Activity. Have the called activity call back into the caller
  to let it know which transition of a possible requested set was
  chosen.

Still to do:

* Define and pass arguments for transitions. This will require
  defining a Parcelable version of TransitionValues and deciding how
  much leeway apps should have for these things.

* Determine how to appropriately filter the ActivityOptions bundle so
  that only appropriate data reaches the target.

* Determine if generalizing the auto-Scenes functionality to
  ViewGroups is appropriate.

Change-Id: I10684b926129ab2fbc1adec9ef31767237acae79
2013-12-05 10:06:19 -08:00