Commit Graph

9291 Commits

Author SHA1 Message Date
Peeyush Agarwal
651ea36f5a Merge "Extend MenuItem to allow modifier keys for shortcut" 2017-02-09 11:17:25 +00:00
Evan Rosky
f10db8e444 Merge "Separate cluster-focus and default-focus." 2017-02-08 22:27:53 +00:00
TreeHugger Robot
697221e84d Merge changes Ia7670aa6,I602b421b
* changes:
  Get rid of VirtualViewDelegate.
  Set autofill id on virtual structures.
2017-02-08 16:55:01 +00:00
Adam Powell
2ec94fde4f Merge "Provide old behavior for View#hasFocusable to old apps" 2017-02-08 16:21:06 +00:00
Paul Duffin
24843fdf3b Merge "Replace com.android.internal.util.Predicate with java.util.function.Predicate" 2017-02-08 14:49:34 +00:00
Abodunrinwa Toki
5a6a99d2f5 Merge "TextClassificationManager: Avoid exposing lock." 2017-02-08 12:19:27 +00:00
Paul Duffin
ca4964ccbe Replace com.android.internal.util.Predicate with java.util.function.Predicate
Bug: 35089332
Bug: 30188076
Test: make checkbuild
Change-Id: I0a5b4bf520fc39b59d8d790b01e9cff0d54e6d21
2017-02-08 11:55:39 +00:00
TreeHugger Robot
61294f4c8b Merge "Removed value from AutoFillManager.virtualFocusChanged()." 2017-02-08 09:37:22 +00:00
Felipe Leme
0221887e6a Get rid of VirtualViewDelegate.
VirtualViewDelegate was used by views providing virtual children to:
- auto-fill the chidren
- notify system about children changes

Since the notification logic moved to the AutoFillManager class, it's
kind of an overkill to provide a delegate just for autoFill(); instead,
it's simpler to add a new autoFillVirtual(virtualId, value) method on
View.

BUG: 31001899

Test: manual verification
Test: CtsAutoFillServiceTestCases passes

Change-Id: Ia7670aa665918496a009017a11c3de72c4ed3fa2
2017-02-07 20:05:51 -08:00
Felipe Leme
7f60d35d94 Removed value from AutoFillManager.virtualFocusChanged().
BUG: 31001899

Test: manual verification
Test: CtsAutoFillServiceTestCases passes

Change-Id: I71c9f9b4b02b210121a1d15860c3c7172d26a62d
2017-02-07 17:23:56 -08:00
Felipe Leme
1bdf3f070b Set autofill id on virtual structures.
ViewStructure.newChild(virtualId) uses the AutoFillId of the parent,
which was not set anymore due do a previous refactoring, and was
causing this method to crash a custom view when
onProvideAutoFillVirtualStructure() was called on it.

Test: manual verification
Bug: 31001899

Change-Id: I602b421b0ec3a926ffdd52253d5b2498c4217d02
2017-02-07 13:50:53 -08:00
Winson Chung
cd161864a3 Merge changes I3ef361bd,I89a5184c
* changes:
  Refactor PiP logic in preparation for expanded state.
  Modifying RemoteAction callback to PendingIntent.
2017-02-07 21:18:15 +00:00
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
Adam Powell
0f552f4d50 Provide old behavior for View#hasFocusable to old apps
Existing apps have copies of ListView behavior that expects the old
hasFocusable behavior of only reporting explicitly focusable views.
Use targetSdkVersion to give the old behavior to existing apps.
Add hasExplicitFocusable method to View to offer the old behavior
to apps that need it. ViewCompat method required in support library
to shim through to hasFocusable pre-O.

Bug: 34946284
Test: CTS
Change-Id: I65503fa2c5fe4cb8b635efa464e653bbf5e7f821
2017-02-07 10:44:37 -08:00
Felipe Leme
fb0f360222 Merge "Refined session management so Save can be automatically called." 2017-02-07 17:50:29 +00:00
Peeyush Agarwal
e631e32a1a Extend MenuItem to allow modifier keys for shortcut
Before this, CTRL was the default modifier for MenuItem shortcuts.
Now, It's possible to specify the modifier in XML or via MenuItem
methods.
The modifier list includes META, CTRL, ALT, SHIFT, SYM and FUNCTION.

WIP on support library implementation

Bug: 32165848
Test: Run the tests using following commands:
> cts-tradefed run cts-dev -m CtsViewTestCases -t
>   android.view.cts.MenuTest#testPerformShortcut
> cts-tradefed run cts-dev -m CtsViewTestCases -t
>   android.view.cts.MenuInflaterTest#testInflateShortcutModifiersFromXml

Change-Id: I7db4607d4657451934761914efe4c250de109653
2017-02-07 17:01:26 +00:00
Winson Chung
2a82fe587b Refactor PiP logic in preparation for expanded state.
- #1: Move logic for handling IME size changes into SysUI, and only rely
      on PinnedStackController to provide bounds when first entering
      PiP and on rotation
- #2: Doing #1 allows us to move PipMotionHelper to SysUI completely, which
      lets us aggregate the animation calls out of PipTouchHandler
- #3: Add proper callbacks to the listeners when the movement bounds
      changed from config change, ime change, or aspect ratio change. This
      allows SysUI to calculate the associated movement bounds for the
      expanded state, and we can then remove the corresponding WM call.
      It also means that SysUI is the only thing that needs to know about
      the expanded state.
- #4: Fix issue where TV was getting the default bounds, not taking the
      aspect ratio when the PiP was entered into account.  Doing #3
      allows us to report the right bounds.
- #5: Remove dead code related to edge snapping/minimizing now that they
      are on by default and associated tuner setting, and controller
      callbacks

Test: android.server.cts.ActivityManagerPinnedStackTests (all existing tests pass)

Change-Id: I3ef361bdf8d44094b4c0a11c70ba4db7d697fdec
Signed-off-by: Winson Chung <winsonc@google.com>
2017-02-07 08:26:36 -08: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
Evan Rosky
53fcf11cf5 Separate cluster-focus and default-focus.
Now properly cleans-up cluster-focus and default-focus chains
on view-removal (was only cleaning 1 level previously).
Separated cluster-focus and default-focus concepts.
Made default-focus robust to changes in default-focusable
views (previously un-marking a default focus wouldn't reassign
default focus to still-existing default focusables).
Cluster-focus falls back on default-focus when no saved
cluster-focus exists.

Bug: 34394367
Test: Associated CTS tests.
Change-Id: I903c22ded5643d0d4ca3bc5427b38833742aa354
2017-02-06 10:33:04 -08: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