Commit Graph

9333 Commits

Author SHA1 Message Date
Haoyu Zhang
b989691d71 Scribe in View: disable cursor drag when handwriting is enabled
Bug: 224587325
Test: manually tested
Change-Id: I607c0d9b71cb6cfd69704d850a2d3e00745c3fb4
2022-03-16 23:02:09 +00:00
TreeHugger Robot
e8acb4a612 Merge "Update the text wrapping API." into tm-dev 2022-03-14 23:09:41 +00:00
James.cf Lin
396c789426 Update the text wrapping API.
1) Update the LineBreakConfig class to be immutable.
2) Do not return null in the PrecomputedText.Params#getLineBreaiConfig API

Bug: 216638444
Test: atest TextViewTest; atest MeasuredTextTest; atest PrecomputedTextTest; atest TextViewPrecomputedTextTest; atest StaticLayoutLineBreakingVariantsTest
Merged-In: I93bcb6ebc35344e34e9bb8a24df375aa7b3a8d81
Merged-In: I07766137ff6639c7d4acaad07dbcf11a2841cdb0
Change-Id: I07766137ff6639c7d4acaad07dbcf11a2841cdb0
2022-03-10 09:58:40 +00:00
Taran Singh
a28f53b00d Merge "Use local coordinates in CAI#EditorBoundsInfo" into tm-dev 2022-03-10 08:06:26 +00:00
yingleiw
a3a06ac231 Rename ACTION_SHOW_SUGGESTSIONS TO ACTION_SHOW_TEXT_SUGGESTIONS
Fix: 217730256

Bug: 222537368

Test: Added test in EditTextTest (will merge later when reviewed).

Merged-In: I78354a0f1d955c5b7c1ead044ea49086b3479841
Change-Id: I78354a0f1d955c5b7c1ead044ea49086b3479841
(cherry picked from commit e1f392d171)
2022-03-04 16:42:54 -08:00
Julia Tuttle
1c472e50c9 RemoteViews: don't crash on null display in getLaunchOptions
While we investigate the root cause of this bug, turn the crash into a
warning.

Bug: 218409359
Test: none; we don't have repro steps for the bug yet
Change-Id: I6d699ea839726adc634a200a0057e316d59ecaa9
(cherry picked from commit 827d967199)
2022-03-04 19:45:27 +00:00
Chavi Weingarten
5dcd46d356 Merge "SurfaceView: Synchronize all surface view changes with VRI draw" into tm-dev 2022-03-03 17:57:05 +00:00
Taran Singh
25854407be Use local coordinates in CAI#EditorBoundsInfo
EditorBoundsInfo uses local coordiantes, it was mistakenly set with
screen coordinates

Test: atest InputMethodServiceTest
Bug: 217957587

Change-Id: Iadeaa793d1331b6208e4b19036c45120b0185f64
2022-03-03 17:47:01 +00:00
Vishnu Nair
797aa0066c SurfaceView: Synchronize all surface view changes with VRI draw
Re landing with the following changes:
We initially cloned the SurfaceControl handle to avoid locking when
accessing the SurfaceControl from the position listener callbacks
running from RT workers. But this meant the last reference to the
layer handle would only be released by GC. If SurfaceViews are
created and destroyed rapidly, we would be at the mercy of GC to
release buffers.

Original change:

There are three transaction queues that can submit SurfaceView
changes.

1. Buffer updates via BBQ apply token
2. SCC apply token
3. ViewRootImpl BBQ apply token

It makes sense for most SurfaceView changes to be synchronized with
ViewRootImpl draws since the caller can optionally synchronize the
change with main window content.

This change eliminates the tmp transaction that is applied directly
via the SCC apply token and instead applies them with the ViewRootImpl
draw transaction.

Also take the opportunity to scope down mSurfaceControlLock usage.

Test: atest SurfaceViewSyncTest
Test: go/wm-smoke
Test: run mem tests via forrest
Bug: b/217973491, b/221631942
Change-Id: Idba712d146e62d7346920dc4f060cba92d47fada
2022-03-03 16:07:15 +00:00
TreeHugger Robot
33a2b4bacd Merge "Incorporate API feedback: CAI requestCursorUpdates()" into tm-dev 2022-03-03 13:27:04 +00:00
TreeHugger Robot
1f014a4a51 Merge "Revert "SurfaceView: Synchronize all surface view changes with V..."" into tm-dev 2022-03-01 23:50:49 +00:00
Taran Singh
472e5c3825 Incorporate API feedback: CAI requestCursorUpdates()
1. Use intDef for CurosrUpdateFilter
2. overload requestCursorUpdates(mode, filter)
3. additional details in javadoc

Fix: 218314883
Bug: 210039666
Test: atest CtsInputMethodTestCases

