Commit Graph

11350 Commits

Author SHA1 Message Date
Adrian Roos
657c313cde Merge "WindowInsets: Never dispatch negative insets" into pi-dev am: 8997b7e4c9
am: 40b9c13052

Change-Id: I5fb7dc2c515c20db676f347101838f7624302cf3
2018-05-28 07:59:15 -07:00
Adrian Roos
8997b7e4c9 Merge "WindowInsets: Never dispatch negative insets" into pi-dev 2018-05-28 14:40:20 +00: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
Felipe Leme
833c99b9d1 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

Change-Id: If4b1c9ab616b2ba580745096894997eb7edb3e34
(cherry picked from commit 064c562c23edcb2c220be45450274869b529a8ee)
2018-05-24 23:20:35 -07:00
Felipe Leme
b838a09af3 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
(cherry picked from commit 212b1614f4)
2018-05-24 21:19:58 -07: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
Michael Wright
8d0c2bdcb8 Merge "Use TCM context if application context is unavailble." into pi-dev am: 87631c2d29
am: c4e7c86a60

Change-Id: Ie0e1260edc7749c557cefcc4faa966c8756af438
2018-05-24 17:38:08 -07: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
d6f175d727 Merge "Allow keycode lookup without KEYCODE_ prefix" 2018-05-23 16:55:32 +00:00
Siarhei Vishniakou
de1f904713 Allow keycode lookup without KEYCODE_ prefix
Currently, KeyEvent.keyCodeFromString(String name) requires the string
to either start with "KEYCODE_", or be directly convertible to an int.
However, the string representation of every keycode starts with
"KEYCODE_", so this requirement is redundant. Relax this requirement to
alllow both of the following usages:
1) keyCodeFromString("KEYCODE_BUTTON_A")
2) keyCodeFromString("BUTTON_A")

Currently, only 1) is supported.

The other usage,
3) keyCodeFromString("29")
is unchanged.

The input is no longer case-sensitive.
Improved the example of usage in the documentation: the input
"1001" suggests that the string must contain binary representation for
usage 3), while in fact it is supposed to be a base 10 number.

Test: atest cts.KeyEventTest#testKeyCodeFromString
Bug: 36069459

Change-Id: I54d7f9d1270748854143cc9d1e8af48c9ec0cd0f
2018-05-22 07:23:34 -07:00
Adrian Roos
ab2f888137 Merge "Display Cutout: Fix ActionBarOverlayLayout to properly dispatch cutout" into pi-dev am: 177ee3d7a1
am: 6098f6db68

Change-Id: Idf260e2dd6e0bbfdcaefc1d3f85ac82dadf31050
2018-05-18 15:27:56 -07: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
da6e14bc53 Merge "Schedule trimMemory after drawing the frame" into pi-dev am: 6b8014f5c8
am: 7b7d830f5a

Change-Id: I7b56dc55c46db0dff80b3d0ace439f5e83599100
2018-05-18 12:24:55 -07: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
Abodunrinwa Toki
228460c709 Merge "Refresh TCM settings when they change" into pi-dev am: 3fa564030f
am: f08646f13e

Change-Id: I2a7fc61dac52817b053a680b82c18514f76ec6b8
2018-05-17 11:13:47 -07:00
TreeHugger Robot
3fa564030f Merge "Refresh TCM settings when they change" into pi-dev 2018-05-17 17:46:24 +00:00
Abodunrinwa Toki
cfb880c6e0 Merge "Use FLAG_UPDATE_CURRENT for TC PendingIntents." into pi-dev am: 2085646c7d
am: 402a57bac2

Change-Id: Ia8bb7755472d05b74a9d9efb6b4e6df7b4d52b8a
2018-05-17 03:36:59 -07: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
6ce3db4976 Merge "Trigger action for app ops icon for keyboard navigation" into pi-dev am: 7f91c59b3e
am: a30db99a93

Change-Id: I230703ca8de3ca0e7949f212cc2af1c95ffcc38c
2018-05-16 23:22:11 -07: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
Tony Mak
25e3969ccf Merge "TextSelection.Builder.setId should take null as well" into pi-dev am: 10f8ed0cf8
am: ed8e0f6fe6

Change-Id: Ie518095729244f18e9c5cebb2616b98be1b33ce1
2018-05-16 17:15:38 -07: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
Jorim Jaggi
7a5addd2b7 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
2018-05-15 17:31:33 -07: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
10e49ae1e6 Merge "Update a11y when alpha changes" into pi-dev am: b504a2f65b
am: 291adf498d

Change-Id: I226fbf893ff7c92408bb64b7aa4d2a2d529c3232
2018-05-15 14:15:24 -07:00
Phil Weaver
b504a2f65b Merge "Update a11y when alpha changes" into pi-dev 2018-05-15 19:49:09 +00:00
Dake Gu
0afc76ede5 Merge "Autofill: allow switch IME when autofill is showing" into pi-dev am: 7b6ecb7668
am: 0c268a1a89

Change-Id: Ia0ec98c603ecd69f4b54793df1228468596c6df6
2018-05-14 18:46:16 -07: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
dac9591e7d Merge "Improve a11y ordering" into pi-dev am: 3789bbc476
am: fbcae9d732

Change-Id: I0c234b9e3f2778951c729ed6daed96bcc3b394d2
2018-05-14 16:49:43 -07: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
5f84c4e6b3 Merge "Remove custom schema parsing in favor of Uri" into pi-dev am: e3125c7e89
am: 927c227845

Change-Id: Ic42e3a481e6ced6a74f795118e2d576f261790cc
2018-05-14 01:44:27 -07:00
Jan Althaus
e3125c7e89 Merge "Remove custom schema parsing in favor of Uri" into pi-dev 2018-05-14 08:21:40 +00:00
Abodunrinwa Toki
7c41320e8a Merge "Do not parcel legacy TextClassification fields" into pi-dev am: 6db14d01c2
am: 164183125c

Change-Id: I2a7b4323e815f5a4868085be69e417439729ff90
2018-05-13 14:52:24 -07:00
TreeHugger Robot
6db14d01c2 Merge "Do not parcel legacy TextClassification fields" into pi-dev 2018-05-13 21:32:20 +00:00
Winson Chung
10348578c8 Merge changes from topic "sysui_flags_drop" into pi-dev am: 53ae6a82cd
am: 59ff523949

Change-Id: I8d6fa49ba23b78648cf43fafe7c290f2e0c4b59f
2018-05-11 16:48:13 -07: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
Abodunrinwa Toki
c1116bc55b Merge "Fix TextClassifier logging." into pi-dev am: 1c60953f9d
am: c2aa28895a

Change-Id: Ia7efff7e3505053b21e4e7c6f55cc2394024f318
2018-05-11 13:40:26 -07: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