Commit Graph

8580 Commits

Author SHA1 Message Date
TreeHugger Robot
755e3dfafb Merge "Update the documentation for inline suggestion APIs" into rvc-dev am: d725389a55 am: e27ed6a551 am: de871487f3 am: e54bdc1509
Change-Id: I6b3e5fcc212a27e89d7660c752a4babb68b9dbd1
2020-05-01 02:30:17 +00:00
TreeHugger Robot
d725389a55 Merge "Update the documentation for inline suggestion APIs" into rvc-dev 2020-05-01 01:42:05 +00:00
Andrew Sapperstein
6b1e3188a3 Merge "Fix broken @see tags in public documentation." 2020-05-01 00:27:47 +00:00
TreeHugger Robot
940913056d Merge "Use TextClassicationSession to call smart selection APIs." into rvc-dev am: 5630dc86ed am: ff16872e06 am: b4af13b8b7 am: 6e458dac55
Change-Id: I5205e8372aa74b6f86f922985d07b52c33bdc0c0
2020-04-29 19:14:30 +00:00
TreeHugger Robot
5630dc86ed Merge "Use TextClassicationSession to call smart selection APIs." into rvc-dev 2020-04-29 17:34:09 +00:00
TYM Tsai
e79aa09f87 Update the documentation for inline suggestion APIs
Update the APIs documentation and add test cases

Bug: 152316540
Test: atest InlinePresentationStyleUtilsTest
Change-Id: Icff5d5b36fecd94ceb7db5446eefa16b4b1aac3b
2020-04-29 17:21:01 +08:00
TreeHugger Robot
6a0db46054 Merge "Move ImeAwareTextEdit from Settings to android.widget" into rvc-dev am: d3b000cafe am: 04ef13f4d6 am: 24ba41099a am: 91be4c0266
Change-Id: I67ab36d2bf9f29b28722dc3708bab32b6befc894
2020-04-29 06:20:50 +00:00
Kevin Chyn
412bd81933 Move ImeAwareTextEdit from Settings to android.widget
Also use it for AuthCredentialPasswordView

Bug: 154161590

Test: BiometricPromptDemo, authenticate with password
Change-Id: I17601848dd9be3d0580988e3ff613c3793dfed51
2020-04-28 18:06:25 -07:00
Andrew Sapperstein
e0624c7a40 Fix broken @see tags in public documentation.
These were previously being suppressed by doclava but with this change,
all failures are fixed and the suppression logic has been removed.

To fix the issues, there were a few possible changes made:
- broken reference to a public API (such as incorrect parameters): fixed
- unnecessary @link inside an @see tag: fixed
- @see referring to an @hide or @SystemApi: reference removed
- broken references to inner class constructors
 - worked around by fully qualifying the constructor

Bug: 6963924
Test: make doc-comment-check-docs
Change-Id: Ifbdce2de96cdffa560bd90f549fa7184d1f9af85
2020-04-28 12:37:15 -07:00
Nikita Dubrovsky
bed2294074 Merge "Add debug logging for RichContentReceiver" 2020-04-27 22:46:56 +00:00
Aran Ink
1dfa9f62af Merge "Add dismissImmediate to ListPopupWindow to prevent window leaks in GlobalActionsDialog." into rvc-dev am: 82e9872732 am: 1b6a93a2a3 am: fcc722dbf9 am: a75662e33d
Change-Id: I1143cf6d75ff7b34a11fba2618a8df9d03b724db
2020-04-27 18:40:20 +00:00
Aran Ink
d397b9084d Add dismissImmediate to ListPopupWindow to prevent window leaks in GlobalActionsDialog.
Fixes: 154640131
Test: Manual -- Use 'adb shell dumpsys window windows || grep "PopupWindow"' to confirm number of PopupWindows displayed (should be zero at home screen.)
Open GlobalActions. Tap the power overflow menu and check number of PopupWindows while the overflow dropdown is visible (should be 1).
Put the phone to sleep by pressing the power button. Wake phone and make sure number of PopupWindows is 0.
Repeat with Controls structure switcher dropdown and add controls dropdown.

