Merge "Skip item infos that fail session info verification." into sc-dev

This commit is contained in:
Schneider Victor-tulias 2021-06-15 20:54:23 +00:00 committed by Android (Google) Code Review
commit e00d88e32a
2 changed files with 21 additions and 16 deletions

View File

@ -130,8 +130,9 @@ public class AddWorkspaceItemsTask extends BaseModelUpdateTask {
packageName);
if (!packageInstaller.verifySessionInfo(sessionInfo)) {
FileLog.d(LOG, "Item info failed session info verification: "
+ workspaceInfo);
FileLog.d(LOG, "Item info failed session info verification. "
+ "Skipping : " + workspaceInfo);
continue;
}
List<LauncherActivityInfo> activities = launcherApps

View File

@ -217,7 +217,8 @@ public class InstallSessionHelper {
void tryQueuePromiseAppIcon(PackageInstaller.SessionInfo sessionInfo) {
if (FeatureFlags.PROMISE_APPS_NEW_INSTALLS.get()
&& SessionCommitReceiver.isEnabled(mAppContext)
&& verifySessionInfo(sessionInfo)) {
&& verifySessionInfo(sessionInfo)
&& !promiseIconAddedForId(sessionInfo.getSessionId())) {
FileLog.d(LOG, "Adding package name to install queue: "
+ sessionInfo.getAppPackageName());
@ -234,25 +235,28 @@ public class InstallSessionHelper {
&& sessionInfo.getInstallReason() == PackageManager.INSTALL_REASON_USER
&& sessionInfo.getAppIcon() != null
&& !TextUtils.isEmpty(sessionInfo.getAppLabel())
&& !promiseIconAddedForId(sessionInfo.getSessionId())
&& !new PackageManagerHelper(mAppContext).isAppInstalled(
sessionInfo.getAppPackageName(), getUserHandle(sessionInfo));
if (sessionInfo != null) {
Bitmap appIcon = sessionInfo.getAppIcon();
FileLog.d(LOG, String.format(
"Verifying session info. Valid: %b, Session verified: %b, Install reason valid:"
+ " %b, App icon: %s, App label: %s, Promise icon added: %b, "
+ "App installed: %b.",
validSessionInfo,
verify(sessionInfo) != null,
sessionInfo.getInstallReason() == PackageManager.INSTALL_REASON_USER,
appIcon == null ? "null" : IOUtils.toBase64String(appIcon),
sessionInfo.getAppLabel(),
promiseIconAddedForId(sessionInfo.getSessionId()),
new PackageManagerHelper(mAppContext).isAppInstalled(
sessionInfo.getAppPackageName(), getUserHandle(sessionInfo))));
if (Utilities.IS_DEBUG_DEVICE) {
FileLog.d(LOG, String.format(
"Verifying session info. Valid: %b,"
+ " Session verified: %b,"
+ " Install reason valid: %b,"
+ " App icon: %s,"
+ " App label: %s,"
+ " App installed: %b.",
validSessionInfo,
verify(sessionInfo) != null,
sessionInfo.getInstallReason() == PackageManager.INSTALL_REASON_USER,
appIcon == null ? "null" : IOUtils.toBase64String(appIcon),
sessionInfo.getAppLabel(),
new PackageManagerHelper(mAppContext).isAppInstalled(
sessionInfo.getAppPackageName(), getUserHandle(sessionInfo))));
}
} else {
FileLog.d(LOG, "Verifying session info failed: session info null.");
}