Commit Graph

9117 Commits

Author SHA1 Message Date
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
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
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
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
Jeff DeCew
c6136c2959 Merge "Fix crash in RemoteViews w/ Bundle due to Parcel.allowSquashing" into sc-v2-dev am: 88cccabf2b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16553366

Change-Id: Ib2bed18a6dd1f7b0a872aabb6a8ca9bcf3ac9f4e
2022-01-05 19:54:56 +00:00
Jeff DeCew
a28572eb9d Fix crash in RemoteViews w/ Bundle due to Parcel.allowSquashing
This fixes a failing CTS test, NotificationTemplateTest.

Fixes: 207741735
Bug: 212731590
Test: atest NotificationTemplateTest
Change-Id: Ide0241121d0824a2ba8c721c968e39f3c627f79d
2021-12-30 16:45:17 -05:00
TreeHugger Robot
80bad32262 Merge "Release stretch overscroll when new items are added." into sc-v2-dev am: f0786d5d90
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16468159

Change-Id: Ib03a37982c6921d0325f1fea2e03c8b50bf305c3
2021-12-15 01:15:38 +00:00
George Mount
aab9304c6a Release stretch overscroll when new items are added.
Bug: 206526994

When items are added to a ListView, any current stretch
should be released and a new touch should scroll and not
stretch.

Test: new tests. manual test
Test: If426eddf2e582169090e5e5e5694668c583288dc
Change-Id: I1f0ae1aa38b064dbb399e46869d8f14ac9d22a92
2021-12-14 17:38:40 +00:00
Joanne Chung
5c32e894cb Merge "Fix translation animation flash for the same translation" into sc-v2-dev am: 1ff5a29afd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16432382

Change-Id: I6cb7a365fb9bfb6e719227d2292aa08a5609396b
2021-12-13 02:54:00 +00:00
Joanne Chung
a5d4f094e8 Fix translation animation flash for the same translation
The system received the same multiple translation responses in a very
short time. We use a isShowingTranslation flag to determine if the
duplicated responses to call onShowTranslation. However the
isShowingTransation flag is set in a post runnable, this may cause the
system  allow the duplicate responses can call onShowTranslation
because the isShowingTransaltion isn't set true yet.

Use multiple flags isShowingTranslation and a new isRunningAnimation
to check if the same translation response should skip to call
onShowTranslation.

Bug: 207457172
Test: manual
Test: atest CtsTranslationTestCases
Change-Id: I7003b7f49fc0a8ce2e909228bcb89acedee6d3d0
2021-12-10 05:00:00 +00:00
Stevie Kideckel
81bd66a5a5 Merge "Copy caches when initializing RemoteViews" into sc-v2-dev am: 45cf23a6a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16422417

Change-Id: I965ad2bc3ddf198d96440b0a363a5fc76ea64be0
2021-12-08 23:03:33 +00:00
Stevie Kideckel
8d3c1aa054 Copy caches when initializing RemoteViews
If the BitmapCache is not copied when cloning RemoteViews, then Bitmaps
will be dropped.

Fix: 208865678
Test: cts, verified locally

Change-Id: I7547ab3a60ac3ee16b9cfb8d592988d0e410172d
2021-12-08 18:38:08 +00:00
Stevie Kideckel
80dd4b4290 Merge "Optimize parcelization protocol in RemoteViews and RemoteCollectionItems" into sc-v2-dev am: 742187b89d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16047867

Change-Id: I8a8e729bcbb1c8f47325bdffaecee2db4eee6137
2021-11-17 21:37:43 +00:00
Stevie Kideckel
742187b89d Merge "Optimize parcelization protocol in RemoteViews and RemoteCollectionItems" into sc-v2-dev 2021-11-17 21:24:39 +00:00
TreeHugger Robot
5df3511ad7 Merge "Check if the view can be recycled if viewId is set" into sc-v2-dev am: 8b5c93d9ea
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16214434

Change-Id: I8fd756eda96b9b5f81f19f1c1324a929238246c9
2021-11-11 23:13:57 +00:00
Pierre Barbier de Reuille
ff55ff2c96 Check if the view can be recycled if viewId is set
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.

Note, however, that some apps are already using this lack of test to
create the view themselves and use reapply to apply the RemoteViews. So
we limit the test to uses involving changing the viewId.

This CL ensures the view can be recycled when reapplied, always.

Bug: 181985606
Test: atest android.widget.cts.RemoteViewsRecyclingTest
Change-Id: Ib4f908c66a666faa4e6c27e2be38246eb7748f61
2021-11-10 12:33:49 +00:00
Stevie Kideckel
3a69c3a3fe Optimize parcelization protocol in RemoteViews and RemoteCollectionItems
By using "squashing", each ApplicationInfo is only written to the parcel
once. Subsequent writes write only a single int as a reference.

This makes the earlier system with ELIDE_DUPLICATES unnecessary.

Squashing relies on testing for equality, and ApplicationInfo does not
implement equals, therefore I've added a shared cache based on package
name and uid so that we can force all RemoteViews of the same package to
use the same ApplicationInfo object.

There is also a mechanism to update the ApplicationInfo to a new one
(needed for dynamic colors).

This saves space for addView calls as well as RemoteCollectionItems
usage. After this change, each incremental item in a collection adds 48
bytes as a base (before this was multiple kilobytes).

This approach also supports collections with RemoteViews from multiple
packages. Each ApplicationInfo in the entire hierarchy is written at
most once.

