79 Commits

Author SHA1 Message Date
Casey Burkhardt
4a0e02377c am bdbd4736: Merge "Refinements to magnification for improved wearable support." into lmp-mr1-modular-dev
* commit 'bdbd4736351231aac4da720ff7326ea2791e0b00':
  Refinements to magnification for improved wearable support.
2015-02-19 01:06:51 +00:00
Casey Burkhardt
0944984c36 Refinements to magnification for improved wearable support.
This change refactors ScreenMagnifier to use resources for its triple-tap
adjustment and scale threshold values.  New values more appropriate for
wearable form factors are supplied.  This also fixes a bug in the triple-
tap detection logic where the incorrect ViewConfiguration value for the
tap threshold was used, prematurely disqualifying some touch events as
potential taps.

Change-Id: If47e556aadb5beb1bad24644122560c6fbe33bad
2015-02-18 12:24:45 -08:00
Svetoslav
f8acd7a961 Fix broken activation of the selected view in accessibility mode. automerge: ded133c
automerge: b6b526e

* commit 'b6b526eaafdcc39e9d55a82f61f1e03c4a3487c3':
  Fix broken activation of the selected view in accessibility mode.
2015-02-03 07:27:33 +00:00
Svetoslav
ded133c446 Fix broken activation of the selected view in accessibility mode.
We were using an approximation to determine where to send a pair of down
and up events to click on the view that has accessibility focus. We were
doing reverse computation to figuring out which portion of the view is
not covered by interactive views and get a point in this region. However,
determining whether a view is interactive is not feasible in general since
for example may override onTouchEvent. This results in views not being
activated or which is worse wrong views being activated.

This change swithes to a new approach to activate views in accessibility
mode which is guaranteed to always work except the very rare case of a
view that overrides dispatchTouchEvent (which developers shouldn't be
doing). The new approach is to flag the down and up events pair sent
by the touch explorer as targeting the accessibility focused view. Such
events are dispatched such that views predecessors of the accessibility
focus do not handle them guaranteeing that these events reach the accessibiliy
focused view. Once the accessibiliy focused view gets such an event it clears
the flag and the event is dispatched following the normal event dispatch
semantics.

The new approach is semantically equivalent to requesting the view to perform
a click accessiblitiy action but is more generic as it is not affected by
views not implementing click action support correctly.

bug:18986806
bug:18889611

Change-Id: Id4b7b886c9fd34f7eb11e606636d8e3bab122869
2015-02-02 23:17:17 +00:00
Svetoslav
cd2ed4e64c Accessibility: Sometimes cannot interact with nav bar items. automerge: 10a053e
automerge: db1983b

* commit 'db1983b3f43e86acbf188961f53af794cce05219':
  Accessibility: Sometimes cannot interact with nav bar items.
2015-01-23 23:31:38 +00:00
Svetoslav
10a053e474 Accessibility: Sometimes cannot interact with nav bar items.
If there is a window with the accessibility focus we want to click
on the accessibility focused view in this window. The logic to
compute the bounds of the window was using the wrong window id,
hence getting an incorrect result. As a consequence in some cases
the user could not click on accessiiblity focused controls in the
nav bar.

bug:18889611

Change-Id: I89aee3ae2ffe27fe29819049c287a7155154c65b
2015-01-23 15:05:20 -08:00
Svet Ganov
9b3ab29ffa am 26c88954: am 14e3351a: Merge "Fix a NPE in AccessiiblityManagerService." into lmp-mr1-dev
* commit '26c8895465bbc94efb0cc96460e5eabe88382698':
  Fix a NPE in AccessiiblityManagerService.
2014-12-12 21:02:30 +00:00
Svet Ganov
14e3351a1e Merge "Fix a NPE in AccessiiblityManagerService." into lmp-mr1-dev 2014-12-12 20:49:01 +00:00
Svet Ganov
09687064f4 Fix a NPE in AccessiiblityManagerService.
It is possible that the accessibility windows list is null which
is treated as if there is no window information. The getWindows
method was accessing properties of the windows filed witgout a
null check.

bug:18522998

Change-Id: Ieefe678d3da3d6e8f96c0e4bedac0c55975621fa
2014-12-11 22:59:12 -08:00
Svet Ganov
a3bc48c863 am e39fc96c: Merge "Ignore accessibility overlay when computing window\'s interactive region." into lmp-mr1-dev
automerge: a706c90