Change-Id: I4ae2d86e981465e8e6c0adf924a6fc2eabfc88ee
2020-04-24 18:06:14 -04:00
Tony Mak
6f4e063edb Use TextClassicationSession to call smart selection APIs.
We used to use TextClassicationSession to send us logging only (i.e.
onSelectionEvent()). Now we use TCSession to call smart selection APIs
(i.e. suggestSelection and classifyText). This allows the TCS to
obtain the session ID in onSuggestSelection and onClassifyText.

BUG: 149077320

Test: atest TextViewActivityTest
Test: Try a few smart selections and log the sessionID of each TC APIs.

Change-Id: I320249735aa08fb7e8612060955b2aa5496da94b
2020-04-24 12:35:48 +01:00
TYM Tsai
41447be309 Merge "Filter the content of the Bundles used as extras and styling APIs" into rvc-dev am: 4ddfdaf641 am: 5c913aeacc am: 6cce28ebbc am: 009fb7ec44
Change-Id: I4d317f36033a59baf9001f7017ffd3beffc20c2b
2020-04-24 09:49:21 +00:00
TYM Tsai
4ddfdaf641 Merge "Filter the content of the Bundles used as extras and styling APIs" into rvc-dev 2020-04-24 08:42:56 +00:00
TreeHugger Robot
4ec82fdd06 Merge "Process numpad enter key along with enter key." into rvc-dev am: b22931a0fb am: eb9484cc55 am: 5fdaabbacd am: f3bca3a0d4
Change-Id: Ibca91a0e7ecc8943b8cf6bd0b687048b6f9b8791
2020-04-23 02:01:43 +00:00
TreeHugger Robot
b22931a0fb Merge "Process numpad enter key along with enter key." into rvc-dev 2020-04-23 01:12:52 +00:00
TYM Tsai
850c8129e6 Filter the content of the Bundles used as extras and styling APIs
Adds filter to prevent passing binder objects in the extras and styling
APIs for inline suggestions. Avoids these to be used to send over remote
objects for Autofill provider and IME to communicate through private APIs
bypassing the OS.

Bug: 152316540
Test: atest CtsAutoFillServiceTestCases
Test: atest InlineSuggestionsRequestTest
Change-Id: I00940a845ed0e2546cbe09fa36e2439869c2f783
2020-04-22 14:41:07 +08:00
Jeff Sharkey
ea636fd945 Merge changes from topic "apr19" into rvc-dev am: b67e70aa40 am: ed91f7aabf am: a650421e92 am: a719ff7c61
Change-Id: I315e0b8f3a4309298951fed20c5a706f4707fd6a
2020-04-21 23:33:54 +00:00
Jeff Sharkey
b67e70aa40 Merge changes from topic "apr19" into rvc-dev
* changes:
  Update some Parcelables to send Strings UTF-8.
  Offer to write Strings through Parcels as UTF-8.
2020-04-21 22:59:40 +00:00
Jeff Sharkey
0223df096c Update some Parcelables to send Strings UTF-8.
An earlier CL with benchmarks has shown that sending strings as UTF-8
is 50% faster for US-ASCII strings, and still 68% faster for complex
strings referencing higher Unicode planes.  (So an improvement in
both cases!)

Since code across the OS still makes heavy assumptions about Parcel
strings typically being UTF-16, we need to carefully migrate
Parcelables by hand, which is what this CLs begins doing.

This is a purely mechanical refactoring with no functional changes.

Bug: 154436100
Test: manual
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ia9e581efd7c40269342b7528ca07363deb843c0f
2020-04-21 22:59:26 +00:00
Nikita Dubrovsky
ec0d63e9fc Merge "Rename RichContentReceiver.SOURCE_MENU to SOURCE_CLIPBOARD" 2020-04-21 18:14:25 +00:00
Joanne Chung
beb25afa62 Merge "Fix app crash if the selection is from reverse direction." into rvc-dev am: 4661207775 am: a922f821a8 am: 1c5842823a am: 2342e2f0c4
Change-Id: I6b06e5ad8c2f9168b292d0cf0b910bd4d1c40421
2020-04-20 07:11:00 +00:00
Nikita Dubrovsky
d3adf5e5d6 Add debug logging for RichContentReceiver
Bug: 152068298
Test: manual
Change-Id: I05becdd9d7d8668397f6002b1b8cc26f02bc60ef
2020-04-19 22:55:55 -07:00
Joanne Chung
4661207775 Merge "Fix app crash if the selection is from reverse direction." into rvc-dev 2020-04-20 05:55:46 +00:00
Nikita Dubrovsky
bc495089fd Rename RichContentReceiver.SOURCE_MENU to SOURCE_CLIPBOARD
Using "menu" was ambiguous since ACTION_PROCESS_TEXT is also triggered
via the menu but has its own enum value.

