Commit Graph

11211 Commits

Author SHA1 Message Date
Mathew Inwood
e5ad598d11 Add @UnsupportedAppUsage annotations
For packages:
  android.view.textservice
  android.view.textclassifier.logging
  android.view.textclassifier
  android.view.inputmethod
  android.view.autofill
  android.view.accessibility
  android.view

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Ie4663ebd4640b2893e575e599582d2c9530da313
Merged-In: I4147b038ed7adf0311ee9918b44766f82a057eaf
2018-08-20 14:52:19 +01:00
Mathew Inwood
5346961615 resolve merge conflicts of 6987a91e7c to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Merged-In: I773bda19dc7b32c01bf064bf78b517896e8df991
Change-Id: I2c9bd92522932175856fb72ca5cce2c1999f4a1e
2018-08-03 09:00:19 +01:00
Mathew Inwood
8452828b5b Add @UnsupportedAppUsage annotations
For packages:
  android.view.animation

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I52f3e770dd1e8240e67c897e7788bd928145f583
Merged-In: I773bda19dc7b32c01bf064bf78b517896e8df991
2018-07-27 16:06:00 +01:00
youngmin0822.lee
e332fe4b3d Merge "don't call setSize() when creating SurfaceControl"
am: 57e98b19be

Change-Id: Iec44550e5c18fa7d3005c8c79e607fc1bc656c13
2018-07-24 22:01:41 -07:00
youngmin0822.lee
4dde7d19cb don't call setSize() when creating SurfaceControl
When SurfaceControl is created with creating variable
in updateSurface(), sizeChanged is also set.
So, setSize() is called, and it blocks UI thread
until the transaction is handled in SF.
There is no need to resize in the creation time,
because size is already set when creating SurfaceControl.

Test: systrace any app including SurfaceView

Change-Id: I65028b4d0d0ba2b75fbe089c98a11a56b6c08104
2018-07-09 15:27:43 +09:00
TreeHugger Robot
e4e9ee7951 Merge "Move nulling of nextFrameCallback" into pi-dev 2018-06-07 22:14:51 +00:00
Jorim Jaggi
e6a026bdfe Move nulling of nextFrameCallback
If draw() invokes postDraw that sets the next callback, the
callback will never be invoked.

Test: Long-swipe-up from navigation bar
Change-Id: If2e4dfff8a845b73fa77426305d5ece1921857e5
Fixes: 109701914
2018-06-07 17:49:01 +02:00
Laura Davis
890662c3c4 docs: Changed language to be gender-neutral.
Test: make ds-docs

Bug: 75324366
Change-Id: Ia2dbcbe4bec303791cbbb004bab6a0b585c5dfb6
2018-06-05 16:02:42 -07:00
Jorim Jaggi
9c52ebbf96 Crashing can not override Keyguard transit
If an app crashes during Keyguard transition, make sure to keep
Keyguard transition

Test: AppTransitionTests
Test: go/wm-smoke
Change-Id: I80b80952f93d2b5611754f05a3dc333905cd1c86
Fixes: 80132133
2018-06-01 16:32:44 +02:00
John Reck
5b02c629bd Attempting to fix the black flicker
Bug: 79231206
Test: Repro steps from bug

Merged-In: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6
Change-Id: I4c2810c42a7a4358f64584da3ab0cdf1499e71b6
2018-05-31 12:56:28 -07:00
Evan Rosky
7ba4c2b254 Merge "Fixed a bug where sometimes unhandled handler would consume all keys" into pi-dev 2018-05-30 21:47:25 +00:00
Adrian Roos
8997b7e4c9 Merge "WindowInsets: Never dispatch negative insets" into pi-dev 2018-05-28 14:40:20 +00:00
Evan Rosky
cd80e611ca Fixed a bug where sometimes unhandled handler would consume all keys
In a situation where a focused view consumed only the UP of a key
and the unhandled key manager would focus a listener, it wouldn't
drop focus unless the original key was pressed/released again.

This updates the record of captured keys before it can be consumed
in the view hierarchy.

Bug: 79993136
Test: Added a test for this to cts ViewTest#testUnhandledKeys
Change-Id: I5dfdcf16c5c41e9ad51cb62b385580c5493e8520
2018-05-25 16:18:57 -07:00
Adrian Roos
7419a17d92 WindowInsets: Never dispatch negative insets
Bug: 80204753
Test: atest ViewRootImplTest
Change-Id: Idace95ae57c6a3a1667b95ce8c3ac7d2bfe06f94
2018-05-25 14:54:09 +02:00
Felipe Leme
ce3ae87da9 New Autofill field: FIELD_AUTOFILL_SESSION_ID
This field contains the autofill session id (Thank You, Captain Obvious!), which
is useful to correlate autofill metrics that are not logged on
AUTOFILL_REQUEST.

