Make AppSnippet parcelable
AppSnippet is used in Pia in 4 activities. Each time, it is expensive to
parse the app's logo and label from PackageManager and the APK file of
the app being installed. Thus, lets compute the AppSnippet once and pass
it as an intent extra to whichever activity needs it.
This also solves the bug where InstallSuccess showed an activity's name
in place of the app label since the temporary directory used to create
AppSnippet is already destroyed after app installation.
Bug: 290862169
Test: Manually install an APK and observe the app install / update
dialog
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:719d00a979005e1b5919694305b015e1970992d9)
Merged-In: I2095b092e1a7b3186ff4cdc4c81effce51377b19
Change-Id: I2095b092e1a7b3186ff4cdc4c81effce51377b19
Original patch:
From 719d00a979005e1b5919694305b015e1970992d9 Mon Sep 17 00:00:00 2001
From: Sumedh Sen <sumedhsen@google.com>
Date: Tue, 18 Jul 2023 15:00:59 -0700
Subject: [PATCH] Make AppSnippet parcelable
AppSnippet is used in Pia in 4 activities. Each time, it is expensive to
parse the app's logo and label from PackageManager and the APK file of
the app being installed. Thus, lets compute the AppSnippet once and pass
it as an intent extra to whichever activity needs it.
This also solves the bug where InstallSuccess showed an activity's name
in place of the app label since the temporary directory used to create
AppSnippet is already destroyed after app installation.
Bug: 290862169
Test: Manually install an APK and observe the app install / update
dialog
Change-Id: I2095b092e1a7b3186ff4cdc4c81effce51377b19
---
5 files changed