Commit Graph

11116 Commits

Author SHA1 Message Date
Jan Althaus
b6bba33399 Merge "Minor TextClassifier fixes" into pi-dev 2018-04-11 12:19:43 +00:00
Jan Althaus
13a89c9403 Minor TextClassifier fixes
- Fix incorrect nullable annotation (usage/APIs already correct)
- Fix outdated doc reference
- Fixed visibility of TextClassification fields

Bug: 74461129
Test: N/A
Change-Id: I107cc978c9385ac2ad706fa8e0a8a3ecb215cf36
2018-04-11 13:03:43 +02:00
TreeHugger Robot
7a65c44d03 Merge "Notify a11y when view attached to parent" into pi-dev 2018-04-11 01:49:57 +00:00
Eugene Susla
fd34bcc397 Merge "[DO NOT MERGE] Avoid sending content changed a11y events from wrong views" into pi-dev 2018-04-10 20:18:09 +00:00
Jan Althaus
706edbd776 Merge "Fixing broken logging of OTHER events" into pi-dev 2018-04-09 13:09:55 +00:00
TreeHugger Robot
ef5bb6fd70 Merge "Add haptic constants" into pi-dev 2018-04-09 11:26:20 +00:00
TreeHugger Robot
1f2c6dea41 Merge "Fix crash when modifying Selection" into pi-dev 2018-04-09 09:26:42 +00:00
Jan Althaus
4f9d750e91 Merge "Remove legacy logger" into pi-dev 2018-04-07 12:06:12 +00:00
Jan Althaus
5a03094ebc Remove legacy logger
Migrate DefaultLogger implementation to SelectionSessionLogger.
This cleans up after the API refactor and fixes two bugs:
- All events are currently logged twice.
- Interfaces accept a null signature, but it currently crashes the legacy logger.

Bug: 73392698
Bug: 77659305
Test: atest FrameworksCoreTests:TextClassificationManagerTest
Test: atest FrameworksCoreTests:TextClassificationTest
Test: atest CtsViewTestCases:TextClassificationManagerTest
Test: atest CtsViewTestCases:TextClassifierValueObjectsTest
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest CtsWidgetTestCases:EditTextTest
Test: Manually examined logs
Change-Id: I0d2b925abf5cab12d71fc2cc0fa527530c86ab10
2018-04-07 12:04:49 +00:00
Jan Althaus
35b3057627 Fixing broken logging of OTHER events
This bug means we never received logs for events like 'Web Search'

Bug: 77659305
Test: atest FrameworksCoreTests:SelectionEventTest
Change-Id: I6f79897f548d0d19710578e309e0b645bb78e1e3
2018-04-07 09:43:41 +02:00
TreeHugger Robot
298fabe6b5 Merge "Autofill should clear the UI filter when a value is updated to null." into pi-dev 2018-04-07 03:59:34 +00:00
Felipe Leme
156a7ebf17 Autofill should clear the UI filter when a value is updated to null.
Test: VirtualContainerActivityCompatModeTest:testDatasetFiltering
Fixes: 77652152

Change-Id: Ifc7b8f759684fe35d1aa9218dd39b8dcf7ac4e4f
2018-04-06 18:05:24 -07:00
Jorim Jaggi
4c1453ac45 Merge "Early wake-up for transitions (2/2)" into pi-dev 2018-04-06 21:44:28 +00:00
Eugene Susla
9af1378c82 [DO NOT MERGE] Avoid sending content changed a11y events from wrong views
The root cause of both attached bugs was the tree-merging algorithm in
ViewRootImpl.SendWindowContentChangedAccessibilityEvent converging on a
common predecessor that is marked not View#isImportantForAccessibility.

As a result, such unlucky content changed events were discarded.