* commit 'a706c9079a60531d79a3f32f263c37f386229564':
  Ignore accessibility overlay when computing window's interactive region.
2014-12-10 19:43:33 +00:00
Svet Ganov
12b7328c0b Ignore accessibility overlay when computing window's interactive region.
If an accessibility service opts-in for the new window introspection APIs
when calling into a window for accessibility node infos we compute the
window's interactive region, i.e. the portion that is touchable and not
covered by other touchable windows, in roder to deterine whether these
nodes are visible, i.e. the user can interact with them. There was a bug
in the interactive region computation what we were not ignoring accessibility
overlay windows which are intended to not change what an accessibility
service can "see" and are put by such a service.

bug:18652374

Change-Id: I24ce54069087af9bc308e0c6a7b2aa6b952a6136
2014-12-09 12:27:04 -08:00
Svetoslav
f477aeb367 am ed068f7c: am 3a0d878a: Ensure all events from a showing window are dispatched.
* commit 'ed068f7c3047b3775647a6023c6960a4fc535144':
  Ensure all events from a showing window are dispatched.
2014-12-08 19:12:22 +00:00
Svetoslav
3a0d878ab5 Ensure all events from a showing window are dispatched.
Accessibility services may opt-in to introspect the interactive
windows on the screen. If window introspection is enabled there
is a case where some events from a showing window are received
before the updated window state from the window manager. Now the
window manager sends over the windows before notifying the app
for the focus change.

bug:18625996

Change-Id: Ic481e01efbe12dc92f090f799feeb236672fc7b3
2014-12-05 00:37:38 +00:00
Svetoslav
eed63916a1 am bd6fabe2: Merge "APIs for an accessibility service to put interaction tracking overlays." into lmp-mr1-dev
automerge: 89e7ffe

* commit '89e7ffedadd20a3091e72b42f86c500452df193c':
  APIs for an accessibility service to put interaction tracking overlays.
2014-10-24 02:04:11 +00:00
Svetoslav
3a5c721072 APIs for an accessibility service to put interaction tracking overlays.
An accessibility service may register to observe the interactive windows
on the primary display. These windows are the one that has input focus and
ones a sighted user can touch. It is sometimes beneficial for an
accessibility service to overlay a window to intercept user interaction
and based on that introspect and perform an action on the windows that
are on the screen. This is problematic as overlaying a full screen window
that is touchable prevents the accessibility service to introspect the
content under this window.

This change adds a special type of window that only an accessibility service
can place which does not affect what an accessibility service can "see" on
the screen. Hence, even putting such a window full screen the service will
be able to interact with the other interactive windows it covers.

Change-Id: I053ccc3a5c6360a98dc40bdb172b54dab35d8b31
2014-10-21 14:45:53 -07:00
Adrian Roos
4e2c298876 am 2f6fd874: am 5f978bfa: Merge "Retire RecentApplicationsDialog" into lmp-mr1-dev
* commit '2f6fd874510cd333f7fc0b08e146d5d069fa2013':
  Retire RecentApplicationsDialog
2014-10-20 13:15:40 +00:00
Adrian Roos
5f978bfa09 Merge "Retire RecentApplicationsDialog" into lmp-mr1-dev 2014-10-20 13:04:09 +00:00
Kristian Monsen
a64eb6ecf0 am f08b7ce9: am f247b908: am 4183a2fc: am 5d604181: Merge "Let TYPE_ANNOUNCEMENT be sent from any window" into lmp-dev
* commit 'f08b7ce9e9888fc77bfe8d4af70500a7530aedcb':
  Let TYPE_ANNOUNCEMENT be sent from any window
2014-10-18 00:13:01 +00:00
Kristian Monsen
5d60418132 Merge "Let TYPE_ANNOUNCEMENT be sent from any window" into lmp-dev 2014-10-17 23:54:01 +00:00
Svetoslav
f43465452b am 0ee9f361: am 0b5af04a: am ebb38bcc: am cd2b54e6: Merge "Accessibility no longer overrides strong encryption." into lmp-dev
* commit '0ee9f36140530cf8ee60613f4f057c2ec95fe498':
  Accessibility no longer overrides strong encryption.
