This fixes a bug where if the EditText view has or had focus and then
is removed from the layout and re-added the cursor does not resume
blinking.
There was a change several months ago that prevented the cursor from
blinking when the window is no longer visible. That change added a
check in shouldBlink to verify that the window is visible. This
created a situation where the window might not be visible when
makeBlink is called from onFocusChanged and as a result mBlink is
never instantiated. This resulted in the cursor not blinking after an
app starts. The fix was to call makeBlink again when onAttachToWindow
is called. The Window is visible at this point and the cursor blinks
as expected.
The reason the code change below is needed is in the case where a view
is removed and added back after the mBlink object has been
instantiated. A call to unCancel is needed to ensure that the cursor
resumes blinking as expected. This was identified in this change
aosp/2540031.
The change also guards against the window not visible case as outlined
above.
Bug: 278907680
Test: Added following CTS test:
testCursorResumeBlinking_AfterFocusedView_DynamicallyRemovedAdded
testCursorBlinking_ViewDynamically_RemovedAdded_NeverHadFocus
testCursorSuspendBlinking_ViewDynamicallyRemoved
testCursorNotBlinking_ViewDynamicallyAdded_NoFocus
testCursorBlinking_ViewDynamicallyAdded_WithFocus
(cherry picked from https://android-review.googlesource.com/q/commit:61d982884fa0e14dc5f58e872f182bb5c1b04afd)
Merged-In: I07afc7ef1a707549240479015a00a66db814afb7
Change-Id: I07afc7ef1a707549240479015a00a66db814afb7
Cherrypick from AOSP master to udc-dev.
* changes:
fix(non linear font scaling): recalculate proportional line height if they setTextSize() after setting line height
fix(non linear font scaling): preserve proportionality of lineHeight when non-linear font scaling is in effect
feat(non linear font scaling): add FontScaleConverterFactory.isNonLinearFontScalingActive()
Fixes: 266736911
VelocityTracker was being cleared when it hit the end
of the View, but stretch overscroll can be flung.
Test: ScrollViewTest
Change-Id: Iadeca98360dc5a5462bcefbdd266bca92c0b6d5a
This will only recalculate if both were set in SP, since that's the only
time the proportion calculation happens anyway.
Bug: 273326061
Test: atest cts/tests/tests/widget/src/android/widget/cts/TextViewFontScalingTest.kt
Change-Id: I41ad12cdef6f1b93b60deca039c9ab72bb59e39f
This ensures that the design intent is preserved when using large font
scales and non-linear font scaling: the line height proportions should
still match even when using SP units for both text size and line height.
If the dev does not define both textSize and lineHeight in SP units, we
don't do the corrective recalculation. Unfortunately, this could result
in cramped-looking text due to the lineHeight not scaling with text
size. There are linters to warn the developer of this though, so we hope
they do the right thing.
Bug: 273326061
Test: atest cts/tests/tests/widget/src/android/widget/cts/TextViewFontScalingTest.kt
Change-Id: I17f9b7c8d3e0e63deed4037ebf0e99b690bc694a
Upload the bitmap to GPU when the RemoteView intends to use it.
Test: Manually verified that widget drawing method is accelerated by
approximately 2 micro seconds. The longest drawing time down from 52 micro seconds to 47 micro seconds.
Fix: 226298376
Change-Id: If57f3127dfa0c01550c8388a43a79acac37fcfb7
This is so the TextView can properly calculate a proportional line
height when non-linear font scaling is in effect. Otherwise, a desired
2x line height at font scale 1.0 will not be 2x at font scale 2.0, due
to non-linear font scaling compressing higher SP sizes.
It also better mirrors the setTextSize() API.
The actual fix for calculating the proportional sizes will come in a
subsequent CL.
Bug: 273326061
Test: atest cts/tests/tests/widget/src/android/widget/cts/TextViewTest.java
Change-Id: I79d74ff4f5fe1886ca2ed9c4df708be484fd888f
The requestRectWithoutFocus boolean was introduced in ag/20641595.
Bug: 263152665
Test: Manual, i.e. verifying requestRectangleOnScreen is called when TextView is focused
Change-Id: I13e2856fc0488526fccb4ab5d945d1d983d7c4d4
When its caller is a visible background user using a non-ui context
(like the application context), the Toast must be displayed in the
display the user was started visible on.
Test: atest --user-type secondary_user_on_secondary_display android.widget.cts.ToastTest#testShow_whenTextToast,testShow_appContext_whenTextToast
Test: atest android.widget.cts.ToastTest#testShow_whenTextToast,testShow_appContext_whenTextToast # to make sure the "normal" case still works
Test: atest NotificationManagerServiceTest
Fixes: 273314058
Bug: 272376728
Change-Id: I0a28d20462900eb0437781ab26d520be824014d1
This CL reuses cut, copy, paste, select all and share icon.
This CL adds new undo, redo icon from Material library.
Bug: 240385199
Test: Manually done
Change-Id: Ia88452de436d36a1d5f2cbf44e55a61be866f894
It is almost dead code because
- It was added for SurfaceView using a child window.
But SurfaceView no longer uses a window for years.
- It only executes for 2 conditions:
- Main window
- For freeform, there was general change-transition which uses
a screenshot of window container to animate.
- For splitscreen, there is TaskOverlay to cover the change.
- Child window (from ActivityThread r.mPreserveWindow)
- Server side config change
Always no-op because config change will clear drawn state
and then WindowState#hasContentToDisplay return false that
skips setWillReplaceWindow.
- Client side calls Activity#recreate.
But it usually only causes a removal timeout because app
may not add the child window again.
So no case needs it anymore.
Bug: 163976519
Test: CtsActivityManagerDeviceTestCases
Change-Id: If78155ac453c02cda8bf448bb353061e861747fe
The added javadoc comment already exists in Toast's class level javadoc on line 75.
Bug: 265306493
Test: None
Change-Id: I5692db36461dae1f79a72eb2bb15d8379bd24a84
Also adds this as a boolean property for AccessibilityNodeInfo so that
accessibility services can query the property (for nodes visible to the
service) if they want to use it for behavioral changes.
Bug: 268509740
Test: atest AccessibilityNodeInfoTest (frameworks/base and cts)
Test: atest AccessibilityEndToEndTest
Change-Id: I05d30b1e709bde33b0f566210cd2513e3a566962
A remoteview shows an UI rendered by another app and allows starting
that app's Activity. Since that App probably does not possess BAL
permissions the App showing the RemoteView needs to grant its
permissions.
Bug: 269240329
Test: manual testing with feature enabled
Change-Id: Ic2ec605631654cead5cb6cf47c4d0125b0765b7a
(cherry picked from commit cbef1ced75)
At the moment apps need to support pressing "Enter" to search
differently if they want to support physical keyboard, as
currently no editor action is sent from it. This is a proposal
that will resolve that issue by sending that information.
Bug: 269672396
Test: built, flashed on device, confirmed pressing enter starts
the search
Change-Id: I1694303540295603097db2fd4e4206f1ca71cec0
This CL extract the common logic between ActionMode and ContextMenu and
put it to AssistantCallbackHelper.
Bug: 267984410
Test: atest TextViewContextMenuTest SelectionActionModeHelperTest
Change-Id: I82a1d4873cd34a250c920e91a88382b509a46adc
Deleting text inside a selection causes the selection to be updated
asynchronously, so setting the cursor position synchronously after the
deletion could get overwritten by the asynchronous update.
This is fixed by setting the cursor position before deleting the text.
Bug: 266984004
Test: tested manually
Change-Id: I8801cc0bc9d0a3acd7952e2a88691f480c58d453