Fixes: 72378611, 72950579
Test: ensure attached bugs are fixed
Change-Id: I3c3c66151b6cd4773de4eadd417709e9a61a7cf2
(cherry picked from commit 3fb3c59040)
2018-04-06 20:44:50 +00:00
Nader Jawad
236a183e8b Removed call to setWillNotCacheDrawing and deprecated it as well as
willNotCacheDrawing as intermediate caching layers are obsolete since
hardware accelerated rendering was introduced in API 11

ImageView's current implementation of setScaleType would manually
disable it's cache if the ScaleType provided was CENTER. This was end up
not drawing the ImageView if View.LAYER_TYPE_SOFTWARE was configured on
the ImageView as the cache no longer existed. Removed the logic to
conditionally disable the drawing cache and marked
setWillNotCacheDrawing/willNotCacheDrawing as hardware accelerated
rendering makes these facilities obsolete

Fixes: 77653694
Fixes: 72139649
Test: Created a test application with an ImageView and manually set a
ScaleType of CENTER and forced the ImageView to render in a software
layer to confirm that it would render properly with a drawable of the
test application's launcher icon

Change-Id: Ie73b1e0708a265e3cc2cc74ed13539f4219dbd7d
(cherry picked from commit 2ac86880d6)
2018-04-06 17:09:40 +00:00
Clara Bayarri
4e51877f5c Fix crash when modifying Selection
The root of this bug was in the fact that Selection.removeSelection
removes two spans, the start index and end index of the selection.
Each span removal triggers Editor#onSpanRemoved, which in turn tries
to set a selection. This meant that if we started with selection
(100, 120), then removeSpan(start) was called, so we had (-1, 120),
then the onSpanRemoved code tried to set a selection so set it to
(120, 120), then removeSpan(end) was called, ending up in (120, -1).

There are two stages to this fix
1. A lot of our code assumes that when either start or end selection
are larger than -1, both are valid. Therefore when we have one of them
out of sync, we crash. Fixed this assumption in all the places I found

2. We didn't have a mechanism to use FLAG_INTERMEDIATE when removing
spans, only when adding them, so this CL adds a remove with flags. This
allows us to not trigger onSpanRemoved when only one of the selection
indexes is removed.
Because this is an added method to an interface, the default just
calls the existing method. The new method is implemented in
SpannableStringInternal and SpannableStringBuilder to read
FLAG_INTERMEDIATE and avoid sending a spans changed event.
Selection.removeSelection then uses FLAG_INTERMEDIATE when removing
the first of the two selection spans.

Note that 2. would be enough to fix the current bug, but we want to
avoid other implementations of Spannable from crashing in the wild.
In general, it seems like a good idea to verify both selection indexes
are valid whenever they are used.

Bug: 72101848
Test: atest FrameworksCoreTests:SpannableStringBuilderTest
Test: atest FrameworksCoreTests:SpannableStringTest
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest CtsWidgetTestCases:EditTextTest
Test: atest android.text.cts.SelectionTest (note new test as well)
Test: atest android.view.inputmethod.cts.BaseInputConnectionTest
Test: atest android.text.DynamicLayoutTest
Change-Id: I0d647fad152d0bef0f2115a46c3d17ebd8642281
2018-04-06 16:51:53 +01:00
Alexey Kuzmin
1ea7edd77e Add haptic constants
New hidden constants added to HapticFeedbackConstants.
Test: m update-api shows no changes
Bug: 74882420

Merged-in: I164a944b23e958e89b8d3064cb512cee739b27fd
Change-Id: I164a944b23e958e89b8d3064cb512cee739b27fd
2018-04-06 14:55:52 +00:00
Jorim Jaggi
767e25ed61 Add ability to change context priority of RT GL context
Test: Use method, observe GPU preemption behavior
Bug: 75985430
Change-Id: Idc08d37f8c95f52c5aab7edf09c0cbff72b8482d
2018-04-06 12:12:07 +00:00
Jorim Jaggi
aa763cd35f Early wake-up for transitions (2/2)
On some devices it's very likely that we fall into GL comp during
app transitions. However, SF offsets are chosen in a way such that
the time to finish a frame is just too tight to be completely jank
free when hitting GL composition in SurfaceFlinger. Thus, we
introduce the concept of a separate early offset, and wakeup
SurfaceFlinger at that time if we think that hitting GL comp is
likely, or we already hit GL comp in the last frame.