Change-Id: I1dc5acac4f968b2a2d1780f2ee6c0145c7dcbbaa
2022-03-01 19:05:50 +00:00
Vishnu Nair
8dfd38ad76 Revert "SurfaceView: Synchronize all surface view changes with V..."
Revert "SurfaceView:  Avoid destination frame updates on multipl..."

Revert submission 16944940-sv-changes-tm-dev

Reason for revert: b/221631942
Reverted Changes:
I0d214e3f7:SurfaceView:  Avoid destination frame updates on m...
I0b5741b37:SurfaceView: Synchronize all surface view changes ...
I5226c304b:SurfaceView: Avoid destination frame updates on mu...

Change-Id: I35b7c1be7202ebe89a5309284a9401c8084e9d79
2022-03-01 18:55:13 +00:00
Vishnu Nair
7da5f02dc9 Merge changes from topics "cherrypick-sv-changes-8cq54jfvx9", "sv-changes-tm-dev" into tm-dev
* changes:
  SurfaceView: Synchronize all surface view changes with VRI draw
  SurfaceView: Avoid destination frame updates on multiple threads 1/2
2022-02-24 23:18:22 +00:00
Treehugger Robot
c88c4359bb Merge "Add pasteAsPlainText in some documentation where it is missing." am: f7ee046cd6 am: 9317b1ce92 am: 428d587d1f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1994510

Change-Id: I6c87c09b7d652d5f122c2b6d321fe019afc8908f
2022-02-22 18:53:13 +00:00
Treehugger Robot
9317b1ce92 Merge "Add pasteAsPlainText in some documentation where it is missing." am: f7ee046cd6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1994510

Change-Id: I4ca1cde07b1b92f6ed70443e72509ba3975504e4
2022-02-22 18:10:33 +00:00
Arthur Milchior
e33dd38c11 Add pasteAsPlainText in some documentation where it is missing.
I discovered this error in documentation while I needed to capture "PasteAsPlainText" in an android app. 
I suspect it might be missing in other folder too, but I’m not familiar enough with Android to be sure

Change-Id: I77af9b06eb602c4ba60b0744cc02f7449bc4f500
2022-02-22 12:20:54 +00:00
Vishnu Nair
6011059ed0 SurfaceView: Synchronize all surface view changes with VRI draw
There are three transaction queues that can submit SurfaceView
changes.

1. Buffer updates via BBQ apply token
2. SCC apply token
3. ViewRootImpl BBQ apply token

It makes sense for most SurfaceView changes to be synchronized with
ViewRootImpl draws since the caller can optionally synchronize the
change with main window content.

This change eliminates the tmp transaction that is applied directly
via the SCC apply token and instead applies them with the ViewRootImpl
draw transaction.

Also take the opportunity to scope down mSurfaceControlLock usage.

Test: atest SurfaceViewSyncTest
Test: go/wm-smoke
Bug: 217973491
Change-Id: I0b5741b376e042537c37ec34644e0a048eb4bfe0
2022-02-19 00:12:43 +00:00
Joanne Chung
5c1e5f7193 Merge "Update team OWNERS file." am: e96070ac89 am: 114d0c7773 am: 1bb2f28548
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1982066

Change-Id: Ic8c77290b4d8e2d6cf8353a793b75cf71990a7a1
2022-02-16 05:24:07 +00:00
Joanne Chung
114d0c7773 Merge "Update team OWNERS file." am: e96070ac89
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1982066

Change-Id: I50a93d3e190ba2a4988e0777be2c5e571f2a2760
2022-02-16 04:42:57 +00:00
Joanne Chung
e96070ac89 Merge "Update team OWNERS file." 2022-02-16 02:03:49 +00:00
Xin Li
a6a261b1be Merge "Merge sc-v2-dev-plus-aosp-without-vendor@8084891" into stage-aosp-master 2022-02-14 17:30:12 +00:00
Joanne Chung
b00f0d6c95 Update team OWNERS file.
Bug: 177641730
Test: n/a
Change-Id: If4ecc7326dc229d8807e1497c5e3e2ef0637680f
2022-02-14 14:51:12 +08:00
Xin Li
5ad6db7742 Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I8cfa435bb6233818adb9cc99dadeeb06a03443d5
Change-Id: Ib93992d88fd1704179009a3872798b9e7b83a6d1
2022-02-11 07:25:43 +00:00
Haoyu Zhang
e96b638348 Merge "Scribe for View: handwriting initiation for unfocused" 2022-02-10 22:45:53 +00:00
Tony Mak
cfa26a0ae7 Fix the empty selection issue when onCreateActionMode returns false
One of the optimizations ag/12911059 did was calling
SelectionModifierCursorController.show() before
startActionModeInternal(). The rationale was that if we start the action
mode first, SelectionModifierCursorController.show() would end up
invalidating the action mode twice unnecessarily, once for each handle.

