Commit Graph

9275 Commits

Author SHA1 Message Date
Abodunrinwa Toki
b89cf026cf TextClassificationManager: Avoid exposing lock.
Test: CtsViewTestCases passes
Bug: 35040457
Change-Id: Ia27730816f8aa4832a16aa9ebcafac68acb79e27
2017-02-07 20:41:44 +00:00
Evan Rosky
a5082a3f67 Merge "Default focus order now tries to adhere to view hierarchy" 2017-02-07 19:40:44 +00:00
Phil Weaver
1e2758256a Merge "Provide text locations to accessibility services." 2017-02-07 19:14:09 +00:00
Felipe Leme
fb0f360222 Merge "Refined session management so Save can be automatically called." 2017-02-07 17:50:29 +00:00
Felipe Leme
bab851c7c9 Refined session management so Save can be automatically called.
This is yet another big refactoring:

- AutoFillManager keeps track of its current AutoFillSession.
- Views call AFM.startSession(View) when they can trigger autofill.
  (virtual views can call it as well). At this point, the manager
  sets an AutoFillSession, gets the activity token, and passes it to
  the service.
- Subsequent calls to AFM.start() will be ignored since the session
  is set.
- When the Activity is gone, it calls AFM.finishSession().
- Simlilarly, virtual views could call it as well.
- Added getAutoFillValue() to View.
- Removed AFM.updateAutoFillInput(childId): virtual views should now
  call startSession(childId) to start a session, and use the
  VirtualViewListener callbacks for updates.
- Change AutoFillValue to use String (which is immutable) instead of
  CharSequence for text values.
- Check if view is enabled before auto-filling.
- Removed 'cmd autofill fill' since it would require the appCallback
- Automatically dismiss the snack bar after 30s
- Moved the "don't change autofill value when autofilling" Inception
  logic into the service side.
- Etc...

BUG: 34819567
BUG: 33269702
BUG: 31001899

Test: manual verification
Test: CtsAutoFillServiceTestCases passes

Change-Id: I5fad928d4d666701302049d142026a1efa7291cd
2017-02-06 18:22:03 -08:00
Casey Burkhardt
edb54686c2 Merge "Initial implementation of Nav Bar Accessibility Button" 2017-02-07 00:14:49 +00:00
Phil Weaver
c2e28932d2 Provide text locations to accessibility services.
Bug: 30170631
Test: New CTS tests on linked CL.
Change-Id: I723e3777189c8df71c59dada00abdf339ebc983d
2017-02-06 12:57:17 -08:00
Casey Burkhardt
048c2bc19a Initial implementation of Nav Bar Accessibility Button
This allows an AccessibilityService to set a flag in its
AccessibilityServiceInfo that triggers the navigation bar to show an
Accessibility Button and observe callbacks when the button is clicked
or there are changes in the visibility of the navigation bar.

Test: Manual (Created a sample AccessibilityService) + CTS
Bug:29231271
Change-Id: I03d653d85bc37df28ed71d8bba94b7c75fe56e43
2017-02-06 12:56:08 -08:00
Aga Madurska
5084e356ac Use correct APIs to detect conditions for round scrollbars. am: 99485ef841 am: 50bc6a1998
am: 65f351d923

Change-Id: I8ad9e04055409c6efb92d00f59660820f765944c
2017-02-06 19:46:37 +00:00
Aga Madurska
65f351d923 Use correct APIs to detect conditions for round scrollbars. am: 99485ef841
am: 50bc6a1998

Change-Id: Iab07814fd54b35705a20088e29c78a56ea943eba
2017-02-06 19:40:50 +00:00
Aga Madurska
50bc6a1998 Use correct APIs to detect conditions for round scrollbars.
am: 99485ef841