Test: Open app, check vsync offsets in systrace
Test: Open many dialogs/apps to fall into GPU comp.
Bug: 75985430
Change-Id: I461fdcd573583f3ea0348c8b23cc9945d33f8976
2018-04-06 13:36:14 +02:00
Rob Carr
d1366f604a Merge "Forward Activity stop signal to attached windows." into pi-dev 2018-04-05 19:03:29 +00:00
Richard Ledley
5f77b6a35a Add null check for Nullable argument.
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest FrameworksCoreTests:android.view.textclassifier.TextLinksTest

Bug: 77624093
Change-Id: I527c4e7f6758c699d4d4e7258cf8474f833040c7
2018-04-05 17:30:24 +01:00
Richard Ledley
7b7e87eeb5 Merge "Use Collection instead of List for entity list" into pi-dev 2018-04-05 05:46:53 +00:00
TreeHugger Robot
2b26f83f12 Merge "autofill: fix window location in splitwindow and dialog" into pi-dev 2018-04-04 22:06:49 +00:00
Dake Gu
640e9b9bf4 autofill: fix window location in splitwindow and dialog
autofill should use relative location to app window as PopupWindow
is based on relative location.

The fixed reverted changes made in compatibility mode CL that made
autofill window TYPE_SYSTEM_DIALOG.

Changing PopupWindow to use absolute screen location is another fix
choice, but it does not allow autofill window to be automatically
moved when app window changes location (e.g. adjust split window
separator or bring up IME)

The autofill window switches to TYPE_APPLICATION_ABOVE_SUB_PANEL with
IME disabled. So it still appears above IME and most other app
windows, unless app window is TYPE_APPLICATION_ABOVE_SUB_PANEL too.

Fixes: 73555917
Bug: 77587135
Test: manually tested compability mode with chrome amazon login
      manually tested splitted window
      atest CtsAutoFillServiceTestCases

Change-Id: I6b8ecf3fe7a91cebea1f7a868f4b15fbed8b0051
2018-04-04 11:36:40 -07:00
Richard Ledley
ab669a01a7 Use Collection instead of List for entity list
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest FrameworksCoreTests:android.view.textclassifier.TextLinksTest

Bug: 76448224

Change-Id: I354fa05f14b22075c2172624925f5b953956f3a4
2018-04-04 17:42:07 +01:00
Abodunrinwa Toki
ae82e7ad28 Fix TCS crash due to API changes.
- Brings by old deleted APIs and hides them
- Except parceling and hidden APIs that won't have been called anyway
- Option holds a reference to the Request object so we don't have to
  rebuild it

Bug: 77523413
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextSelectionTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextLinksTest
Change-Id: I4277c48a950c3334439649373885ed7fe54f898e
2018-04-04 14:10:51 +02:00
TreeHugger Robot
3ec4b8ccfd Merge "Use client-side version of inTouchMode" into pi-dev 2018-04-03 23:25:34 +00:00
Robert Carr
3f7bd97df9 Forward Activity stop signal to attached windows.
Simply put there is nothing ensuring PopupWindow's stop using
the Surface before the app is stopped. Since PopupWindow's are
detached from the main View Hierarchy teardown of the main window
provides no such guarantee. It seems enough to forward the "WindowStopped"
signal from ViewRoot to other ViewRoot's using the token of that ViewRoot.

Bug: 62536731
Test: Manual
Change-Id: Ib431f49be7e06a6397a40c11ec7e842a8bc5caf9
2018-04-03 15:53:01 -07:00
TreeHugger Robot
5fa07c0986 Merge changes from topic "fw_quickstep_update" into pi-dev
* changes:
  Reparent recents animation task leash to app animation layer
  Allow recents animation to override divider minimized state
  Prevent unnecessary reordering of the home stack
