instead of everytime visibility changes
> Adding a broadcast receiver makes a synchronous system API call
which can delay draw pass
> Also removing TIME_TICK broadcast, instead using an internal timer
to aboud unnecessary calls while app is stopped
Bug: 188574817
Test: Manual
Change-Id: I37677aa40189bf4fb75e7e2372bda81ea3e6fda3
If an application caches an ApplicationInfo and uses it to call
Context#createApplicationContext, the app will not get the most recent
version of the overlays for that application. To make things worse, the
LoadedApk stored in ActivityThread#mResourcePackages is updated using
the old ApplicationInfo causing further uses of the cached LoadedApk to
return outdated information.
Deprecate Context#createApplicationContext, convert all internal uses
to Context#createPackageContext(String packageName, ...) and log
whenever any one calls Context#createApplicationContext with an
outdated ApplicationInfo to detect debug issues in using old infos.
Bug: 188059515
Test: change wallpaper and observe widgets get reloaded with most
recent overlays
Change-Id: I2aeefa8c0e66264859109975a54c4f73f76ad710
Screen reader(Talkback) will read content description first if the
developers set. We only translate TextView text, this may cause the
screen reader will not read the translated text if the developers set
content description.
To fix the issue, we also send the content description to translate.
When the translated text is shown, we also set content description
with translated content description and reset to original content
description if show original text.
Bug: 187134784
Test: atest CtsTranslationTestCases
Change-Id: I6986384260627a0539780b7293d47666c442d852
Fixes: 158448787
When the day is earlier in than the minimum date, but
the year is later, then the year is changed, the date
gets set to a day that is earlier than the minimum date.
This CL ensures that the year change can't bring the
date outside of the range of minimum to maximum dates.
Test: manual testing
Change-Id: I0034bd513275267ecf9554f673533852e68dd854
This addresses rounding of the seconds hand fraction to avoid
advancing by inconsistent amounts.
It also moves to a less janky 30FPS update rate.
This also optimizes seconds ticking to only schedule callbacks as needed
and avoids spurious updates to the content description.
Also, potential NPE fix and dead code removed.
Bug: 186099601
Test: Local testing with sample app
Change-Id: I771b4c3f1d18f7836cd42202810a1495d25a9db5
A ClipData can contain multiple items, for example:
```
ClipData clip = ClipData.newPlainText("label", "ONE");
clip.addItem(new ClipData.Item("TWO"));
clip.addItem(new ClipData.Item("THREE"));
```
When a clip like this is pasted, the TextView impl inserts a newline
between each item. When the same clip is inserted via drag-and-drop,
no newlines are inserted.
This change makes the behavior of drop and paste consistent by updating
drop to match the paste behavior (since pasting has been around longer
and is more common).
Bug: 187428338
Test: atest CtsWidgetTestCases:TextViewReceiveContentTest
Change-Id: I08f30e619b858a4586ab9b4ed287be28b218231e
This ensures that adapters have their caches filles and other benefits
such as lists maintaining their scroll positions
Bug: 183503469
Test: validated with local app that service is not called on drag for
colors changing and that flicker is removed
Change-Id: I043d1d7a547b012f7a12eb555b35854a9bb7109b
Bug: 186430321
ListView should accept a fling while stretching.
Test: New test
Test: manual testing
Change-Id: I67221e06818d9953882e16d1c72f2d9e6b191ebb
--Updated HWUI holepunch logic for SurfaceView to
also apply the stretch to the hole punch
--Updated RenderNode callbacks to also include
an offset from the ancestor RenderNode that also
has a stretch configured on it
--Added new test activity to verify hole punch
logic
Bug: 179047472
Test: manual
Change-Id: Ibbaf8248a31839ba9dc352ecb9fef54e1276918e
Bug: 186430321
EdgeEffect was restarting the fling from the start if onAbsorb()
was called after onPullDistance(). This CL does not reset
the distance in onAbsorb().
Test: new test
Change-Id: I0657059c275f42cfe229a3aaa8bf37c87e0394f1
Fixes: 186758538
Relnote: "Removes edge effect type from the API -- EdgeEffect now
supports only stretch edge effect for all applications."
Test: existing tests, modified to work with stretch
Change-Id: Iec7a9d4a0316ff3ba7297c4565bb881a1adcf949
Bug: 186430321
ScrollView and HorizontalScrollView was not allowing a fling
effect while overscrolling. This adds the ability to fling
while overscrolling.
Test: new test
Test: manual ApiDemos
Change-Id: Iebd402ff0f5b6f16518ecc5403e085cb58de5976
Bug: 185906621
During overscroll animation, there is no need to call
disallowInterceptTouchEvents(). This removed the
call so that parents can intercept touch events.
Test: Ia9ac6d81a5b60222f489ea87f31ecba0c1d48cea
Test: manual testing
Change-Id: Ie5d9428d95b86d7a976c2f3c519547151a45cec5
This is a follow up to our previous CL [1], which added initial
surrounding text support into EditorInfo and let TextView support it.
What we overlooked was that calling TextView#setText() would trigger
TextView#onCreateInputConnection()
before TextView#mText is updated to the new value. As a result,
EditorInfo is initialized with a stale surrounding text information.
With this CL, EditorInfo will correctly be initialized with the new
text specified to TextView#setText().
One complicated thing in this CL is InputMethodManager also has some
issues about how to drop spurious
InputMethodService#onUpdateSelection()
while InputConnection is being replaced with a new instance. I ended
up having to introduce a hacky boolean
Editor#mHasPendingRestartInputForSetText
to work around this in the TextView/EditText. This workaround is
expected to be removed/revisited as part of Bug 186582769.
[1]: Ie04f2349b1157408aa8ed9044aea12ce99132cb4
c486acc4d2
Fix: 161330778
Test: atest CtsInputMethodTestCases:EditTextImeSupportTest
Change-Id: Iee3b754eea319861b2eb955d6cc95ba13006b55e
Test: Ran locally on device, all sample widgets still worked
Test: atest RemoteViewsTest
Bug: 185316709
Change-Id: I60c235ea196dd106325e79962e545c582a975168
When the magnifier content moves relative to the parent surface,
it will call setPosition on the content surface control. This conflicts
with position updates called by the BlastBufferQueue adapter
causing a flicker on screen. Fix this by providing a wrapper surface
to BlastBufferQueue adapater to send buffer updates.
Fixes: 186072574
Test: Select text and see magnifier surface does not flicker or move
around
Change-Id: Idfcc06a5d90f400f69e5cbe91008a0cb59fd4646
Fixes: 184892316
Changed the animation termination epsilons to make sure
that the animation doesn't end early and cause a jerky
end.
Test: visual inspection
Change-Id: I56e4ccb50cee95e713e92ffb659eff4dd026dd12
The test config takes longer than 15mins to run. Move it to a dedicated
group for running slow presubmit Test Mapping test.
Some more context is in the referenced bug, e.g, b/174495337
The group will work exactly the same as presubmit for now.
Bug: 174654670
Bug: 174495337
Test: none
Change-Id: I946061e2c5a75b12ca370d172db32a8f7e8e8f68
Some apps operate on the view text based on layout calculations made on
the transformed text. This can cause issues (even crashes) if the
transformed text is longer than the original, as is often the case with
Translate. A previous temporary fix,
I685ae4a9752c817db81f0d736f1d746b2e4a9839, ellipsized the translated
text. This change fixes it properly by instead padding the original
text.
A followup change will make this controllable by API instead of padding
every TextView.
The en space character, U+2002, is used for the padding here. It seems
to work well in practice for multiple languages. We don't make this
configurable through API as it could make debugging harder (issues
triggered by server-side changes).
Bug: 179693024
Test: atest CtsTranslationTestCases
Test: manual - toggling between original and translated, scrolling, new
views appearing, multiple apps
Change-Id: I9d7db5d2bc200e4042baf3267796f00cfc298f19