Revert "Add UI updates for incremental app installs."
This reverts commit b803f7e2cb8dbaab2c1453693c61155c03fd90c8.
Reason for revert: causes b/177642572
Change-Id: I48b85e8495734a2d3a7b477dfb20929879465b6a
diff --git a/src/com/android/launcher3/model/AllAppsList.java b/src/com/android/launcher3/model/AllAppsList.java
index c57c3e4..8d5cf74 100644
--- a/src/com/android/launcher3/model/AllAppsList.java
+++ b/src/com/android/launcher3/model/AllAppsList.java
@@ -26,7 +26,6 @@
import android.content.pm.LauncherActivityInfo;
import android.content.pm.LauncherApps;
import android.os.LocaleList;
-import android.os.Process;
import android.os.UserHandle;
import android.util.Log;
@@ -162,18 +161,14 @@
/** Updates the given PackageInstallInfo's associated AppInfo's installation info. */
public List<AppInfo> updatePromiseInstallInfo(PackageInstallInfo installInfo) {
List<AppInfo> updatedAppInfos = new ArrayList<>();
- UserHandle user = Process.myUserHandle();
+ UserHandle user = installInfo.user;
for (int i = data.size() - 1; i >= 0; i--) {
final AppInfo appInfo = data.get(i);
final ComponentName tgtComp = appInfo.getTargetComponent();
if (tgtComp != null && tgtComp.getPackageName().equals(installInfo.packageName)
&& appInfo.user.equals(user)) {
if (installInfo.state == PackageInstallInfo.STATUS_INSTALLED_DOWNLOADING
- || installInfo.state == PackageInstallInfo.STATUS_INSTALLING) {
- if (appInfo.isAppStartable()
- && installInfo.state == PackageInstallInfo.STATUS_INSTALLING) {
- continue;
- }
+ || installInfo.state == PackageInstallInfo.STATUS_INSTALLING) {
appInfo.setProgressLevel(installInfo);
updatedAppInfos.add(appInfo);
diff --git a/src/com/android/launcher3/model/PackageUpdatedTask.java b/src/com/android/launcher3/model/PackageUpdatedTask.java
index 3275d59..896bfb6 100644
--- a/src/com/android/launcher3/model/PackageUpdatedTask.java
+++ b/src/com/android/launcher3/model/PackageUpdatedTask.java
@@ -38,7 +38,6 @@
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.LauncherAppWidgetInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
-import com.android.launcher3.pm.PackageInstallInfo;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.shortcuts.ShortcutRequest;
import com.android.launcher3.util.FlagOp;
@@ -247,7 +246,6 @@
if (isNewApkAvailable
&& si.itemType == Favorites.ITEM_TYPE_APPLICATION) {
- si.setProgressLevel(100, PackageInstallInfo.STATUS_INSTALLED);
iconCache.getTitleAndIcon(si, si.usingLowResIcon());
infoUpdated = true;
}
diff --git a/src/com/android/launcher3/model/data/AppInfo.java b/src/com/android/launcher3/model/data/AppInfo.java
index dde0cf4..39247c2 100644
--- a/src/com/android/launcher3/model/data/AppInfo.java
+++ b/src/com/android/launcher3/model/data/AppInfo.java
@@ -94,6 +94,8 @@
componentName = info.componentName;
title = Utilities.trim(info.title);
intent = new Intent(info.intent);
+ user = info.user;
+ runtimeStatusFlags = info.runtimeStatusFlags;
}
@VisibleForTesting
@@ -112,7 +114,6 @@
.setComponent(componentName)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
- setProgressLevel(installInfo);
user = installInfo.user;
}
diff --git a/src/com/android/launcher3/model/data/ItemInfoWithIcon.java b/src/com/android/launcher3/model/data/ItemInfoWithIcon.java
index d95e708..b8a71d3 100644
--- a/src/com/android/launcher3/model/data/ItemInfoWithIcon.java
+++ b/src/com/android/launcher3/model/data/ItemInfoWithIcon.java
@@ -129,9 +129,7 @@
protected ItemInfoWithIcon(ItemInfoWithIcon info) {
super(info);
bitmap = info.bitmap;
- mProgressLevel = info.mProgressLevel;
runtimeStatusFlags = info.runtimeStatusFlags;
- user = info.user;
}
@Override
@@ -197,8 +195,8 @@
: runtimeStatusFlags & ~FLAG_INCREMENTAL_DOWNLOAD_ACTIVE;
} else {
mProgressLevel = status == PackageInstallInfo.STATUS_INSTALLED ? 100 : 0;
- runtimeStatusFlags &= ~FLAG_INSTALL_SESSION_ACTIVE;
- runtimeStatusFlags &= ~FLAG_INCREMENTAL_DOWNLOAD_ACTIVE;
+ runtimeStatusFlags = runtimeStatusFlags & ~FLAG_INSTALL_SESSION_ACTIVE;
+ runtimeStatusFlags = runtimeStatusFlags & ~FLAG_INCREMENTAL_DOWNLOAD_ACTIVE;
}
}