Commit Graph

8739 Commits

Author SHA1 Message Date
Mathew Inwood
8e742f928e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Hongwei Wang
286c33a5c5 Merge "Revert "Add maxTargetSdk restriction to unused APIs."" 2020-10-28 23:58:21 +00:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
ee5d369323 Merge "Add maxTargetSdk restriction to unused APIs." 2020-10-28 09:39:20 +00:00
Nikita Dubrovsky
e160845809 Merge "Add View.onReceiveContent() and View.getOnReceiveContentMimeTypes()" 2020-10-27 16:51:24 +00:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
Nikita Dubrovsky
82a414a184 Add View.onReceiveContent() and View.getOnReceiveContentMimeTypes()
Added View.onReceiveContent() which will invoke the callback if one
is set.

Added View.getOnReceiveContentMimeTypes() to return the MIME types
that the view can receive, removing the getSupportedMimeTypes()
method from the callback interface.

Changed the code to pass MIME types as a String[] instead of a
Set<String> in order to:
* Avoid repeated conversion from Set to array in
onCreateInputConnection.
* Avoid misleading users of the API into using contains() to compare
MIME types (ClipDescription.compareMimeTypes should be used in order to
correctly handle wilcards such as "image/*").

Bug: 170191676
Bug: 152068298
Test: atest CtsViewTestCases:ViewTest
Test: atest CtsViewTestCases:ViewOnReceiveContentTest
Test: atest CtsWidgetTestCases:TextViewOnReceiveContentCallbackTest
Test: atest FrameworksCoreTests:TextViewOnReceiveContentCallbackTest
Test: atest FrameworksCoreTests:AutofillValueTest
Change-Id: Id0c7f8f5fd3c7c44827a62dba1b2b205433e7540
2020-10-26 12:12:01 -07:00
Yinglei Wang
a10c1cebbd Merge "Change radio button's default state description to "selected", "not selected"" 2020-10-23 17:29:29 +00:00
Shu Chen
a8f4f91f36 Merge "Makes the multi-touch prevention only works for editable TextView." 2020-10-23 05:26:48 +00:00
TreeHugger Robot
acd46f5672 Merge "IME API: InputConnection#getSurroudingText(int, int, int)" 2020-10-23 03:18:54 +00:00
yingleiw
893b7d629d Change radio button's default state description to "selected", "not selected"
Per partner request.

Fix: 171507541
Test: tested manually with talkback.

Change-Id: I234281fed476e664cd13bf3079fc706564ad1f3d
2020-10-22 15:35:40 -07:00
Shu Chen
265096d9da Makes the multi-touch prevention only works for editable TextView.
The original logic of preventing the multi-touch issue for the edtiable
text view was introduced by ag/10930920.
Turns out the non-editable text views are affected.

The root cause of the issue is that:
 - the ACTION_DOWN/ACTION_UP events, as well as ACTION_PONITER_DOWN /
   ACTION_POINTER_UP, could be generated by different fingers,
 - and View#onTouchEvent() gets muted when isFromPrimePointer() == false,
 - so that no gesture is generated, e.g. click, long press, etc.

Note that View#onTouchEvent() is necessary to be muted to prevent long press
on text or scrolling while dragging the insertion handle view.

Bug: 169288151
Change-Id: Ia763e94be727ad23bb13839f146293f1579d03ec
2020-10-22 12:26:52 +08:00
Lan Wei
02b50d4944 IME API: InputConnection#getSurroudingText(int, int, int)
Introduce a new class SurroundingText and a new API in InputConnection
to support retrieving surrounding text as an atomic request.

SurroundingText is the class for wrapping the text and sggestion info.
InputConnection#getSurroudingText() will return an SurroudingText object
if the protocol is supported.

Test: atest FrameworksCoreTests:SurroundingTextTest
Test: atest CtsInputMethodTestCases:BaseInputConnectionTest