Change-Id: I8301a27b03d1ba64e48064057f112ebaf38eb6c2
2017-02-06 19:37:00 +00:00
Selim Cinek
391b1b82d2 Merge "Further improved the coloring optimization" 2017-02-06 18:20:37 +00:00
TreeHugger Robot
40eb0ba427 Merge "Revert "Implicitly cast views obtained via View.findView methods"" 2017-02-06 17:37:49 +00:00
Aga Madurska
99485ef841 Use correct APIs to detect conditions for round scrollbars.
Bug: 34876394

Test: Performed manually.

Change-Id: I9e690e99fd8d925c589ebd19d9c6754eeb63b1d8
2017-02-06 12:33:36 +00:00
Svet Ganov
0f4928f1f7 Refactoring of auto fill - lifecycle, auth, improvements
1. Move management of the remote fill service in a dedicated
   class that abstracts away the async and ephemeral nature
   of the binding.

2. Update auth to move fingerprint out of the platform and
   allow response and dataset auth.

3. Cleaned up the fill and save callback classes.

4. The UI is now shared among all sessions and cleaned up.

5. Reshuffled the remote callbacks to have cleaner separation.

6. Cleaned up and tightened the reponse and dataset classes.

7. Added API to support communicationn with intent based auth.

Test: CTS + manually

bug:31001899

Change-Id: Idc924a01d1aea82807e0397ff7293d2b8470d4d6
2017-02-06 04:02:35 +00:00
Selim Cinek
9910483608 Further improved the coloring optimization
Fixes a few follow up bugs from the colorized
notification CL.

This also allows media notifications with a media
session to be colorized by default.

Test: existing tests pass
Bug: 34469375
Change-Id: I36348591a84fcd39d103d0ae3f64720f2fca2cf2
2017-02-03 16:11:51 -08:00
Alan Viverette
177f37367e Revert "Implicitly cast views obtained via View.findView methods"
This reverts commit 06c2fffdaa.

Reason for revert: Java 8 doesn't support this magic.

Change-Id: Iaa41f4e4d0072b9a97cff9cd3788403d4ab79d13
2017-02-03 17:08:47 -05:00
Yohei Yukawa
74e5ff6e92 Merge "Simplify the constructor of InputMethodInfo" 2017-02-03 01:33:42 +00:00
Abodunrinwa Toki
fafdb7372f Fix TextClassifier.getTextClassificationResult()
Gracefully handles situations where a default app cannot be found
to handle the intent.

1. If we can not find any app to handle the intent,
   do not include an "assist" menu item entry to fire the intent.
   Also, do not linkify the entry.
2. If we do not have a default app to handle the intent,
   show a generic title for apps that will handle the intent
   and do not include an icon.

In the ideal case where we find a default app to include the intent,
show the app's (preferably activity's) title and icon.

Test: Manually tested. There's an AI to write more automated tests.
Bug: 34777322
Bug: 34927631
Change-Id: Ia94efbbdda3da8f181fac9228cd2d3a76cb727d3
2017-02-02 20:35:51 +00:00
TreeHugger Robot
62e1a05076 Merge "Alert Windows behavioral changes" 2017-02-02 19:47:29 +00:00
Abodunrinwa Toki
4039454f6f TextClassificationManager: Make certain methods thread-safe
1. getDefaultTextClassifier()
2. getLanguageDetector()

Test: CtsWidgetTestCases passes
Change-Id: Ie0cb866cdefea2839efb38a1113e434a3e8159b0
2017-02-02 17:16:36 +00:00
Wale Ogunwale
5cd907d3d6 Alert Windows behavioral changes
- Introduced TYPE_APPLICATION_OVERLAY window type. Can be used by apps
to display windows on top of other app windows, but below critical
system windows.
- Deprecate alert window types TYPE_PHONE, TYPE_SYSTEM_ALERT,
TYPE_SYSTEM_OVERLAY, TYPE_PRIORITY_PHONE, and TYPE_SYSTEM_ERROR.
Apps should now use TYPE_APP_OVERLAY for this.
- Apps targetting O or greater are not allowed to add the old alert
window types.
Apps targetting less than O can still add the old types.
Apps with permission INTERNAL_SYSTEM_WINDOW (system signature apps) can
still add the old types.
- Z-order old alert windows types below TYPE_APPLICATION_OVERLAY if
they are added by an app without the INTERNAL_SYSTEM_WINDOW permission.