2014-10-17 23:19:57 +00:00
Svetoslav
a6711ff6f0 Accessibility no longer overrides strong encryption.
Updating the accessibility layer behavior to reflect the new
model where accessibility no longer overrides strong encryption.
Now enabling an accessibility service lowers the encryption
level but the user can bump it up in settings if desired.

bug:17881324

Change-Id: Ic60d760c267d3f934040a42e1963b179bd8b9f5f
2014-10-17 14:33:11 -07:00
Kristian Monsen
ba3787d849 Let TYPE_ANNOUNCEMENT be sent from any window
Part of fix for bug 17905712

Change-Id: I4e4b09f6b6342a27744e42984d483ef8de18fbff
2014-10-17 14:13:07 -07:00
Svet Ganov
eec22a1c24 am 216d08ff: am 0ee1d87c: am 515f14d4: am b22552c3: Merge "Send accessibility events with no window." into lmp-dev
* commit '216d08ffd548d056101af14af4634f4d796cec51':
  Send accessibility events with no window.
2014-10-16 19:56:04 +00:00
Svet Ganov
d5b0842a1d Send accessibility events with no window.
An app can send an accessibility event by calling the send methods
on view or directly asking the accessibility manager to do that.
While the recommened way to send such events is calling the methods
on view a legacy app or app whose developer did not read the docs
carefully may be calling the accessibility manager APIs directly.
In such a case the event does not have assigned window id and does
not get send. Since events fired by using the accessibility manager
directly lack context to determine whether thier source is important
for accessibility we assume they come from an important view to
avoid breaking backwards compatibility.

bug:18001711

Change-Id: Ie1c298fa5a0670cbeaedfcd64f820961c296b6ca
2014-10-16 17:31:52 +00:00
Adrian Roos
9a64513c7f Retire RecentApplicationsDialog
Bug: 5162991
Change-Id: I429da977502f33e2091496f3a075b2c507a88e1f
2014-10-08 02:59:56 +02:00
Svetoslav
848a1df159 am a8df007d: am 423bf3d0: am cf0e4706: am 8ff6d70d: Merge "Clear identity before calling into the mount service." into lmp-dev
* commit 'a8df007dd468730fb581e135d46e0ddead9106fb':
  Clear identity before calling into the mount service.
2014-10-04 15:45:44 +00:00
Svetoslav
bd998385f0 am a12d4856: am 3eddddb5: am c3493f94: am 88676e0b: Merge "TouchExploer computes incorrectly the click location." into lmp-dev
* commit 'a12d48567478265bc360f2c29cc194d8830c099f':
  TouchExploer computes incorrectly the click location.
2014-10-04 15:45:40 +00:00
Svetoslav
8ff6d70d44 Merge "Clear identity before calling into the mount service." into lmp-dev 2014-10-03 23:36:17 +00:00
Svetoslav
9f70a4cc6d Clear identity before calling into the mount service.
bug:17787265

Change-Id: I4b9268d101e9ccfc30876fbf54bf28bb41fb4be6
2014-10-03 16:32:26 -07:00
Svetoslav
47b9c1524f TouchExploer computes incorrectly the click location.
If there is accessibilty focus and the user touch explores
location that does not change accessibility focus that is
not in the app window, e.g. system bar, double tap does not
click on the system UI affordance.

bug:17588024

Change-Id: I6c8c0f65b208ae1d3f31d7f06b0721dc223ec19f
2014-10-03 16:17:26 -07:00
Svetoslav Ganov
04c4b5ea9f am e53a3188: am 9ae2bca4: am 31deb67d: am 76716c5a: Revert "TouchExplorer computes incorrectly the click location."
* commit 'e53a3188365550d17422e534f6aec80249dbc447':
  Revert "TouchExplorer computes incorrectly the click location."
2014-10-03 21:52:51 +00:00
Svetoslav Ganov
76716c5a18 Revert "TouchExplorer computes incorrectly the click location."
This reverts commit 851a5059a47cbf76e530c9d050a677cb6e3f8657 as
it creates a regression. Let us revert this and correctly fix the
issue the original change was trying to address.

bug:17789608