Bug: 202831917
Test: locally, atest RemoteViewsTest, atest RemoteViewsFixedCollectionAdapterTest
Change-Id: Ie1b1dc8760247aa771451149243efd63d36da368
2021-11-09 20:20:15 +00:00
TreeHugger Robot
f3ba2931ea Merge "Revert "Always check if the view can be recycled."" into sc-v2-dev am: 533ce6f9f0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16213673

Change-Id: Ic2750b05631c05fee6d3930f956b4568c0d87edd
2021-11-08 23:41:46 +00:00
Daniel Chapin
951bc7d892 Revert "Always check if the view can be recycled."
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
2021-11-08 17:20:04 +00:00
TreeHugger Robot
3af77fe304 Merge "Always check if the view can be recycled." into sc-v2-dev am: 1c3b93b10a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16153069

Change-Id: I57aa0dad1d62f578e28e4daaa5510e46242e7e19
2021-11-02 19:30:54 +00:00
Pierre Barbier de Reuille
8011a28559 Always check if the view can be recycled.
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
2021-11-01 10:37:12 +00:00
TreeHugger Robot
e330f4fcf3 Merge "Check if a view can be recycled in async case." into sc-v2-dev am: 6c20a8f525
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16140774

Change-Id: Id6d5f841f32ba8fdca10a4e8bf404534376357d3
2021-10-29 08:36:19 +00:00
Pierre Barbier de Reuille
206066b6cc Check if a view can be recycled in async case.
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
2021-10-28 14:51:39 +00:00
TreeHugger Robot
fc3b9c489d Merge "Check if APK paths are valid right before creating the context." into sc-v2-dev am: cff5e32516
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16004854

Change-Id: I3688df62ad391be9c8ee6f86c3e4042adc6a18e5
2021-10-25 12:42:37 +00:00
Pierre Barbier de Reuille
acfcc90ebd Check if APK paths are valid right before creating the context.
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
2021-10-25 08:20:10 +00:00
Joanne Chung
d8b714a0ec Merge "Fix not show translation if call startTranslation after pauseTranslation" into sc-qpr1-dev am: e82a38a8ee
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16001112

Change-Id: I103defd38bad4cfd7fde80b2f9d629fc8bc93144
2021-10-09 02:42:24 +00:00
Joanne Chung
5667540a7d Fix not show translation if call startTranslation after pauseTranslation
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
2021-10-07 06:04:06 +00:00
Treehugger Robot
afee7bdd08 Merge "fix google widget timing issue" am: 56db11dfc2 am: 86170faab2 am: df65b78e27
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1782431

Change-Id: I5d6bf8dac1a50b62eacbe9dd5255dd5af4dfbedb
2021-09-24 19:50:41 +00:00
Treehugger Robot
df65b78e27 Merge "fix google widget timing issue" am: 56db11dfc2 am: 86170faab2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1782431

Change-Id: I3a800bd8b3a728d07048f9fd4396fb02d5316c91
2021-09-24 19:29:52 +00:00
Treehugger Robot
86170faab2 Merge "fix google widget timing issue" am: 56db11dfc2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1782431

Change-Id: I6d2490247f198ff5f04c064956dbd252b35204c4
2021-09-24 19:15:07 +00:00
Treehugger Robot
56db11dfc2 Merge "fix google widget timing issue" 2021-09-24 18:57:13 +00:00
Joanne Chung
7672bbc915 Fix the existing translation doesn't update for new translated result.
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
2021-09-19 15:16:57 +00:00
Pierre Barbier de Reuille
b6ee41aa6d Make RemoteViewsContextWrapper take the user id of the application info.
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
2021-09-02 11:33:43 +01:00
TreeHugger Robot
f7fb6c535e Merge "Fix OOB crash in ContentCapture for translated views" into sc-dev 2021-08-13 21:59:25 +00:00
Ahaan Ugale
273a0eabc8 Fix OOB crash in ContentCapture for translated views
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
2021-08-12 14:21:00 -07:00
Ryan Mitchell
a57b0e9c4e Revert "Revert "Apply overlay updates to widget provider info""
Bug: 15332156
Bug: 195649929
This reverts commit 471720cccf.

Change-Id: Ifa89ae43613add1137ddeca4cb40543a3a01d6a7
2021-08-09 13:15:12 -07:00
Patrick Baumann
e2c96ac3ad Merge "Revert "Apply overlay updates to widget provider info"" into sc-dev 2021-08-05 18:07:10 +00:00
Patrick Baumann
471720cccf Revert "Apply overlay updates to widget provider info"
This reverts commit 0bf76b6296.

Bug: 193866093
Fixes: 195267626
Reason for revert: b/195267626

Change-Id: I598a99f761e66d8bedbb0745d488ccc35fff9201
2021-08-04 20:05:36 +00:00
Ryan Mitchell
f56550282e Merge "Apply overlay updates to widget provider info" into sc-dev 2021-07-30 16:04:00 +00:00
Ruoyao Liu
0dbe6f7ad5 fix google widget timing issue
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
2021-07-30 09:14:44 +00:00
Ryan Mitchell
0bf76b6296 Apply overlay updates to widget provider info
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
2021-07-29 16:02:54 +00:00
TreeHugger Robot
b42f19e297 Merge "Limit overscroll stretch for animation" into sc-dev 2021-07-14 16:55:22 +00:00
Dan Sandler
318c00483c AnalogClock: Allow subclasses to override the "now" instant.
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
2021-07-13 09:52:12 -04:00
Mihir Patel
59fe064d75 Merge "Guarding against null pointer exception when setting view structure info for content capture" into sc-dev 2021-07-02 18:22:15 +00:00
TYM Tsai
598376c6b5 Merge "Notify Content Capture when deselected" into sc-dev 2021-07-02 03:55:12 +00:00