2018-04-03 22:31:57 +00:00
Evan Rosky
2888404df8 Use client-side version of inTouchMode
Was bindering into WM service pretty often due to this which was
causing some jank

Bug: 72236832
Test: Related touchmode/focus CTS tests still pass
Change-Id: Ia0f89429b67464beea07c702d8fe2d8b813f8d38
2018-04-03 13:21:55 -07:00
Phil Weaver
1317162eb4 Notify a11y when view attached to parent
Bug: 73493821
Test: Verifying that vibration settings UI works
properly.

Change-Id: Id3c9e87fdd0ad5c49d8bd6e86b2c15977c9b09ca
2018-04-03 11:40:44 -07:00
TreeHugger Robot
ffe1c2a266 Merge "Restore saveLayer APIs back into the public API." into pi-dev 2018-04-02 14:28:48 +00:00
TreeHugger Robot
bf9dfb16be Merge "TextClassifier API updates." into pi-dev 2018-04-02 09:08:52 +00:00
Abodunrinwa Toki
080c8542b6 TextClassifier API updates.
1. Wraps TC queries in Request objects
2. Adds create/destroyTextClassificationSession system APIs
3. Adds the session Ids to system API calls
4. Change setSignature() to setId() on result objects
5. Plumbing to make the API updates work as things currently work
6. Hide Linkify.addLinksAsync APIs

Bug: 74461129

Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextSelectionTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextLinksTest

Change-Id: I933ada8b37ef9893331a265e3b4fc08e043f1029
2018-04-01 20:04:47 +01:00
TreeHugger Robot
e1059d9f5e Merge "Renamed KeyFallbackEvent to UnhandledKeyEvent and exposed dispatch" into pi-dev 2018-03-31 17:39:18 +00:00
Evan Rosky
4d0a5fd7e7 Merge "Restored focusableViewAvailable logic on visibility change" into pi-dev 2018-03-30 21:23:32 +00:00
Evan Rosky
4807ae257b Renamed KeyFallbackEvent to UnhandledKeyEvent and exposed dispatch
This new naming clashes less with the existing notion of FLAG_FALLBACK
in KeyEvents.

Bug: 72562800
Test: ViewTest#testUnhandledKeys
Change-Id: Ibd713860601e62d955443fe6811fd974b5bb0092
2018-03-30 19:52:58 +00:00
Derek Sollenberger
2d4f01ba7f Restore saveLayer APIs back into the public API.
The saveLayer APIs are restored from @removed but will treat input
as ALL_SAVE_FLAGS and generate exceptions on newer API levels.

We internally used these calls in one situation that now use a
different @hide API to support the previous behavior until we
refactor that code.

Partial revert of "Remove deprecated android.graphics.Canvas APIs"
This reverts commit 7b837616ae.

Bug: 77276963
Bug: 73777445
Test: CtsGraphicsTestCases
Change-Id: I7acd4ffd5ac41a58d2be8b48cf50119c2b896708
2018-03-30 14:40:04 -04:00
Winson Chung
f557c3b565 Allow recents animation to override divider minimized state
- When swiping up while in split-screen, the animation should be able to
  adjust the docked divider minimized state so that we don't wait until
  launcher is repositioned to the front in order for the divider to
  update.

Bug: 73118672
Test: Enter split screen, swipe up and ensure the dock divider moves
      (Note, there are still unrelated clipping issues)