Bug: 152068298
Bug: 154151141
Test: ran tests
  atest CtsWidgetTestCases:TextViewRichContentReceiverTest
Change-Id: I3805577e9d7bbf55d40339d37820cd7f510da37e
2020-04-19 22:55:37 -07:00
Hui Yu
4d488db68a Merge "Move noteAppWidgetTapped call into AppWidgetHostView." into rvc-dev am: 4db77a9749 am: 40c8596a10 am: 5a0784ed87 am: 99e5cb35fa
Change-Id: Ie318b4891c83db57c917c45be17f401b4f12491b
2020-04-18 05:42:20 +00:00
Hui Yu
4db77a9749 Merge "Move noteAppWidgetTapped call into AppWidgetHostView." into rvc-dev 2020-04-18 04:03:52 +00:00
Nikita Dubrovsky
b66a027f1d Merge "Integrate ACTION_PROCESS_TEXT with RichContentReceiver" 2020-04-17 17:16:04 +00:00
Nader Jawad
ee13e3cbcd Merge "Updated TextView#setCompoundDrawableTintList documentation to refer to BlendMode.SRC_IN instead of PorterDuff.Mode.SRC_IN" 2020-04-17 01:13:34 +00:00
Nader Jawad
2e40bb8b1e Merge "Updated TextView#setCompoundDrawableTintList documentation to refer to BlendMode.SRC_IN instead of PorterDuff.Mode.SRC_IN" into rvc-dev 2020-04-17 01:11:59 +00:00
Nikita Dubrovsky
90b8d4995a Integrate ACTION_PROCESS_TEXT with RichContentReceiver
Bug: 152068298
Bug: 152808432
Test: Ran existing/new tests for ACTION_PROCESS_TEXT
  atest FrameworksCoreTests:TextViewTest
  atest FrameworksCoreTests:TextViewProcessTextTest
Change-Id: Idf88839f96087cdc403ea1b5413c238413e005d3
2020-04-16 14:54:55 -07:00
Shu Chen
ba5955d210 Merge "Prevents multi touch among TextView and handle reviews." into rvc-dev am: 9b6af1dcc5 am: f4d56c5846 am: 124c5949d4 am: bf33940153
Change-Id: I1124d9c2acb5c96b6e21a1c21c396944bb00607d
2020-04-16 16:13:54 +00:00
Shu Chen
9b6af1dcc5 Merge "Prevents multi touch among TextView and handle reviews." into rvc-dev 2020-04-16 15:32:32 +00:00
Joanne Chung
cb3c97db0c Fix app crash if the selection is from reverse direction.
When user types some text and then long presses on end of empty area
to open context menu, if user opens Gboard and selects text from the
reverse direction, SelectionEnd will be less than SelectionStart. The
IllegalArgumentException occurred because TextClassification does not
allow SelectionEnd is less than SelectionStart. We swap the start and
end index if end index is less than start index.

Bug: 150916165
Test: Manual. No crash occurs.
Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest

Change-Id: I8dbc92f0f31e64b7e3a45ae91762e1b741629a8e
2020-04-16 17:37:05 +08:00
Shu Chen
eb8b1ba3df Prevents multi touch among TextView and handle reviews.
- First touch on TextView blocks secondary touches on handles.
 - First touch on handles blocks later touches on TextView but doesn't block secondary touches on other handles.

Bug: 150995597
Test: manually tested & automation tests:
  atest FrameworksCoreTests:EditorCursorDragTest
  atest FrameworksCoreTests:TextViewActivityTest
Change-Id: I7717fc061fc81514fc1dad0d3acbc73e683516cf
2020-04-16 13:58:10 +08:00
Hui Yu
4803268229 Move noteAppWidgetTapped call into AppWidgetHostView.
RemoteViews is public API used out of scope of widget. The correct place
to call noteAppWidgetTapped is in AppWidgetHostView.

Fix: 153676411
Test: manual test, tap a widget, "adb shell dumpsys usagestats | grep
USER_INTERACTION" to oberserve USER_INTERACTION event sent to UsageStas, "adb shell dumpsys appops | grep appWidgetVisible" to observer appWidgetVisible flag.