BUG: 167947745
Change-Id: I2eb9ef5ba61a0e033007089da80f81548108621e
2020-10-21 13:22:36 +08:00
Nikita Dubrovsky
0651ff7401 Merge "Use IME image API impl as fallback in TextViewOnReceiveContentCallback" 2020-10-19 16:38:58 +00:00
Nikita Dubrovsky
7b384751ea Use IME image API impl as fallback in TextViewOnReceiveContentCallback
A bunch of apps implement the keyboard image API (see
https://developer.android.com/guide/topics/text/image-keyboard).
When image support in augmented autofill is released, we'd like it to
work immediately in apps that have previously implemented the keyboard
image API, without having to wait for these apps to move to the new
unified content insertion API. To make this possible, this change adds
logic to call the keyboard image API (InputConnection.commitContent) if
the app implements it and if the app target SDK is <= S. This gives apps
a full Android release to upgrade to the new content insertion API
while augemented autofill will immediately be able to insert images
without any changes in apps that have implemented the keyboard image
API.

Bug: 163400105
Bug: 152068298
Test: Manual and unit tests
  atest FrameworksCoreTests:TextViewOnReceiveContentCallbackTest
  atest CtsWidgetTestCases:TextViewOnReceiveContentCallbackTest
Change-Id: I9280604e7ec7e8d08c1179e6bbf0068647a41040
2020-10-16 16:40:40 -07:00
Ashwini Oruganti
361183631a Merge "Add a mutability flag to the PendingIntent in SearchView.java" 2020-10-16 22:36:28 +00:00
Roman Kalukiewicz
24403f7ef2 Add @Nullable annotation to the parameter of Object.equals() methods.
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.

The change was generated by running

find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'

in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.

Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
2020-10-15 10:48:01 -07:00
Ashwini Oruganti
5d9f5b6faa Add a mutability flag to the PendingIntent in SearchView.java
It is now required to specify an explicit mutability flag when creating
PendingIntents. This change adds an explicit FLAG_MUTABLE to a
PendingIntent in SearchView.java.

Since the previous default behavior was mutable, and the flag I have
added is FLAG_MUTABLE, this change should be a no-op functionally.

Bug: 170770665
Test: TH
Change-Id: Ib6d4f95f64430d8b187560614b97bac961a129c5
2020-10-14 14:54:31 -07:00
TreeHugger Robot
d573aae54a Merge "Add Plugin interface for Toasts" 2020-10-07 12:51:48 +00:00
Kohsuke Yatoh
291a0f9682 Add API to differentiate grammar suggestions.
The following attributes are added for grammar suggestions.
- SuggestionSpan#FLAG_GRAMMAR_ERROR
- SuggestionsInfo#RESULT_ATTR_LOOKS_LIKE_GRAMMAR_ERROR

Bug: 166304720
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I0e5da3125d28bb881e513d0d69e0a2d336a9f286
2020-10-05 23:29:14 -07:00
Beverly
b7ef5de9e0 Add Plugin interface for Toasts
Allows Toasts that route through SystemUI to be implemented by a
ToastPlugin. This CL also adds the ability for plugins to create a
custom animation for when the toast shows and hides.

Also adds logging for Toasts that get routed through SystemUI. By
default, these logs aren't logged to logcat but can be enabled via adb (see
LogBuffer.kt).

To dump ToastLog:
adb shell dumpsys activity service com.android.systemui/.SystemUIService ToastLog

Bug: 169587378
Test: manually add CustomToastPlugin
Test: atest ToastUITest
Change-Id: I0a0b16fdc2a5ba1908054197f6dc6728f10a0d2e
2020-09-30 20:48:29 -04:00
Nikita Dubrovsky
66d089ed65 Merge "Shorten logcat tag in TextViewOnReceiveContentCallback" 2020-09-29 00:37:06 +00:00
Nikita Dubrovsky
4816615af1 Shorten logcat tag in TextViewOnReceiveContentCallback
Bug: 152068298
Test: Manual
Change-Id: Ic191f5fe1f4f713f9c01a1934754e068b9daf96e
2020-09-28 14:14:00 -07:00
Sally Yuen
dfd366ed0e Merge "Add support for Force Bold Text" 2020-09-28 20:22:59 +00:00
Sally
5670baef9b Add support for Force Bold Text
This CL:
1) Saves the original unbolded typeface and returns this in
getTypeface
2) Sets Paint's typeface to a bolded one if the Setting is enabled,
or a config value is YES
3)  Bolds by adding 300 to the current font weight (400 is normal,
700 is considered bold, weight is capped at 1000)
4) Resets the Paint typeface to the original value if the Setting
is disabled, or the config value is not YES