Test: atest CtsAutoFillServiceTestCases # to make sure it didn't break anything
Test: manually run some test and watched
      'adb shell logcat -b events | grep sysui'. Example:
     [757,913,758,4,806,android.autofillservice.cts,871,android.autofillservice.cts.LoginActivity,914,2,915,2,1456,-2045861404

Fixes: 80093094

Merged-In: If4b1c9ab616b2ba580745096894997eb7edb3e34
Change-Id: If4b1c9ab616b2ba580745096894997eb7edb3e34
2018-05-25 06:22:25 +00:00
TreeHugger Robot
41a60f4033 Merge "Added the class name of activity being autofilled on (most) autofill metrics." into pi-dev 2018-05-25 00:55:42 +00:00
Felipe Leme
212b1614f4 Added the class name of activity being autofilled on (most) autofill metrics.
Test: atest CtsAutoFillServiceTestCases # to make sure it didn't break anything
Test: manually run some test and watched
      'adb shell logcat -b events | grep sysui'

Fixes: 80151641

Change-Id: I5b83e6ceb549a641d10c39bbfd4f24d0a43d1a23
2018-05-24 13:59:06 -07:00
Michael Wright
b112f26cce Use TCM context if application context is unavailble.
In TextClassificationManager, we use the application context to reduce
the likelihood of leaking the underlying Activity. Unfortunately, some
places (e.g. auto, system_server) don't actually provide us an
application context, so we need to fall back to whatever context was
passed in to TCM in the first place.

Bug: 80188317
Test: none
Change-Id: Ib4b2e6ed543d3ed56cefd8f56717855158cdc0fe
2018-05-24 14:15:04 +01:00
TreeHugger Robot
177ee3d7a1 Merge "Display Cutout: Fix ActionBarOverlayLayout to properly dispatch cutout" into pi-dev 2018-05-18 22:12:30 +00:00
Adrian Roos
f7b7426d81 Display Cutout: Fix ActionBarOverlayLayout to properly dispatch cutout
ActionBarOverlayLayout used to drop WindowInsets, extract the content insets
as a rect, and then dispatch a modified rect to the content view; this because
there was no way to retarget the WindowInsets to the content view, and the
WindowInsets were not truly immutable. That means however, that other kinds of
insets than the content insets do not get dispatched, such as the display cutout.

To fix this, we add APIs to inset WindowInsets, make them immutable. Note that
a similar change is needed for the support lib.

Bug: 79733300
Test: atest ActionBarOverlayLayoutTest
Change-Id: I6a69d8462163ca5e66fdb53f83def6bc4063f8aa
2018-05-18 20:58:38 +00:00
Jorim Jaggi
b29e318e03 Schedule trimMemory after drawing the frame
Fixes jank issues where trimMemory gets scheduled during an
animation. trimMemory likely hits code that is not in the
page cache anymore, leading to high execution time because of page
misses. Scheduling it after the next frame has been drawn
minimizes the risk that this page miss actually causes jank.

Test: Boot, switch between a couple of apps.
Bug: 78611607
Change-Id: Ia1fc411fbe6ca07861183ae484124406681118e5
2018-05-18 18:26:30 +02:00
Jorim Jaggi
e4a8d4c7e9 Merge changes I608d4b61,Ia7900e75 into pi-dev
* changes:
  Follow up to Ia7900e753b29187a7a7b81f393666687e8b8e04b
  Apply surface parameters in sync with RenderThread
2018-05-18 11:49:56 +00:00
TreeHugger Robot
3fa564030f Merge "Refresh TCM settings when they change" into pi-dev 2018-05-17 17:46:24 +00:00
Abodunrinwa Toki
c2449b8361 Refresh TCM settings when they change
Approach here is to register a content observer that invalidates the
TC settings whenever updates to the settings happen.

This CL also ensures that the TC is invalidated when a settings
update happens. This is because the settings may change what
TC the system returns.

TextView's SelectionActionModeHelper has been updated to not cache
the settings and get them directly from TCM (which caches the settings).

NOTE that we expect TC settings to rarely change.

Bug: 77539576
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: manual - Made changes to TC settings and observed logs / app behaviour

Change-Id: I88bbb6f951708b17323fac1a72385fe808d270a5
2018-05-17 11:29:29 +01:00
TreeHugger Robot
2085646c7d Merge "Use FLAG_UPDATE_CURRENT for TC PendingIntents." into pi-dev 2018-05-17 10:11:19 +00:00
Dieter Hsu
7f91c59b3e Merge "Trigger action for app ops icon for keyboard navigation" into pi-dev 2018-05-17 06:04:13 +00:00
Dieter Hsu
3a9b5a98dc Trigger action for app ops icon for keyboard navigation
Bug: 79671932
Test: manually check talkback, switch access and kb navigation
Change-Id: I8a2ed0fc8e6b565e923954fa87e61a20c83438c0
2018-05-17 06:03:58 +00:00
Jorim Jaggi
64be98d5d2 Apply surface parameters in sync with RenderThread
Otherwise it could lead to parameters applied in the wrong frame,
leading to jank.

Test: Open notification
Bug: 78611607
Change-Id: Ia7900e753b29187a7a7b81f393666687e8b8e04b
Merged-In: Ia7900e753b29187a7a7b81f393666687e8b8e04b
2018-05-17 01:57:31 +00:00
TreeHugger Robot
10f8ed0cf8 Merge "TextSelection.Builder.setId should take null as well" into pi-dev 2018-05-16 23:52:14 +00:00
Tony Mak
84368781ec TextSelection.Builder.setId should take null as well
TextSelection#Id is nullable, so the builder should take null as well.

Bug: 79779551
Test: Build
Change-Id: Iacabcab2befcbd4cb1c8674c253fe9a26cb877bf
2018-05-16 01:05:35 +00:00
Abodunrinwa Toki
aec5981b88 Use FLAG_UPDATE_CURRENT for TC PendingIntents.
This way the newest PendingIntent will override any matching ones.

Bug: 78286917
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationTest
Change-Id: Ib130fa5979c3dab628e7be668331cb94d23e0829
2018-05-15 23:23:12 +01:00
Phil Weaver
b504a2f65b Merge "Update a11y when alpha changes" into pi-dev 2018-05-15 19:49:09 +00:00
Dake Gu
7b6ecb7668 Merge "Autofill: allow switch IME when autofill is showing" into pi-dev 2018-05-15 01:02:41 +00:00
Phil Weaver
3789bbc476 Merge "Improve a11y ordering" into pi-dev 2018-05-14 23:25:07 +00:00
Phil Weaver
86b3260128 Improve a11y ordering
We use ids to break ties when sorting views just to
guarantee that we won't break sorting. But we don't
want to have our swipe order determined by arbitrary
ids.

Before resorting to such a crude tie-breaker, look at
a view's children to try to break a tie using their
bounds. That sort is more based on what's on the
screen, and will also produce the same result from
the same ui.

Bug: 78348191
Test: Switch access order is much more sensible on
Recents. Also ran a11y cts.

Change-Id: I918eae3b0d27e889a53d05a6ebe925e38ce5d7b4
2018-05-14 20:01:37 +00:00
Jan Althaus
e3125c7e89 Merge "Remove custom schema parsing in favor of Uri" into pi-dev 2018-05-14 08:21:40 +00:00
TreeHugger Robot
6db14d01c2 Merge "Do not parcel legacy TextClassification fields" into pi-dev 2018-05-13 21:32:20 +00:00
Winson Chung
53ae6a82cd Merge changes from topic "sysui_flags_drop" into pi-dev
* changes:
  Clean up Recents animation api
  Expose the system ui visibility flags and translucent state with snapshot
2018-05-11 22:18:37 +00:00
Dake Gu
ddf6c1e22c Autofill: allow switch IME when autofill is showing
IME used to allow startInput() *only* when window has focus.
This is no longer the case after we made changes to allow autofill
window to get window focus to receive physical keyevents.

The fix changed precondition of when InputMethodManager can startInput:
(hasWindowFocus() || isAutofillUIShowing()).

Test: manual test:
      - install two IMEs
      - install autofill sample service and autofill sample service
      - launch the Autofill sample app, click on edittext, both
        IME and autofill window are showing.
      - type "username", autofill datasets are being filtered.
      - click "globe" button in IME window to switch IME.
      - continue typing "username2" using new IME and autofill window
	continues to filtering.
      - also try the "IME switch" button in bottom bar to switch IME.
Bug: 79494235

Change-Id: I0d222b5fc13ad46834aa861647d8f2e1649093ec
2018-05-10 17:11:47 -07:00
Abodunrinwa Toki
ba196c5a3d Do not parcel legacy TextClassification fields
If we depend on legacyIntent, then TextClassifierService implementations
will have to always popuplate a deprecated field.
To avoid breaking legacy clients, the returned legacyOnClickListener should
represent the first pendingIntent (i.e. primary action) that was parcelled.

Bug: 78340399
Test: atest CtsViewTestCases:TextClassificationManagerTest
Test: atest FrameworksCoreTests:TextClassificationTest
Test: manual check with a TCS that only sets non-deprecated fields vs a
legacy TC client
Change-Id: I41d27a65f1ede6369dd2a66d92b2210edb0d11e2
2018-05-10 19:42:55 +01:00
Winson Chung
6802e2a553 Clean up Recents animation api
Bug: 73714156
Test: Ensure you can still swipe up

Change-Id: Ie70ed0edb05f54d17d3989895b86e07851c44c06
2018-05-08 17:56:05 -07:00
Phil Weaver
d2bebd43a4 Update a11y when alpha changes
We were only updating accessibility in View#setAlpha,
but View#setAlphaNoInvalidation would also change alpha,
and accessibility would never find out.

Bug: 78101543
Test: TalkBack now works on nightlight conditional and
battery saver slider.

Change-Id: I1ebb62aa7f4de700b2d7fbaae8dbbd1c84fc4ece
2018-05-08 15:22:17 -07:00
Abodunrinwa Toki
dfd3c653ce Fix TextClassifier logging.
No logs were being sent via the TextClassificationManagerService to
the TextClassifierService.
Also, SelectionEvent.getSessionId() is nullable. Handle appropriately.

Bug: 79418429
Test: manual - manually tested via a debugger. Auto tests coming soon.
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
Change-Id: I196885d9b03c0c11cae7686a5835d14791065e78
2018-05-08 18:35:29 +01:00
Jan Althaus
7dd7c5ceda Remove custom schema parsing in favor of Uri
This allows TextClassifier models to add support for additional protocols
after launch.

Bug: 79407639
Test: atest FrameworksCoreTests:TextClassificationManagerTest
Test: atest FrameworksCoreTests:TextClassificationTest
Test: atest CtsViewTestCases:TextClassificationManagerTest
Test: atest CtsViewTestCases:TextClassifierValueObjectsTest
Change-Id: I6781bf476f8c81d2106e2fb73b8f4629068bb0af
2018-05-08 15:30:04 +02:00
Felipe Leme
1116652087 New FIELD_AUTOFILL_COMPAT_MODE field.
This field is used on pretty much all Autofill metrics, except
AUTOFILL_USERDATA_UPDATED, AUTOFILL_SERVICE_DISABLED_SELF, and
AUTOFILL_INVALID_PERMISSION.

Test: atest CtsAutoFillServiceTestCases
Test: adb shell logcat -b events | grep sysui

Bug: 79351659

Change-Id: I2e2f3dcc780a3896162b158926f5ee89c7cb342d
2018-05-07 12:14:00 -07:00
Rob Carr
625de7758b Merge "SurfaceControl: Close CloseGuard when destroying surface in transaction." into pi-dev 2018-05-03 22:52:18 +00:00
android-build-team Robot
d733159b45 Merge "WIDGET_TYPE_UNSELECTABLE_TEXTVIEW is missing in the WidgetType" into pi-dev 2018-05-03 14:05:00 +00:00
Tony Mak
4dd4314744 WIDGET_TYPE_UNSELECTABLE_TEXTVIEW is missing in the WidgetType
Test: None

Bug: 72534351

Change-Id: I9cde8d98d2cd32aae91513fd65010011e3570470
2018-05-02 15:51:55 +00:00
Mihai Popa
724990d5ff Merge changes I63f2b185,I0d749c1a into pi-dev
* changes:
  [Magnifier-42] Fix bug in window positioning
  [Magnifier-41] Fix behavior in windows with insets
2018-05-02 12:02:18 +00:00
Mihai Popa
0450a16759 [Magnifier-41] Fix behavior in windows with insets
The CL fixes the magnifier's behavior when its parent window has
positive insets in its surface:
- we compute the content copy coordinates sent to the pixel copy request
relative to the surface the content is copied from. We were clamping
them inside the visible region of the magnified view as returned by
belonging to the view which is magnified. However, the method returns
coordinates relative to the window. Therefore, the CL offsets the
visible rectangle with the window insets, to account for them.
Otherwise, when the insets were non-zero, on a text line we were
allowing the magnifier to display content from the left outside of the
text line, while a certain region at the end of the text line could have
never been magnified
- when clamping against the visible view region, when the surface we
copy from is a SurfaceView, #getGlobalVisibleRect is still returning
coordinates relative to the main window, whereas the coordinates we are
trying to clamp are relative to the surface of the SurfaceView. In order
to make the visible rectangle relative to the surface of the SurfaceView
instead, this CL negatively offsets the visible rectangle with the
SurfaceView position in the parent surface
- the selection/insertion handles are hidden when they overlap the
magnifier. To check this, we intersect the magnifier rectangle with the
rectangle of each handle.  However, when we were performing this check,
the magnifier rectangle was relative to the surface, whereas the
handles' rectangle was relative to the main window. The CL negatively
offsets the magnifier position with the surface insets, to make both
rectangles relative to the window.

Bug: 78621162
Test: manual testing
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: I0d749c1abb38520fe8fc477d22d6523f470e9abc
2018-05-02 10:29:19 +00:00