Change-Id: I8abb1a61d5310430e839e4ef60e7ca5cc0cbdd80
2014-10-03 20:37:10 +00:00
Svetoslav
893a15d1e4 am 0671790c: am c088ecc3: am 304a3528: am d35b072d: Merge "Fix accessiblity introspection from the shell user regression." into lmp-dev
* commit '0671790c2895865ff0cc7780027427d1a9b95667':
  Fix accessiblity introspection from the shell user regression.
2014-10-02 13:37:37 +00:00
Neil Fuller
c2a0b4482d resolved conflicts for merge of ee665151 to lmp-mr1-dev-plus-aosp
Change-Id: I2588c65b7a9fa43f968151a206924a804f0595a7
2014-10-02 14:32:37 +01:00
Svetoslav
d35b072dca Merge "Fix accessiblity introspection from the shell user regression." into lmp-dev 2014-10-01 23:24:47 +00:00
Svetoslav
ceac51dedd Fix accessiblity introspection from the shell user regression.
Accessibility introspection APIs are meant to query only the state of
the current user. There are command line tools that run as the shell
user and want to be able to intropspect the screen. When resolving
the calling user we were using the calling user id instead of the
special constant for the current user.

Now when resolving the calling user for intrspection we are using
the current user constant and consequentially only the current
user or a profile of the current user or the root or the shell or
the system or an app with cross user permission can introspect the
screen.

bug:17674631

Change-Id: I36d1d7b65441d04c3b4204123c4b6d036ff032c0
2014-10-01 15:07:27 -07:00
Svetoslav
6b491b64ba Merge "Invalid accessibility state if UI test process crashes in a bad time." into lmp-dev 2014-09-30 23:33:56 +00:00
Svetoslav
419036b560 Invalid accessibility state if UI test process crashes in a bad time.
We allow a fake accessibility service to connect to the system for UI
automation. If the process hosting the fake service dies right after
registering it, the accessibility layer ends up in a bad state and
subsequent attempts to connect UI automation service fail.

bug:17725904

Change-Id: Idad288eab41bbdd486d95e1e5803220640653fb7
2014-09-30 16:04:50 -07:00
Svetoslav
16e4a1aade Use default encryption password if an accessibility service is enabled.
When device is encrypted the user has to authenticate in order to decrypt
the data partition which is required for running accessibility services
and Text-To-Speech. In order to address this issue we are falling back
to use the default password if there is an enabled accessibility service
and the user has secure lock. This will enable the user to authenticate
when accessibility layer is completely functional.

bug:17671790

Change-Id: Iafffe7bcd234008cf91ffb5011b21b803dca227a
2014-09-30 13:00:11 -07:00
Svetoslav
54b0a05b00 Merge "Invalid active window if temporary disabling accessibility for test tools." into lmp-dev 2014-09-26 01:28:36 +00:00
Svetoslav
3f92ffc369 Invalid active window if temporary disabling accessibility for test tools.
If accessibility is enabled and a test tool based on the accessibility APIs
connects to the system we suspend the current accessibility services while
the tool is running (to avoid inteference as the tool is such a service) and
after the tool disconnects we restore the accessibility state. The issue is
that when clearing the accessibility state we were also wrongly clearing the
active window. We are now careful to not clear the active window in such a
case.

It is also possible that the active window was never initilaized before the
tool is run so now it is lazily loaded such that if we do not know which one
it is, we get the one the has input focus. The definition of an active window
is the one that has input focus or the user is touching.

bug:17663432

Change-Id: I8868866a5126c590d3bddad099ababb97978227a
2014-09-25 16:57:11 -07:00
Svetoslav
471157821f Merge "Accessibility in bad state after using SDK tool uiautomatorviewer." into lmp-dev 2014-09-25 23:27:01 +00:00
Svetoslav
dd81183bbe Accessibility in bad state after using SDK tool uiautomatorviewer.
The UiAutormator tool is a part of the SDK. If it is run while
accessibility is enabled it stops all accessibility services
as it is an accessibility service itself to avoid interference
and when done restores back the accessibility state. The issue
was that the accessibility state is not restored leaving the
device in a bad state.

bug:17662770

Change-Id: I3c4f46fa05c76b874eeffdeb867ef433c3fedf2e
2014-09-25 15:56:31 -07:00
Svetoslav
8aeb091294 Accessibility events may be fired even if no services observe them.
If all accessibility services are disabled we turn off event firing
to avoid a lot of work for nothing. The logic to do that had a flaw
and was not turning event firing off in every case it should. We were
tuning event firing if it is on and no service is enabled but it
is possible that a package on the system image is disabled so the
service is enabled just not bound. Arguably we can remove the
serivice from the enabled list but it is technically on the device.
Note that we correctly handle the case of a package being removed.

