summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodService.java
diff options
context:
space:
mode:
authorStevie Kideckel <kideckel@google.com>2021-10-13 13:35:05 +0000
committerStevie Kideckel <kideckel@google.com>2021-11-09 20:20:15 +0000
commit3a69c3a3feca029ad1cde48a12074320cea984b7 (patch)
treefb3b3f12f0c566cb4671350ecc496fafa7f6c23d /core/java/android/inputmethodservice/InputMethodService.java
parent5170817dea7bdf6c3dd0665185942c83536532b9 (diff)
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
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
0 files changed, 0 insertions, 0 deletions