Test: android.server.cts.AlertWindowsTests
Bug: 33256752
Change-Id: I12170955a7a333151d3387c169b51c53c32164fc
2017-02-02 08:20:49 -08:00
Yohei Yukawa
ddad4b93fa Simplify the constructor of InputMethodInfo
This is a preparation CL for fixing Bug 32343335, where we aim to
avoid unnecessary reconstruction of InputMethodInfo objects by caching
immutable part of those metadata by APK revisions.

The reason why we have had to pass additional subtypes not just as
List<InputMethodSubtype> but as Map<String, List<InputMethodSubtype>>
to create an instance of InputMethodInfo is that how to compute
so-called IME ID is not exposed from InputMethodInfo even as @hide
method.

In practice it has been calculated as
  new ComponentName(packageName, serviceName).flattenToShortString()
and those IDs are already stored here and there including secure
settings.  It is almost impossible to change the rule anymore hence
we should consider them to be a kind of public API.

This CL adds a @hide static method InputMethodInfo#computeId() to
make it clear.  This also enables us to simplify the constructor
of InputMethodInfo finally, because we have used IME IDs as keys
in subtypes.xml, where additional subtypes are stored.

Test: Manually verified that addtional subtypes still work
Test: checkbuild
Bug: 32343335
Change-Id: I1deaa470e042eac749e7a847933d14448a0d9e03
2017-02-02 01:46:13 -08:00
Felipe Leme
5523f9a2fc Merge "Improved AutoFill Save workflow." 2017-02-02 02:05:32 +00:00
TreeHugger Robot
bc5d58307a Merge "Fix a bug in View#hasFocusable with new auto-focusable behavior" 2017-02-01 23:23:43 +00:00
Felipe Leme
0200d9ea15 Improved AutoFill Save workflow.
Currently, the onProvideAutoFillStructure() methods can be called
twice: to auto-fill an activity and to save the activity's data
in the service.

The problem with this approach is that when the save workflow is
called, the activity might have been gone. Hence, a proper approach
is to keep the initial AssistStructure data in the system_service
memory, watch for view changes, and then passed the new structure
back to the AutoFillService.

A side effect of this change is that we need another way to determine
if the view is sanitized or not. For "standard" views, that will be
defined based on whether the view content come from a resource or not,
but that logic is not implemented yet (for now, all views will be
considered sanitized, except for TextView passwords). For "custom"
views (such as WebView), this logic is responsibility of the view
implementation, through the newChild() method, which now takes a
flag (whose value could be AUTO_FILL_FLAG_SANITIZED for sanitized
views).

The SaveCallback.onSuccess() method was simplified: it does
not need a list of saved ids anymore the auto-fill UI will not use it
anymore.

Another side effect is that the Save notification is gone - until
it's attached again, it can be test by using:

    adb shell cmd autofill save

Finally, hook AutoFillUI on ACTION_CLOSE_SYSTEM_DIALOGS events.

BUG: 33269702
BUG: 31001899
Test: manual verification
Test: CtsAutoFillServiceTestCases passes
Change-Id: I907a7e21d1b3cd1ab6dec3a08d144a52655da46f
2017-02-01 11:00:15 -08:00
Phil Weaver
7da087d87d Merge "Accessibility can capture fingerprint gestures" 2017-02-01 02:01:44 +00:00
Adam Powell
24e78d7228 Fix a bug in View#hasFocusable with new auto-focusable behavior
Check resolved focusability for hasFocusable and not just the
configured value.