bug:17332506

Change-Id: I6d6d9cb9cc271116a3d22ed9fd8d7f533dec9a0b
2014-09-24 17:55:53 -07:00
Svetoslav
8d412fe18b TouchExploer computes incorectly the click location.
If there is accessibilty focus and the user touch explores
location that does not change accessibility focus that is
not in the app window, e.g. system bar, double tap does not
click on the system UI affordance. This is due to obsolete
logic from the time where accessibility focus was only in
the active window at the time of double clicking.

bug:17588024

Change-Id: Ib780103e873d8a2afd3b35de3227d54116f1a1b0
2014-09-19 16:54:20 -07:00
Svetoslav
4c6a4ce03b Some accessibility events wrongly filtered out (regression).
We added new APIs to allow accessibility services to query all
windows a user can touch. Sometimes the window state change
event arrives before the window manager sent over the new window
state which leads to a case that the app gets the event and
asks for the window and the window is not there. To address this
if we do not have the window, we hold on to the event and
fire it as soon as the window arrives. This logic is correct
except we were wrongly expecting that the window should have
input focus.

bug:17464645

Change-Id: I1ef50ebddeb4416a6c0776b096bb16aee703700c
2014-09-18 01:40:27 +00:00
Svet Ganov
7498efdc5e Clicking on partially coverd views by other views or windows.
In touch exploration mode an accessibility service can move
accessibility focus in response to user gestures. In this case
when the user double-taps the system is sending down and up
events at the center of the acessibility focused view. This
works fine until the clicked view's center is covered by another
clickable view. In such a scenario the user thinks he is clicking
on one view but the click is handled by another. Terrible.

This change solves the problem of clicking on the wrong view
and also solves the problem of clicking on the wrong window.
The key idea is that when the system detects a double tap or
a double tap and hold it asks the accessibility focused node
(if such) to compute a point at which a click can be performed.
In respinse to that the node is asking the source view to
compute this.

If a view is partially covered by siblings or siblings of
predecessors that are clickable, the click point will be
properly computed to ensure the click occurs on the desired
view. The click point is also bounded in the interactive
part of the host window.

The current approach has rare edge cases that may produce false
positives or false negatives. For example, a portion of the
view may be covered by an interactive descendant of a
predecessor, which we do not compute (we check only siblings of
predecessors). Also a view may be handling raw touch events
instead of registering click listeners, which we cannot compute.
Despite these limitations this approach will work most of the
time and it is a huge improvement over just blindly sending
the down and up events in the center of the view.

Note that the additional computational complexity is incurred
only when the user wants to click on the accessibility focused
view which is very a rare event and this is a good tradeoff.

bug:15696993

Change-Id: I85927a77d6c24f7550b0d5f9f762722a8230830f
2014-09-07 23:36:20 -07:00
Alan Viverette
d2b3e034d1 Don't switch to touch exploring state on pointer up
BUG: 17388688
Change-Id: I146aa2290acf0a587eaccafa5a208ee1cbd84aa5
2014-09-04 13:18:44 -07:00
Svetoslav
9bf08c7bc1 Clear binder identity when sending window change accessibility events.
We get calls for window changes from the window manager and
as a result send accessibility events for these changes. It
is possible that the call for a windows change from the window
manager comes as a result of an unprivileged client calling
into the window manager. However, the event sending code
is performing security checks.

bug:17364244

Change-Id: Ief016f9dafd13ac35418676817848b3ea3ed4d66
2014-09-03 16:29:35 -07:00
Svetoslav
9ae9ed24aa Fix AccessibilityNode's isVisibleToUser behavior.
The isVisibleToUser property of an AccessibilityNodeInfo specifies
whether the user can see the source view. It is used by accessibility
services to figure out whether to focus on a view. This property
was giving a wrong value if the view is covered by another window
such as the keyboard. As a result the user hears one thing but when
double taps interacts with the overlaid window which is another thing.

bug:15938254

Change-Id: Ib9feb20ea422a24a512c47ed1234961ae0386a7f
2014-09-02 16:46:23 -07:00