Change-Id: Id71f91eaf2f06b3c33628a2199cc94c82e235471
2018-03-30 10:25:16 -07:00
Jan Althaus
a1652cfcce Switch reference time to ZonedDateTime
Bug: 74838195
Test: atest FrameworksCoreTests:TextClassificationManagerTest
Test: atest FrameworksCoreTests:TextClassificationTest
Test: atest CtsViewTestCases:TextClassificationManagerTest
Test: atest CtsViewTestCases:TextClassifierValueObjectsTest
Change-Id: I0df9dddf415fa558435553336a8a0a15621e9b05
2018-03-29 18:41:32 +02:00
Abodunrinwa Toki
119d10deb9 Merge "Implement Stateful TextClassifier APIs." into pi-dev 2018-03-28 20:58:47 +00:00
Jorim Jaggi
13c4b14e92 Merge "Add different animation for transitions with translucent apps" into pi-dev 2018-03-28 19:09:08 +00:00
Jan Althaus
08a75e0ee7 Merge "Change TextClassification to use RemoteActions" into pi-dev 2018-03-28 17:04:58 +00:00
TreeHugger Robot
59ecb96da9 Merge "Improve the JavaDoc for SOFT_INPUT_STATE_UNSPECIFIED" into pi-dev 2018-03-28 16:29:56 +00:00
Adrian Roos
95712fe0cb Merge "DisplayCutout: Add clarifying images to LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES" into pi-dev 2018-03-28 14:56:19 +00:00
Jorim Jaggi
98a9d206be Add different animation for transitions with translucent apps
None of the existing animation really work with transitions in
which a translucent app is appearing/disappearing. Add a separate
animation for that and change all existing transitions to these
new transition types in case we detect that only translucent
activities are appearing/disappearing.

Test: Sharesheet animations
Test: go/wm-smoke
Change-Id: Iffe57b7664dddf647d723c91d115ade60c12ad33
Fixes: 37953606
Fixes: 70730519
Fixes: 72649981
Fixes: 72686618
2018-03-28 16:46:41 +02:00
Adrian Roos
813a4bee76 Merge "DisplayCutout: Fix attrs.xml javadoc" into pi-dev 2018-03-28 14:29:08 +00:00
Adrian Roos
ad1da31764 DisplayCutout: Add clarifying images to LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
Fixes: 76462084
Test: make doc-comment-check-docs, open $ANDROID_BUILD_TOP/out/target/common/docs/doc-comment-check/reference/android/view/WindowManager.LayoutParams.html, navigate to LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
Change-Id: I8a9df979cbb062896fa874a163414a4f8a095b21
2018-03-28 15:00:45 +02:00
Jan Althaus
20d346eafe Change TextClassification to use RemoteActions
Behavioural changes:
- Every action now as an icon, and instead hints via RemoteAction whether
  the icon should be shown or not.
- Icons are now taken from the app default, not the activity.
  (That way, we can construct a lightweight resource backed Icon)
- Legacy intents are no longer parceled for security reasons.
  (TextClassificatio wasn't parcelable in O)
- TextClassifications built with the new API will always return null for
  getIntent, but provide a getOnClickListener.
- Accessibility descriptions are now provided for action mode items.

Testing changes:
- Removed URI checks from TCM test because PendingIntent hides this info.

Bug: 73950205
Test: atest FrameworksCoreTests:TextClassificationManagerTest
Test: atest FrameworksCoreTests:TextClassificationTest
Test: atest CtsViewTestCases:TextClassificationManagerTest
Test: atest CtsViewTestCases:TextClassifierValueObjectsTest
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest CtsWidgetTestCases:EditTextTest
Change-Id: I6706d2c342a8bbb9de0146a48c8b8aac9d9c7d83
2018-03-28 11:41:39 +02:00
Abodunrinwa Toki
88be5a6cee Implement Stateful TextClassifier APIs.
Outstanding work tbd in other CLs
- Introduce request objects with session Ids
- Implement character based indexing for Selection events.

This CL hides the old Logger API but still keeps running so that we can
check that the modifications to the new API does not break anything.
We will remove the old Logger once we're convinced this is stable.

Please refer to I3c9ceea0863099fc4f0a5ce5e823c648ee9c4521 for previous
reviews related to this CL.

Bug: 74461129
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Change-Id: Iea744f1fa5964b4399290c31863ebeffa99af8d3
2018-03-28 02:54:36 +01:00