Bug: 34855238
Test: CTS
Change-Id: I57af9e6c3a0ccd07058bcd0b2256a14878b8707c
2017-01-31 16:48:08 -08:00
TreeHugger Robot
5594ab958a Merge "Propagate surface type and owner through to SurfaceFlinger." 2017-01-31 23:22:12 +00:00
Phil Weaver
27fcd9c97a Accessibility can capture fingerprint gestures
Bug: 27148522
Test: Unit tests for two new classes in this CL, CTS in
linked CL.
Change-Id: Icb5113e00b1f8724814263b3cc7f72fe4a6f0b41
2017-01-31 14:27:09 -08:00
TreeHugger Robot
7b552516ae Merge "Implicitly cast views obtained via View.findView methods" 2017-01-31 22:04:25 +00:00
Evan Rosky
3b94bf5c3e Default focus order now tries to adhere to view hierarchy
Specifically, tab focus should travel completely through all
views within a given viewgroup before traveling to a sibling
viewgroup. At each hierarchy level, viewgroups are sorted
according to the existing rectangle-based algorithm.

This is only the first of a couple focus-order tweaks to
adhere to the new keyboard navigation ux spec.

Bug: 33848452
Bug: 34084573
Test: Checked in a sample-app that focus order adheres much
      more closely to our keyboard navigation spec. Also
      verified that existing FocusFinder CTS tests still pass.
Change-Id: Ia0e59a2e0dd8b9773796e0aaebfca0deb3c14a3c
2017-01-31 12:15:31 -08:00
Chris Craik
b27aba9a92 Merge "Replace invalidateChild/invalidateChildInParent" 2017-01-31 18:23:22 +00:00
TreeHugger Robot
6675bbf093 Merge "Binary compatibility stubs for get/setTooltip()" 2017-01-30 19:07:59 +00:00
Alan Viverette
775b9dc89f Binary compatibility stubs for get/setTooltip()
Change-Id: I8784ccfd48d8c809b70d7c5c977bcbf44e3f4d47
Fixes: 34798233
Test: n/a
2017-01-30 10:02:11 -05:00
Chet Haase
b64e777f6c Add methods to query animation state
Testing utilities want the ability to know whether things in the UI
are in flux and they need to wait before testing on-screen values.
These changes (a subset of what's needed, but will have to do for
a start) allow querying of ActivityTransitions and ProgressBar, two
common/difficult pieces in the puzzle.

Test: CTS tests at ag/1835467
Bug: 30978257 Provide view transition Api to prevent flaky tests

Change-Id: If63b3d0dde2178d826ac1dbfad0fc50e5ed9a780
2017-01-30 12:57:43 +00:00
Yohei Yukawa
06b4be771c Minor code clean-ups with no behavior change
As another preparation CL to work on Bug 7254002, this CL cleans up
miscellaneous minor coding style issues that do not cause any
user-visible problems.

 - Add final keyboard to classes that are not intended to be extended.
 - Add static keyboard to nested classes if possible.
 - Fix a typo in log message.
 - Remove a redundant synchronized keyword in method signature.
 - Remove unused class fields.

Test: checkbuild
Bug: 7254002
Change-Id: I3b54179116a74cafc99a3dfd3f2a429a7111c12e
2017-01-29 14:08:17 -08:00
Andrii Kulian
5f5aaa8142 Merge "Rename flag that enables showing display content with keyguard" 2017-01-28 04:08:35 +00:00
TreeHugger Robot
b46df69a77 Merge "Move autofill focus triggers from TextView to View." 2017-01-28 01:54:48 +00:00
Andrii Kulian
7211d2eba8 Rename flag that enables showing display content with keyguard
Renamed SHOW_WITH_INSECURE_LOCKSCREEN to CAN_SHOW_WITH_INSECURE_KEYGUARD.

