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
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
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
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
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
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
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
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
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
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
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
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
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
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
- 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
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