Commit Graph

8533 Commits

Author SHA1 Message Date
Automerger Merge Worker
1d0031bf41 Merge "Merge "Refactor ToastPresenter to perform show()/hide()" into rvc-dev am: 918db9ecde am: 9a2f55df99" into rvc-d1-dev-plus-aosp am: 34460a2f67 am: 7af99a7101
Change-Id: I994e37b4b940f96fcb9df49d2957e7e4dfad1dc0
2020-04-03 17:03:18 +00:00
Bernardo Rufino
dd4f238127 Refactor ToastPresenter to perform show()/hide()
In order to support multi-user, we need to create a new context based on
the user id and retrieve the services from it
(http://b/151414297#comment9). This meant retrieving the services in
ToastUI.showToast() instead of on its constructor, which would make the
code diverge from Toast$TN.handleShow(). In order to avoid that, now
seemed a good time to refactor ToastPresenter to perform show() and
hide().

This means ToastPresenter will now be instantiated in every request for
a new toast in ToastUI, but fortunately with the refactor we were able
to get rid of ToastEntry (which was also beign instantiated in every
request).

Also found out a bug with this where window tokens were being used to
locate the toasts instead of the (non-window) tokens. This is a bit
confusing because the method NM.finishToken(package, token) receives a
non-window token to locate the ToastRecord and then finish its window
token. This didn't have any side-effects because NM itself finishes the
tokens after a time-out. Added a test for this.

Bug: 152973950
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
      ToastWindowTest ToastUITest NotificationManagerServiceTest
      LegacyToastTest
Change-Id: I13cf18890ca22022adb7576c8ecf3285a9b82299
2020-04-03 12:57:08 +00:00
Bernardo Rufino
feb39a637a Merge "Rename test in TEST_MAPPING" into rvc-dev am: 884e9515d6 am: f2c0580ea2 am: 0ed8b87bd3 am: e2b6aaf551
Change-Id: I4fa1d411e81a3ceca8dbcbb577796ff522ce23a1
2020-04-03 11:23:43 +00:00
Bernardo Rufino
884e9515d6 Merge "Rename test in TEST_MAPPING" into rvc-dev 2020-04-03 10:02:09 +00:00
Bernardo Rufino
434c17c0e6 Rename test in TEST_MAPPING
ToastTest became ToastWindowTest in ag/10919524, updating TEST_MAPPING
to reflect that.

Test: croot frameworks/base/core/java/android/app && atest --dry-run --test-mapping
Test: croot frameworks/base/core/java/android/widget && atest --dry-run --test-mapping
Test: croot frameworks/base/services/core/java/com/android/server && atest --dry-run --test-mapping
Bug: 152973950
Change-Id: I5b9e9b83d17c4a93a1e830c26d7f44001ccf175d
2020-04-03 08:48:00 +01:00
Feng Cao
f8347366d2 Merge "Define custom equals method for bundles in the inline APIs" into rvc-dev am: 257aa916ac am: 8ab445a7a9 am: 3f185c6881 am: 6c8b4417cc
Change-Id: Iff11cae258441c0adbccc16bf28b2ccc2f61d252
2020-04-02 18:34:58 +00:00
Feng Cao
59b682f5cd Define custom equals method for bundles in the inline APIs
Test: atest android.view.inputmethod.cts
Bug: 152811052

Change-Id: I15051493bb37f05b579b16d6e7fee36b05ab10cc
2020-04-01 12:46:15 -07:00
Feng Cao
9c6842e884 Merge "Replace Nullable bundle with NonNull and use Bundle.EMPTY" into rvc-dev am: f1771c0d33 am: 12a7be983b am: b6ad7232ad am: 85ff58a80a
Change-Id: I053719f33f9319312087b1f4ef0ae1589952e46a
2020-04-01 03:16:24 +00:00
Nikita Dubrovsky
832edc3cc9 Add unified API for inserting rich content (e.g. pasting an image)
The new callback provides a single API that apps can implement to
support the different ways in which rich content may be inserted.

The API is added to TextView and unifies the following code paths:
* paste from the clipboard (TextView.paste)
* content insertion from the IME (InputConnection.commitContent)
* drag and drop (Editor.onDrop)
* autofill (TextView.autofill)

Corresponding API in support lib: aosp/1200800

Bug: 152068298
Test: Manual and unit tests
  atest FrameworksCoreTests:TextViewRichContentReceiverTest
  atest FrameworksCoreTests:AutofillValueTest
  atest FrameworksCoreTests:TextViewActivityTest
Change-Id: I6e03a398ccb6fa5526d0a282fc114f4e80285099
2020-03-31 15:15:36 -07:00
Feng Cao
edb332c645 Replace Nullable bundle with NonNull and use Bundle.EMPTY
Test: atest InlineSuggestionsRequestTest
Bug: 152525467

Change-Id: Ie510e08ced8be4cc8df486f1acfa6eb330d194ef
2020-03-31 14:50:51 -07:00
TreeHugger Robot
fa5431d8fa Merge "Properly layout InlineContentView" into rvc-dev am: 7f70f707b5 am: cb5de77e05 am: 705877256b am: 171e46ee9d
Change-Id: I62beabf1e624e9ff0a7b71f6ec0c3aa4c2af9717
2020-03-31 06:23:45 +00:00
Svet Ganov
5baa279868 Properly layout InlineContentView
bug:152723089
bug:152319052

Test: atest android.view.inputmethod.cts.InlineSuggestionTest

Change-Id: I656c2fb75560719210aa1efe8b9f06a0ced4d7e0
2020-03-31 03:37:24 +00:00
Adam He
1830552d39 Merge "Migrate android.view.inline to android.widget.inline" into rvc-dev am: 5a3a3f2239 am: c47f8abf1c am: c70f5e6254 am: 970ff93fa9 am: 321c7868fd
Change-Id: I5f2e3be463ce8a04e5475d4891acb2481ab831a6
2020-03-30 19:12:15 +00:00
Adam He
f27433af0f Migrate android.view.inline to android.widget.inline
Old APIs are kept and marked as @hide + @removed to maintain
compatibility.

Bug: 151262653
Test: manual verification
Change-Id: Ia50a1f87c194211be5256e948d43fb54c1cbf941
2020-03-29 17:29:32 -07:00
Shu Chen
79812eedc1 Merge "Calculates the slop values per upper/lower line height." into rvc-dev am: 27daeb0307 am: 1bb808525d am: 06e177368b am: 01755d22e8
Change-Id: I77430e4dbcfee7bc81b6e836594dcd43d7aa453e
2020-03-25 11:08:37 +00:00
Bernardo Rufino
32d774c9a8 Merge "Gate toast block and remove warning" into rvc-dev am: 7afc8b101b am: fed3f548d3 am: 36e998520a am: 0af032a87e
Change-Id: I4cce87e4661b9d47d2558794f54a48096206fba9
2020-03-25 10:33:58 +00:00
Shu Chen
27daeb0307 Merge "Calculates the slop values per upper/lower line height." into rvc-dev 2020-03-25 09:54:48 +00:00
Shu Chen
afbcf851d3 Calculates the slop values per upper/lower line height.
Also applies the max/min damping range for slop.
The max/min damping range includes lineHeight + slop.
Note: slop must >= zero.

Bug: 150531840
Test: manual & automated tests
  atest FrameworksCoreTests:EditorCursorDragTest
  atest FrameworksCoreTests:TextViewActivityTest

Change-Id: I26cdf69fd2cf7d4514dd2a902ed34c480c9e8781
2020-03-25 15:56:06 +08:00
TreeHugger Robot
13480370e3 Merge "Clarify Toast.Callback javadoc" into rvc-dev am: 8ac8b257f1 am: a0ffa7d718 am: eaa961f2a1 am: 72774da3d2
Change-Id: I72075202d424069960c15ce6a60ef493f0439271
2020-03-24 21:13:52 +00:00
Bernardo Rufino
c797aac41e Gate toast block and remove warning
Gate background custom toast block on targetSdk for beta 1, after
having gathered dogfood feedback. So, enabling the change for apps with
targetSdk > Q (>= R). Also removed warning toast.

Added tests in topic CL to cover all the cases.

Bug: 144152069
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
Change-Id: If368a97a2a8ff56770635615f89c79007bb27075
2020-03-24 20:22:18 +00:00
Bernardo Rufino
255094826d Clarify Toast.Callback javadoc
Text was ambiguous and could mean callback object construction instead
of toast construction.

Test: Builds
Bug: 144152069
Change-Id: I06160de2b85f339517ae45d3bd4cc1098f433ef0
2020-03-24 18:12:44 +00:00
Hui Yu
c30238be22 Merge "Update AppOps & UsageStats when app widget tapped." into rvc-dev am: aa3d42b129 am: aab97af060 am: 8b7fcb5766 am: d4d426a94c
Change-Id: Ib6ad73f64e04a4fdd1bf53cce628af06bc52139a
2020-03-21 20:52:54 +00:00
Hui Yu
3dc45fbc57 Update AppOps & UsageStats when app widget tapped.
When the app widget on the launcher is tapped on:
1. Update AppOps. AppOps treats the underlying app as foreground so the app can get while-in-use
permission.
2. Report a USER_INTERACTION event to UsageStats so UsageStats can
update mLastTimeUsed and mLastTimeVisible of this package.

Bug: 149043079
Test: manual test, tapped on a widget.
Change-Id: Ic8c91190881cf5dcf89f0f72cfd410b0c2e86bf6
2020-03-21 08:36:54 -07:00
TreeHugger Robot
0aa490c143 Merge "Fix PopupWindow's wrong location" into rvc-dev am: 4f4706de1f am: e1a515fe85 am: 3709c6bf85 am: 4a67a16837
Change-Id: I841ee5b4d98a4098df55381a6cc9dac737148828
2020-03-19 22:25:46 +00:00
TreeHugger Robot
4f4706de1f Merge "Fix PopupWindow's wrong location" into rvc-dev 2020-03-19 21:51:45 +00:00
Sally Yuen
56da5ed373 Merge "Implement ACTION_LONG_CLICK for accessibility" into rvc-dev 2020-03-18 21:45:46 +00:00
sallyyuen
cc02ea36b2 Implement ACTION_LONG_CLICK for accessibility
Due to changes in R, the a11y framework no longer dispatches touch
events for a long press. This prevents the activation of EditText's floating menu.

We can re-enable it by implementing the proper a11y action
ACTION_LONG_CLICK. The menu itself is diffult to access through TalkBack's linear
navigation, but this is future work for a separate known issue.

Start and stop the menu for editable TextViews, which includes EditTexts.
Since touch events are no longer sent by a11y, separate the
accessibility handling from the touch handling infrastructure for long clicks in Editor.

We can't go through the main performLongClick code because it doesn't
actually start the action mode but rather sets pending, which routes
back to TextView. There's too little separation between the touch events and action logic.

Whoever touches the performLongClick code may need to also make
corresponding changes to the a11y path, but I suspect this won't happen often.

Remove the onInitializeA11yNodeInfo override for EditText because this
is handled by TextView.

Bug: 148127445
Test: Tested text fields in various apps. ag/10602004. atest
FrameworksCoreTests:TextViewActivityTest#testToolbarAppearsAccessibilityLongClick

Change-Id: I3958e5b80e6156e03c99335e0d0b671438965ebb
(cherry picked from commit 3f1203fb78)
Merged-In: I3958e5b80e6156e03c99335e0d0b671438965ebb
2020-03-17 18:30:08 +00:00
Automerger Merge Worker
0905864d4e Remove local text classifier and related tests. am: 293bdf360a am: e94d4b04bc am: bc20f5c39b am: 1d304860eb
Change-Id: I8e8f69e0b3b29cce752ad320f988ef70dc96333e
2020-03-17 16:23:55 +00:00
Automerger Merge Worker
138fa38b40 Merge "Makes the finger-to-cursor distance configurable via DeviceConfig." into rvc-dev am: 422e7eada2 am: 51abef39d8 am: 544232cd10 am: d000406dae
Change-Id: If43fc2e2dadf3ed71f51e1b2651ba7129626c585
2020-03-17 15:30:14 +00:00
Automerger Merge Worker
e94d4b04bc Remove local text classifier and related tests. am: 293bdf360a
Change-Id: I466b3f5c6838c87d84f078ba24d7dd19aaf8d015
2020-03-17 12:12:04 +00:00
Tony Mak
a10f2b981a Merge "Remove local text classifier and related tests." into rvc-dev 2020-03-17 11:50:58 +00:00
Shu Chen
422e7eada2 Merge "Makes the finger-to-cursor distance configurable via DeviceConfig." into rvc-dev 2020-03-17 03:18:55 +00:00
Automerger Merge Worker
12b4e9981f Merge "Updating widgets docs" into rvc-dev am: 838c49bed6 am: 3a77d922fb am: 3fcf70dae0 am: 1e481b962f
Change-Id: I42a42f70b227aabfbd3a4d3b7198a777a5410861
2020-03-16 20:58:29 +00:00
Tony Mak
293bdf360a Remove local text classifier and related tests.
1. libtextclassifier and libtextclassifier-java are no longer built
   into framework/base.
2. Removed local text classifier code
3. Removed local text classifier test code.
   All of them should be already moved to libtextclassifier/tcs side.
4. Unify all the TC related log tags to "androidtc".

BUG: 147412216

Test: mts-tradefed run mts-extservices
Test: atest frameworks/base/core/java/android/view/textclassifier
Test: Sanity test: Smart selection

Change-Id: Icb1076153f51d5674c8a6c58681ffed5aa772149
2020-03-16 20:16:17 +00:00
Sunny Goyal
838c49bed6 Merge "Updating widgets docs" into rvc-dev 2020-03-16 20:07:53 +00:00
Sunny Goyal
296d4b5821 Updating widgets docs
Bug: 151195866
Test: N/A
Change-Id: Ice98b876c64653bde7337ac123746392790dea1b
2020-03-13 14:02:32 -07:00
Alan Viverette
abdc4977e5 Merge "[ProgressBar] Fix: Media volume bar indicates a wrong value" 2020-03-12 16:02:26 +00:00
Shu Chen
c331032de5 Makes the finger-to-cursor distance configurable via DeviceConfig.
Bug: 149885871
Test: manual tested.
Change-Id: I545be8aa594dde6c3412167fcdf1bad3403a11a3
2020-03-12 10:58:48 +08:00
Automerger Merge Worker
244ba47f05 Making time-zone an API constant am: 2e7408eddb am: 5fd18b033d am: 085bf87210 am: 4021198db5
Change-Id: Id9d3db95200952ca6c09117d68ca6173824ab955
2020-03-12 02:37:02 +00:00
Automerger Merge Worker
5fd18b033d Making time-zone an API constant am: 2e7408eddb
Change-Id: I92458f87eb0963330f98a3fe20c3336391e3f5b0
2020-03-12 01:43:19 +00:00
TreeHugger Robot
592181386c Merge "Making time-zone an API constant" into rvc-dev 2020-03-12 01:23:28 +00:00
Automerger Merge Worker
dab5e4f545 Merge "Temporary fix to disable augmented autofill requests coming from password fields." into rvc-dev am: f5589a71e0 am: 09822e4df1 am: a4ba34860f am: d059f5dfd1
Change-Id: I906a378e22bbbd5047dc49e9ac4fcade45a76138
2020-03-11 22:37:56 +00:00
TreeHugger Robot
f5589a71e0 Merge "Temporary fix to disable augmented autofill requests coming from password fields." into rvc-dev 2020-03-11 21:43:58 +00:00
Suprabh Shukla
2e7408eddb Making time-zone an API constant
This is already effectively an API the way it is documented.
Updating all the references of the hard-coded constant.

Test: make update-api && make

Bug: 151112929
Change-Id: Iadeb03c516215cfc51bc8604b67250348d5a4375
2020-03-10 18:05:02 -07:00
Sally Yuen
737f9235e9 Merge "Implement ACTION_LONG_CLICK for accessibility" 2020-03-10 23:45:00 +00:00
sallyyuen
3f1203fb78 Implement ACTION_LONG_CLICK for accessibility
Due to changes in R, the a11y framework no longer dispatches touch
events for a long press. This prevents the activation of EditText's floating menu.

We can re-enable it by implementing the proper a11y action
ACTION_LONG_CLICK. The menu itself is diffult to access through TalkBack's linear
navigation, but this is future work for a separate known issue.

Start and stop the menu for editable TextViews, which includes EditTexts.
Since touch events are no longer sent by a11y, separate the
accessibility handling from the touch handling infrastructure for long clicks in Editor.

We can't go through the main performLongClick code because it doesn't
actually start the action mode but rather sets pending, which routes
back to TextView. There's too little separation between the touch events and action logic.

Whoever touches the performLongClick code may need to also make
corresponding changes to the a11y path, but I suspect this won't happen often.

Remove the onInitializeA11yNodeInfo override for EditText because this
is handled by TextView.

Bug: 148127445
Test: Tested text fields in various apps. ag/10602004. atest
FrameworksCoreTests:TextViewActivityTest#testToolbarAppearsAccessibilityLongClick

Change-Id: I3958e5b80e6156e03c99335e0d0b671438965ebb
2020-03-10 11:54:17 -07:00
Adam He
ef0fe20852 Temporary fix to disable augmented autofill requests coming from
password fields.

Bug: 141703197
Test: atest android.autofillservice.cts.augmented
Change-Id: I05330988899a4c21d69c655a39c29fd0fea298c3
2020-03-10 10:47:09 -07:00
Jacky Kao
4686370935 Merge "Improvement of IME Enter Action" into rvc-dev 2020-03-10 04:05:58 +00:00
Dieter Hsu
04a579c6b7 Merge "Update API ExtraRenderingInfo by review feedback" into rvc-dev 2020-03-10 03:08:50 +00:00
Shu Chen
45b08852ad Merge "Unifies the finger-to-cursor distance between drag cursor and drag handle." into rvc-dev 2020-03-09 23:46:42 +00:00