Add support for progress bar during unarchival of app.
* With this change, progress bar should appear whenever app update for archived app reaches non-zero progress. * Once the update is cancelled, the progress bar should also disappear. Test: PromiseIconUiTest and manually tested the progress bar using Play Store Bug: 302115555 Flag: ACONFIG com.android.launcher3.enable_support_for_archiving DEVELOPMENT Change-Id: Iacf7a0fd865dba34915fa09f59c63a1da6e47315
This commit is contained in:
@@ -15,9 +15,11 @@
|
||||
*/
|
||||
package com.android.launcher3.model;
|
||||
|
||||
import static com.android.launcher3.Flags.enableSupportForArchiving;
|
||||
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED;
|
||||
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_QUIET_MODE_ENABLED;
|
||||
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_WORK_PROFILE_QUIET_MODE_ENABLED;
|
||||
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_ARCHIVED;
|
||||
import static com.android.launcher3.model.data.WorkspaceItemInfo.FLAG_AUTOINSTALL_ICON;
|
||||
import static com.android.launcher3.model.data.WorkspaceItemInfo.FLAG_RESTORED_ICON;
|
||||
|
||||
@@ -67,6 +69,7 @@ import java.util.stream.Collectors;
|
||||
* Handles updates due to changes in package manager (app installed/updated/removed)
|
||||
* or when a user availability changes.
|
||||
*/
|
||||
@SuppressWarnings("NewApi")
|
||||
public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
|
||||
// TODO(b/290090023): Set to false after root causing is done.
|
||||
@@ -269,6 +272,16 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
: PackageManagerHelper.getLoadingProgress(
|
||||
activities.get(0)),
|
||||
PackageInstallInfo.STATUS_INSTALLED_DOWNLOADING);
|
||||
// In case an app is archived, we need to make sure that archived state
|
||||
// in WorkspaceItemInfo is refreshed.
|
||||
if (enableSupportForArchiving() && !activities.isEmpty()) {
|
||||
boolean newArchivalState = activities.get(
|
||||
0).getActivityInfo().isArchived;
|
||||
if (newArchivalState != si.isArchived()) {
|
||||
si.runtimeStatusFlags ^= FLAG_ARCHIVED;
|
||||
infoUpdated = true;
|
||||
}
|
||||
}
|
||||
if (si.itemType == Favorites.ITEM_TYPE_APPLICATION) {
|
||||
iconCache.getTitleAndIcon(si, si.usingLowResIcon());
|
||||
infoUpdated = true;
|
||||
|
||||
Reference in New Issue
Block a user