Change-Id: Ic473211b91fd952dbb81b09b1e1568d6f69a0dd8
2020-04-15 22:06:12 -07:00
Byungsung You
975a5f7aa5 Process numpad enter key along with enter key.
Some views define only KEYCODE_ENTER action not KEYCODE_NUMPAD_ENTER.
because of this, when numpad enter key is pressed expected result is not shown.
We are adding KEYCODE_NUMPAD_ENTER to be processed in the same way as KEYCODE_ENTER.

Test: Check that adb shell input KEYCODE_NUMPAD_ENTER and adb shell input KEYCODE_ENTER

Bug: b/141329038

Change-Id: I87b5159c4fe71eaf8501059249c79b7cfd1752fc
2020-04-15 18:36:11 -07:00
Nader Jawad
18e49a9bd4 Updated TextView#setCompoundDrawableTintList
documentation to refer to BlendMode.SRC_IN
instead of PorterDuff.Mode.SRC_IN

Fixes: 151952140
Test: N/A
Change-Id: Ie4b9a585c2dae49e633f6741180b6749493d069a
2020-04-15 20:26:10 +00:00
Nader Jawad
af5ff36051 Updated TextView#setCompoundDrawableTintList
documentation to refer to BlendMode.SRC_IN
instead of PorterDuff.Mode.SRC_IN

Fixes: 151952140
Test: N/A
Change-Id: Ie4b9a585c2dae49e633f6741180b6749493d069a
2020-04-15 20:21:52 +00:00
Sally Yuen
d74bcd3ca2 Merge "Check for text when adding CollectionInfo and CollectionItemInfo" into rvc-dev am: 387529809d am: 9f924154dc am: 6c546f7350 am: 8dc832099f
Change-Id: I3351d99c6e8df0e0426d607e9ab4400a1bc297cd
2020-04-07 17:43:41 +00:00
Sally Yuen
387529809d Merge "Check for text when adding CollectionInfo and CollectionItemInfo" into rvc-dev 2020-04-07 17:06:04 +00:00
Bernardo Rufino
4aef02d1e6 Merge "Wire user info and use user context for text toasts" into rvc-dev am: 2de79fb6fd am: ec0e67b052 am: 8499e595fe am: 95cc45f79f
Change-Id: Ic2121b6fe6509537a61eedb46307e6bb094ee3ce
2020-04-06 22:52:14 +00:00
sallyyuen
5a5c74f350 Check for text when adding CollectionInfo and CollectionItemInfo
Generally, the button's text is displayed next to the check box, but
Sound Settings uses its own views to display the text, distinct from
RadioGroup and RadioButton. This results in TalkBack announcing out
of list state too early, since the text content is not considered
part of the collection.

Add a check to exclude buttons with no text when counting the children
to be in the collection. Developers should be either setting the button
text or implementing their own views to appear alongside the buttons.

Bug: 149064784
Test: Added CTS test. Manual testing of Settings -> Sound -> Do no
disturb -> Advanced -> Set Duration for Quick Settings

Change-Id: Ie9abe4cccc4ab53e79a583b9a2ce45535dcf1cc0
2020-04-06 14:00:21 -07:00
Bernardo Rufino
78f5d83ac8 Wire user info and use user context for text toasts
Text toasts don't currently support multi-user. This CL prepares toasts
for multi-user by wiring the user information from who requested the
toast (in the form of uid) to ToastUI, where text toasts are actually
rendered.

We go only as far as obtaining a new user-specific context for that user
and using that to construct the view. Actual support will come in future
CLs.

Bug: 151414297
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
      ToastWindowTest ToastUITest NotificationManagerServiceTest
      LegacyToastTest
Change-Id: I8c92453c6a2b73c31f9a41ca9ff463d194d4f44f
2020-04-06 20:20:09 +01:00
Nikita Dubrovsky
ce3894baa4 Merge "Minor javadoc fixes for RichContentReceiver API" 2020-04-06 17:47:59 +00:00
Nikita Dubrovsky
186b4eba0a Minor javadoc fixes for RichContentReceiver API
Bug: 152068298
Test: Presubmit
Change-Id: If86fa3d68ae2af616f234a3fe283f333c29888cd
2020-04-03 17:57:19 -07:00
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