Revert "Add test checking view recycling is always tested"
Revert submission 16149646-betterRecycling
Reason for revert: Droidfood Blocking Bug: 205503898
Reverted Changes:
Ib01c511e4:Always check if the view can be recycled.
If11dcd323:Add test checking view recycling is always tested
Change-Id: Id08d5ea3602d9d3ca03e148e57a9f97435534e2c
Previously, the recycling was only checked for multiple layout, as it
was assumed the AppWidgetHostView would make the basic check. However,
adapters views (e.g. ListView, ...) do not make any recycling check,
instead relying on caching using the Layout id. The caching cannot be
changed as it is common to other parts of Android.
This CL ensures the view can be recycled when reapplied, always.
Bug: 181985606
Test: atest android.widget.cts.RemoteViewsRecyclingTest
Change-Id: Ib01c511e4a793cce1519157aea06e194a2d8f855
When implementing the code, it seems this was forgotten :( If the view
id of the root of the RemoteViews is changed, currently, the top-level
view will be re-used, which is an error.
Bug: 181985606
Test: atest android.widget.cts.RemoteViewsRecyclingTest
Change-Id: I5a8addb08f597ec574e3ed49d1318771e4c7c767
The check has to be done in RemoteViews and in AppWidgetHostView right
before creating the context used to inflate the app widget. Further, the
APK is cached potentially in two places: in the APK with code and the
APK without codes, so both places are updated if present.
Test: manual, see bug for details
Fix: 202369942
Change-Id: I5718f67711a3332a942d3c037eef7f30379549a4
It is possible the developer calls pauseTranslation() to show the
original text but it calls startTranslation() to show translated
text. Ideally the developer should call resumeTranslation but it
also make sense to call startTranslation() to show translated text.
When receiving translation response, we avoid showing transaltion
if the view already has the response and it's the same. But it is
good to also check if the view is showing translated text or not.
If the view is not translated text, it is possible developer calls
startTranslation() instead if calling pauseTranslation() to show
translated again, the fixing can resolve this case.
The issue case can be fixed by this change. But there is a deeper
problem about it's useless the caller call finishTranslation(). This
is planned to be fixed in next release.
Bug: 201238016
Test: manual. The issue case is fixed.
Test: manual. Test some chat apps, it still works fine.
Test: atest CtsTranslationTestCases
Change-Id: I699d0fa1d60ac96db094adcc6e17f4203df03214
It is possible the existing text is changed that triggers a new
translation. We cache the translation response when onShowTransltion
is called. We should keep the translation response is updated if this
is a new translation result.
Bug: 200232741
Test: atest CtsTranslationTestCases
Test: manual. The issue app works fine.
Change-Id: Iaf7423cd35d4484e33de84e478256b77a000f390
This is important to ensure sub-contexts know the user id used to create
the current context, or when using a work profile, a new context will be
created each time.
Fix: 197761162
Test: Manually with hand-made app widget
Change-Id: Ifb4a6dad152acbd2b2853ba8bf5cf1e131d55394
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
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