However, with this optimization, we are calling
SelectionModifierCursorController.show() even when onCreateActionMode
returns false.

Reverted this particular optimization to fix the issue.

Added a test which was failing without this fix but passing with it.

Fixes: 199380016
Fixes: 214341747
Test: atest TextViewActivityTest

Merged-In: I793f76a23978cbbbbde2d16e8a522615174bcdd5
Change-Id: I793f76a23978cbbbbde2d16e8a522615174bcdd5
(cherry picked from commit 11bd644822)
2022-02-10 20:09:46 +00:00
Haoyu Zhang
f0404bd4c3 Scribe for View: handwriting initiation for unfocused
Bug: 211763729
Test: atest FrameworksCoreTests:HandwritingInitiatorTest
Test: atest FrameworksCoreTests:HandwritableViewInfoTest
Test: atest FrameworksCoreTests:HandwritingAreaTrackerTest
Test: manually test
Change-Id: Ica9ee82cf1dc41feb5e4ff0f52ee13c1e4de8ad4
2022-02-10 10:28:14 -08:00
TreeHugger Robot
b75096f84f Merge "Recycle obtained TypedArrays" 2022-02-10 18:18:11 +00:00
Alan Viverette
7d1188244c Merge "Migrate frameworks/base javadocs references to androidx" 2022-02-10 18:02:28 +00:00
Nikolas Havrikov
0a19db4500 Recycle obtained TypedArrays
Bug: 218835043
Test: make
Change-Id: I34f53b8767b34b77a8a8246e9d3863854477feb6
2022-02-10 14:52:37 +01:00
Alan Viverette
406e0f6553 Migrate frameworks/base javadocs references to androidx
Does not remove Support Library artifacts from docs classpath (ApiDocs.bp)
because they are still used in development/samples, which is not as easy
to migrate as javadoc.

Bug: 158779503
Test: make docs
Exempt-From-Owner-Approval: Mass find/replace for androidx migration
Change-Id: Icf7f53ec36a0e970413352e2ebf40ce9d60ed17e
2022-02-09 22:25:14 +00:00
Sally Yuen
4c286e7ddf Merge "fix TextView a11yNodeInfo isTextSelectable" 2022-02-09 17:59:26 +00:00
TreeHugger Robot
018ffd309d Merge "Fix the empty selection issue when onCreateActionMode returns false" 2022-02-07 20:30:23 +00:00
Lucas Dupin
ecfb379e5e Do not relayout when changing to Marquee
The text field size won't really change, so there's not reason to
remeasure and relayout. This saves us up to 48 measure steps when
unlocking the device.

Test: https://ui.perfetto.dev/#!/?s=519ae4c7f943f3ebad09eae63e445112c1d4286dd8376e18e69d713f1a9c2
Bug: 210432290
Change-Id: Ie3b7e0f7e942aac23605e2588cf6b942d507588f
2022-02-04 09:49:43 -08:00
sallyyuen
889a5ab0f7 fix TextView a11yNodeInfo isTextSelectable
info.TextSelectable needs to also check isTextEditable for edit texts.
Bug: n/a
Test: atest AccessibilityTextTraversalTest

Change-Id: Ic8d5a04db05f0cc4856997ecf5d5c51bc8d16da2
2022-02-03 13:36:55 -08:00
Sally Yuen
3e01ab61ea Merge "Add AccessibilityNodeInfo.isTextSelectable" 2022-02-01 21:58:55 +00:00
Tony Mak
11bd644822 Fix the empty selection issue when onCreateActionMode returns false
One of the optimizations ag/12911059 did was calling
SelectionModifierCursorController.show() before
startActionModeInternal(). The rationale was that if we start the action
mode first, SelectionModifierCursorController.show() would end up
invalidating the action mode twice unnecessarily, once for each handle.

However, with this optimization, we are calling
SelectionModifierCursorController.show() even when onCreateActionMode
returns false.

Reverted this particular optimization to fix the issue.

Added a test which was failing without this fix but passing with it.

Fixes: 199380016
Fixes: 214341747
Test: atest TextViewActivityTest

Change-Id: I793f76a23978cbbbbde2d16e8a522615174bcdd5
2022-02-01 20:47:26 +00:00
Siyamed Sinir
6cac243d33 Merge "Minor JavaDoc grammar fix" am: 86e1a45b56 am: fa264ae28b am: f1cbfa73ab am: 9a191546d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1964582

Change-Id: If44741849325764b37143eaa1016e201aab8a51f
2022-01-31 17:14:27 +00:00
Siyamed Sinir
9a191546d1 Merge "Minor JavaDoc grammar fix" am: 86e1a45b56 am: fa264ae28b am: f1cbfa73ab
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1964582

