When a view is partially visible on the screen, ContentCapture reports
only the visible portion (+ a few additional lines). The offsets
calculated for this can be out of bounds if the view's displayed text
is longer from the original text.
Fix: 196414491
Test: manual - translate app to lang with more characters and trigger
a relayout (by scrolling for an app with ListView)
Test: atest CtsContentCaptureServiceTestCases
Change-Id: Iae98133c48cc67a0b00f1b0ab8b93e5adb293423
If the user of QuckContactBadge widget do not assign extras,
widget will create one, wrappter URI data in it and use this extra for
all requests,if multiple click events happened in short time it may
cause a bug as the first query finished and URI data will be removed
from extras, but the next query already sent, so when the second query
complete, there is no URI in extra and result in null pointer exception.
Don't remove the URI from extra directly,but copy the extra to
another one and send it out after remove the URI, so the URI null
pointer exception wouldn't happened anymore.
Change-Id: I4ef56d29883f79f115e4b9523ced0abfd0978fd7
Bug: 195089668
When Runtime Resource Overlays (RROs) are applied to an application,
the ApplicationInfo of the app in package manager is updated to have
overlay paths. Widgets create the context used to inflate their
remote views using a snapshot of the ApplicationInfo of the widget
provider. This snapshot is taken when the widget RemoteView is
initially created and sent to system server.
This change updates the snapshot of the widget provider ApplicationInfo
with the new overlay paths and notifies apps hosting widgets to
re-inflate their remote views in order to have RROs apply to widgets
correctly.
Bug: 193866093
Test: Repeatedly change wallpaper & style color to a "basic" color
and go back to launcher to observe overlay correct color is
applied
Change-Id: I0b9b8c0d32d83a52e9ea5bc8ba1635cf99e4b921
Allows you to use the (deprecated) AnalogClock widget to
display times other than the current system clock time.
While we're at it, update the AnalogClock widget assets to
contemporary vector drawables.
Bug: 177962166
Test: atest AnalogClockTest
Change-Id: I69e9e89b8f42030e910086ee79bb5a447a00bb84
Bug: 192465706
Stretch overscroll was allowing pull distances beyond 1, but
the effect only applied until 1. This meant that as the stretch
relaxed, it would appear stopped at 1 until it dropped below 1.
This CL does two things. First, it limits the pull distance
to 1, so that if it is pulled beyond 1, the distance remains
1 and the spring will immediately retract from 1 with onRelease().
Second, when the fling hits 1, it stops the fling animation and
immediately begins retracting from a velocity of 0.
Test: new tests and manual testing for visual effect
Test: I23cd8990fff24dbef36a93c16c115948d774a557
Change-Id: I06f1533aed0ce24756c535789fdcc7e99c5bfb9b
This reverts commit cb5a80ea57.
Reason for revert: Was not the cause of the test failure
Fixes: 186622527
Test: atest FrameworksCoreTests:ContextTest
Change-Id: I705854f080200f0465d94a7754e710f05a3ec92c
Notify Content Capture with the text changed event when deselected.
Bug: 184311217
Test: manual
1.long press trigger selection, event is sent.
2.drag selection indicators, send event after the drag is done.
3.deselecting, event is sent.
Test: atest CtsContentCaptureServiceTestCases
Change-Id: I3d05b8e798bfb5b213817b36f163aab0a688bdf4
We enable the logs dump in debug rom, we should only dump logs when
the debug flag is on.
Bug: 182433547
Test: Make sure the flag is disable after test and enable during test.
Change-Id: I0a719ee9c545b4e66f3414d7f57f3d959004071e
Also, handle this config value being set to 0 by hiding the seconds hand
and ticking once per minute.
Bug: 191269485
Test: locally
Change-Id: Ib2b705437d570d46328174d618ec0de6193212ca
Fixes: 190475978
Damped spring animations asymptotically approach their destinations.
The final pixels can take many frames to complete, but stopping them
means that we get a disruptive jump in those final pixels.
This CL detects when the edge effect animation is close to the finish and
completes the animation with a linear velocity that matches a
common velocity at 8 pixels distant. This means that the animation
terminates quicker so that touch events directed at the contents
after the animation completes (e.g. taps) can interact with the contents
soon.
The CL also adjusts the delta for detecting zero in the stretch
animation as it was jumping by a pixel or more at the end of an otherwise
smooth animation.
Test: manual testing for the visual effect
Change-Id: Ie249b0265c5c5939b597668d5afe4f76d0430821
The fail will only be found in the release build, we put the return
in the wrong place.
Bug: 189359744
Test: local disable flag and TextViewTranslationTest pass.
Change-Id: Idd377145b3757abaf528a90a25b6c73e9940f9f8
The ContentCapture service is interested in the selection changes.
When the selection was changed, notifies a text changed event to
ContentCapture.
Bug: 184311217
Test: manual
1.long press trigger selection, event is sent.
2.drag selection indicators, send event after the drag is done.
Test: atest CtsContentCaptureServiceTestCases
Change-Id: Ie45f617b132bc240b6cf61ee7ebc3041275f1694
Keep onTranslationResponse() only to save TranslationResponse. We can
move set TransformationMethod logic to TextViewTranslationCallback.
With the current implementation, if the developers overrides
onTranslationResponse(), they don't have a chance to use the TextView
default ViewTranslationCallback implementation because they don't set
the TranslationTransformation, they must implement their solution. If
we move logic to TextViewViewTranslationCallback and the developers
only overrides onTranslationResponse(), they still have a chance to
use the default TextViewViewTranslationCallback if the developers set
the TranslationResponse for View.
Bug: 178353965
Test: manual to make sure translation still works.
Test: atest CtsTranslationTestCases
Change-Id: Iada7f3efbbc7705ecf962c78e275ed942816707f
Sending the notification from the InputConnection layer reduces the
number of events that are handled (merged) by ContentCapture. We are
also able to handle composing span being removed; at the TextView layer,
we cannot do that as we don't know if the composing span will be added
back, which happens on typing).
Bug: 184311217
Test: manual - append chars, delete chars, replace text, move cursor to
composing text, move cursor to remove composing span, drag cursor
Test: atest android.contentcaptureservice.cts.LoginActivityTest
Change-Id: I0e9d153cf7ba2734f38cb1b6044eb7b670fb34ad
Potential NPE was added in ag/14881530
Fix: 190353630
Test: locally with sample app with and without items
Change-Id: I946b6b6719600cb638db1b15d74a8c3af6587f32
This gets called even when the view is not visible, which is bad for
performance. I've adapted the existing tick framework to handle ticking
for minutes when there aren't seconds in the format.
I verified the correct behavior with sample apps with and without
seconds in the format, including across DST time changes.
Fix: 190467448
Test: locally with sample apps
Change-Id: I75fed5c9d162b5361c31fe22d057a007db0ce75c
The TIME_TICK broadcast was removed as it's bad for performance to use
it while the view is not visible and adds unneeded overhead.
Instead we can use the internal handler callback scheduling method.
Bug: 190274204
Test: verified locally with app, including across DST time skip
Change-Id: I4eb5e64b16c953baf473331dc7d498de19cfdbc9