Bug: b/110991537
Test: manual; unit tests
Change-Id: If21190fd5ad9d2e1721ffe464945f00ff20f62c6
2020-09-28 16:39:39 +00:00
Nikita Dubrovsky
dd9869aa4c Update RichContentReceiver API (now OnReceiveContentCallback)
Bug: 163718378
Bug: 165632620
Bug: 152068298
Test: Unit tests
  atest CtsWidgetTestCases:TextViewOnReceiveContentCallbackTest
  atest CtsViewTestCases:ViewTest
  atest FrameworksCoreTests:TextViewProcessTextTest
Change-Id: I3fa65b47c920a9d1ddad88a79e60864dc8109753
2020-09-25 13:46:33 -07:00
Joanne Chung
5f9810be21 Fix error test path in TEST_MAPPING
The test path was changed because autofill tests re-structure.
Correct the wrong path.

Bug: 159304958
Bug: 154961272
Test: atest --test-mapping frameworks/base/core/java/android/widget
Change-Id: Ie83c5c25e65d4ba767b23b1f7388b2d5fb32ca51
2020-09-25 10:05:39 +00:00
Jeff Sharkey
4b5b0174d0 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570 am: 487d394296
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: Id01f468b43fd5b2aada78608010625b392c1b647
2020-09-15 21:01:48 +00:00
Jeff Sharkey
487d394296 Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347 am: 741c0a78cc am: da7478b570
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I79488866c538bf9e76d0a6429e30262978f6fdab
2020-09-15 00:13:08 +00:00
Jeff Sharkey
741c0a78cc Merge changes from topic "sep11" am: c0b288133a am: 69e6f07347
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1426195

Change-Id: I7da537200efe31e803234bd1a0236843064186c8
2020-09-14 23:10:42 +00:00
Jeff Sharkey
a8cec413b6 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: I245b8d9cac722da76ea67983738a3cbb9deb68df
2020-09-14 10:00:07 -06:00
Jeff Sharkey
6516a83886 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Test: none
Bug: 168334533
Exempt-From-Owner-Approval: docs updates
Change-Id: Ifce5239991e3b78dd4757712e3b88093ad7161f0
2020-09-14 10:00:02 -06:00
Joanne Chung
257e3b58c8 Remove AutofillValueTest from widget TEST_MAPPING
There were some integration tests in AutofillValueTest before, we
moved integration tests to CheckoutActivityTest. AutofillValueTest is
a unit test now, we don't need this test running under widget path.

Bug: 167847110
Test: TreeHugger
Change-Id: I514942cff0122539ac614798020ecbbaf7cbaa3c
2020-09-07 08:15:23 +00:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
yingleiw
fc9d9b800f Add accessibility manager enabled check in progressbar
formatStateDescription() in onProgressRefresh() is causing performance
degradation with accessibility off.

Note that stateDescription is set in onInitializeAccessibilityNodeInfo
to ensure that accessibility always get the update-to-date
stateDescription. Otherwise, stateDescription might be stale on first
accessibility focus and the user might get wrong information.

Fix: b/166215147

Test: tested with talkback enabled from the beginning or from the
middle.

Change-Id: I9fb99b479b172d87c8d0fa1b8765dab53445b993
2020-08-31 13:03:18 -07:00
TreeHugger Robot
c4e8f0ef16 Merge "Update docs to clarify how providers can create style bundles and Slices for inline suggestions." into rvc-dev am: 18cff6082d am: 6128b1ba0f am: ea8b670196 am: 74698fc87a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12265211

Change-Id: Ibc7ef4273ee0462090cec713daae5fe0316b4589
2020-08-18 01:00:38 +00:00
TreeHugger Robot
74698fc87a Merge "Update docs to clarify how providers can create style bundles and Slices for inline suggestions." into rvc-dev am: 18cff6082d am: 6128b1ba0f am: ea8b670196
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12265211

Change-Id: I38ea717accd07eae665e625eb6f12c0a6be811a3
2020-08-18 00:46:05 +00:00
TreeHugger Robot
ea8b670196 Merge "Update docs to clarify how providers can create style bundles and Slices for inline suggestions." into rvc-dev am: 18cff6082d am: 6128b1ba0f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12265211