Test: android.server.cts.ActivityManagerDisplayTests
Change-Id: Ie03ee59730a9e9e715b2bad0a14fdd107b8c7c00
2017-01-27 17:27:11 -08:00
Jason Long
2b004b3aba Move autofill focus triggers from TextView to View.
Bug: 31001899
Change-Id: I6fd01b86936b3140edf87ac63292c77015bb019d
Test: Manual
2017-01-27 13:47:37 -08:00
Adam Powell
995c043acf Fix ListView click handling under new focus rules
ListView historically uses View#hasFocusable to change signifcant
behavior around the clickability of items: an item view with any
focusable children could not be clicked via an item click
listener. Many apps therefore have sub-views in list items that are
deliberately clickable, but not focusable. This comes up in cases like
overflow menu buttons on list items.

Now that we have auto-focusability triggered when a view is set as
clickable, the expectations of apps using this pattern have changed.

Create an overload of hasFocusable that optionally can filter out
auto-focusable views in its results. Have ListView use it to preserve
its previous behavior. This isn't public API for now, but perhaps it
should be if this pattern shows up in practice in places other than
ListView.

Bug: 34756767
Change-Id: Ie71ee6e388449f634b30f9162a8b3fa578e32db8
2017-01-27 13:31:44 -08:00
Albert Chaulk
3bf2e57f8d Propagate surface type and owner through to SurfaceFlinger.
This allows VrWindowManager to identify things like permission
dialogues in the list of SurfaceFlinger layers that show up while a
VR application is running and display them without leaving VR mode.

Bug: 30984984
Test: Run VR application, request permission at runtime, observe and
  accept permission in VrWindowManager without leaving VR mode.

Change-Id: I347313b5fcd08dea3cd6fddfaeb15640938e3a87
2017-01-27 15:14:48 -05:00
Chris Craik
9de95db4f2 Replace invalidateChild/invalidateChildInParent
Fixes: 34361503
Test: CTS: android.view.cts.ViewGroupTest
      APCT: android.view.ViewInvalidateTest

Simplify and unify HW accelerated invalidate/damage codepaths, since
both simply walk up to ViewRootImpl and schedule a traversal.

Adds a new overridable method 'onDescendantInvalidated' for observing
subtree rendering updates.

Change-Id: I7ef1f914c3411317692451787b3810b23e019591
2017-01-27 11:36:27 -08:00
Alan Viverette
06c2fffdaa Implicitly cast views obtained via View.findView methods
Removes all explicit casts from android.widget classes. Also @removes
methods on ListView that were overriding @hidden methods and should
never have been exposed as public API.

Bug: 24137209
Test: make
Change-Id: I6ccfc6f001b355c4880f2b54e1a5474df78d6228
2017-01-27 13:13:45 -05:00
Andrii Kulian
fc8f82bc6b Allow showing content on virtual displays when locked
This adds new flag to virtual display that changes its
behavior when keyguard is shown, but can be dismissed without
entering credentials. This can be applied only to private
virtual displays.

Bug: 34280365
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testVirtualDisplayHidesContentWhenLocked
Test: #testShowWhenLockedVirtualDisplay
Test: #testShowWhenLockedPublicVirtualDisplay
Change-Id: I9c19d36295e62f59bd1db1352af707d54ea51667
2017-01-27 00:14:06 -08:00
TreeHugger Robot
e852d6731b Merge "Fix issues with launching activities on virtual displays" 2017-01-27 05:44:37 +00:00
TreeHugger Robot
e682445698 Merge changes from topic 'session_refactoring'
* changes:
  Adds autofill save ui
  Moar AutoFill Framework refactoring...
2017-01-27 03:46:36 +00:00
Andrii Kulian
4acfd858a4 Fix issues with launching activities on virtual displays
- Virtual displays might have hdr capabilities not initialized,
  which lead to exception when checking.
- Dynamic stacks were mistakenly considered an invalid launch stack.

Test: android.server.cts.ActivityManagerDisplayTests
Change-Id: I20356d6e25cf9e5fa4a3d7bd3699a8e82a73f21a
2017-01-26 19:43:13 -08:00
TreeHugger Robot
903f98e37f Merge "Expose Java side for parenting SurfaceControl" 2017-01-27 02:43:52 +00:00