Change-Id: Ic147bc3d061f0906be7a74705414fe60c9aca0b9
2022-01-31 16:56:12 +00:00
Ian G. Clifton
bae29e0bc1 Minor JavaDoc grammar fix
Replaced "than" (comparative) with "then" (temporal) for the setTextSize JavaDoc. No functional change.

Change-Id: I84b5d1b250cb7a5d925cfbd0a86a2bfef55ade24
2022-01-29 01:37:43 +00:00
sallyyuen
bd0e5becea Add AccessibilityNodeInfo.isTextSelectable
ACTION_SET_SELECTION is needed on all TextView nodes to reset the
cursor. But some non-edit texts are selectable and need to be
identified by a11y services. ACTION_SET_SELECTION has been on these
nodes for years so to avoid the complexity of breaking this, add a
node property.

Services should use ACTION_SET_SELECTION for nodes where
property=true

Bug: 62058901
Test: atest  AccessibilityTextTraversalTest, TextViewTest cts and
core (TextViewTest#testCutShouldNotThrowException keeps failing but
it's unrelated to this change)

Change-Id: Ia825dd806824e663e7fa7d274f51c6bf44f0c2c4
2022-01-28 16:53:53 -08:00
Willie Koomson
35641ae2c0 Propagate apply flags to nested RemoteViews
This change propagates FLAG_WIDGET_IS_COLLECTION_CHILD and
FLAG_USE_LIGHT_BACKGROUND_LAYOUT to nested RemoteViews (either added by
addView, or set as portrait/landscape/sized RemoteViews) if that flag is
also present on the parent RemoteView.

For FLAG_WIDGET_IS_COLLECTION_CHILD, this prevents a PendingIntent from
being set on a RemoteView that is a child of a collection item RemoteView.

For FLAG_USE_LIGHT_BACKGROUND_LAYOUT, this ensures that nested
RemoteViews use their light background layout if this is set on the
parent.

Bug: 214288099
Test: RemoteViewsTest
Change-Id: I8da92d0d338631a99ee718a136bf9674827437bb
2022-01-27 22:43:45 +00:00
Willie Koomson
3a83f0e9a9 Make setRemoteAdapter() work for nested RemoteViews
This change adds applyNestedView() and reapplyNestedView() to
RemoteViews. This makes it possible to pass the top-level
"rootParent" view (usually AppWidgetHostView for widgets) to nested
RemoteViews that are added by addView(). This allows setRemoteAdapter
actions to work properly when they are used in nested RemoteViews.

Bug: 214288099
Test: RemoteViewsTest
Change-Id: I4fa3fe98d89bffdc0a5be46dabed12b9c217219e
2022-01-27 22:43:27 +00:00
TreeHugger Robot
4c4cd6f670 Merge changes from topics "CAI-filters", "onPrepareStylusHandwriting"
* changes:
  Scribe in IMF: Introduce filters in CursoAnchorInfo API 7/N
  Scribe in IMF: Early InkWindow preparation 6/N
2022-01-27 10:32:06 +00:00
Calvin Pan
2801e6de4f Merge changes Ib484fc0c,I2b9ff69c,I0a31b117,I888c65c8,I03723cfe, ...
* changes:
  Clean <plurals> in DateTimeView
  Clean <plurals> in CertificateMonitor
  Clean <plurals> in FillUi
  Clean <plurals> in BugreportProgressService
  Clean <plurals> in keyguard
  Clean <plurals> in ChooserActivity
  Clear <plurals> in TextUtils
  Clean <plurals> in FindActionModeCallback
  Clean <plurals> in ZenModeConfig
  Add util class for plurals
2022-01-27 06:31:58 +00:00
Taran Singh
7fbcbf27c7 Scribe in IMF: Introduce filters in CursoAnchorInfo API 7/N
New filter modes for InputConnection#requestCursorUpdates(mode) to allow
partial data in cursor/anchor updates.
Selective data helps with speedy CursorAnchorInfo updates.

Test: atest InputMethodServiceTest
Bug: 203086136

Change-Id: Ibba06e9a2533ca91c5cc215dfb18d21c9a74fb73
2022-01-26 15:41:27 +00:00
Calvin Pan
e4692b7cae Clean <plurals> in DateTimeView
Bug: 199230228
Test: make
Change-Id: Ib484fc0c59f7900b751f4e782dd67c000cc855bb
2022-01-26 11:55:11 +08:00
Pierre Barbier de Reuille
25cffbf7ea Merge "Deprecate RemoteViews showNext/showPrevious" 2022-01-25 09:12:35 +00:00
James Lin
b0429656ad Merge "Add line break word style parameter in the LineBreakConfig" 2022-01-24 17:27:12 +00:00
Abodunrinwa Toki
91c2178139 Merge "Ensure that "smart" actions are shown in Talkback." 2022-01-24 08:22:19 +00:00