Change-Id: I3b25303b51dd10b649726c13a6aff7cc82f4e18f
2020-08-18 00:35:15 +00:00
TreeHugger Robot
5f6a8ef665 Merge "Update docs to clarify how providers can create style bundles and Slices for inline suggestions." into rvc-dev am: 18cff6082d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12265211

Change-Id: I35fa0ba127e5c73a46fe6ddff4428956a4e33eb2
2020-08-18 00:24:57 +00:00
Nikita Dubrovsky
cce1c87815 Merge "Add DeviceConfig flag for drag direction angle threshold for cursor drag" into rvc-qpr-dev am: 7094198a26
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12318230

Change-Id: Ie8d6995567b32b5552ee2e1d0eb92d9643e9bc08
2020-08-11 02:02:41 +00:00
Shu Chen
7e587a0ee2 Merge "Implement the floating cursor via the fisheye magnifier." 2020-08-08 02:49:26 +00:00
Shu Chen
4021c3dfd6 Implement the floating cursor via the fisheye magnifier.
- Remove the lineLeft/lineRight source bounds.
 - Make the magnifier center X can be away from the cursor X.
 - Let Magnifier know how to render floating cursor.

Test: locally verified.
Bug: 149883037

Change-Id: Iae3c68fa9cda0a83704fa30fa7b9f4db0a8d3314
2020-08-07 19:18:48 +08:00
Nikita Dubrovsky
81fa5e436a Add DeviceConfig flag for drag direction angle threshold for cursor drag
Bug: 160786691
Test: Manual and unit tests
  atest FrameworksCoreTests:EditorTouchStateTest
  atest FrameworksCoreTests:EditorCursorDragTest
Change-Id: Ib2e88fbdce4f901772d73bc7ee60483c98e02509
Merged-In: Ib2e88fbdce4f901772d73bc7ee60483c98e02509
(cherry picked from commit 8bac79d651)
2020-08-05 20:15:49 +00:00
Nikita Dubrovsky
fc0f15dc46 Merge "Add DeviceConfig flag for drag direction angle threshold for cursor drag" 2020-08-05 20:11:03 +00:00
Nikita Dubrovsky
8bac79d651 Add DeviceConfig flag for drag direction angle threshold for cursor drag
Bug: 160786691
Test: Manual and unit tests
  atest FrameworksCoreTests:EditorTouchStateTest
  atest FrameworksCoreTests:EditorCursorDragTest
Change-Id: Ib2e88fbdce4f901772d73bc7ee60483c98e02509
2020-08-04 11:31:38 -07:00
Joanne Chung
37277508e4 Delete useless log.
Bug: 154961272
Test: n/a
Change-Id: I94d99ca37797fbd0a38de5ac6ee8d9b59c3c670c
2020-08-04 23:17:12 +08:00
Adam He
5277e0781d Update docs to clarify how providers can create style bundles and Slices
for inline suggestions.

Fixes: 162437790
Test: atest android.autofillservice.cts.inline
Change-Id: If02b34ec7978897545c0b7eabfebb8db0b9417c0
2020-08-03 13:06:38 -07:00
Joanne Chung
15d7a2dfa8 Merge "Add TEST_MAPPINGs for autofill under widget" 2020-07-31 07:39:24 +00:00
Joanne Chung
6d0d111c6d Add TEST_MAPPINGs for autofill under widget
Autofill broken tests (b/159037010, b/159035197, b/152444221) that
weren't executed in presubmit. Add the fail tests into TEST_MAPPING
to make sure the tests can be tested in presubmit.

Bug: 154961272
Test: atest --test-mapping frameworks/base/core/java/android/widget
Test: atest --test-mapping
frameworks/base/core/java/android/widget/inline
Test: TreeHugger

Change-Id: I718c86d8f55234a330235672016c877986c30d54
2020-07-31 13:42:35 +08:00
Nader Jawad
8b56a38eb0 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference

BUG=161896447
Test: N/A

Change-Id: I2032595a163d9146cfdbaebb1714ad1c53e0157c
2020-07-29 17:24:22 -07:00