Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8302c38 authored by Rohit Goyal's avatar Rohit Goyal
Browse files

Bugfix: In case of unarchival, do not add an installer task to add workspace item.

* In case install queue is cleared (which happens when launcher comes back to foregorund from background) when app has successfully unarchived, since app is not archived anymore, `AddWorkspaceItemTask` successfully manages to add item to the workspace.
* We should avoid adding pending task for adding workspace item in the queue at all for unarchival to prevent this.

Test: verified bugfixes locally.
Bug: 326495267
Flag: ACONFIG com.android.launcher3.enable_support_for_archiving DEVELOPMENT
Change-Id: Iae6d6390d8e2d9b270f7aef0dce1fa32d9899f28
parent 7bd1fa82
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -215,11 +215,15 @@ public class InstallSessionHelper {
                && SessionCommitReceiver.isEnabled(mAppContext, getUserHandle(sessionInfo))
                && verifySessionInfo(sessionInfo)
                && !promiseIconAddedForId(sessionInfo.getSessionId())) {
            // In case of unarchival, we do not want to add a workspace promise icon if one is
            // not already present. For general app installations however, we do support it.
            if (!Utilities.enableSupportForArchiving() || !sessionInfo.isUnarchival()) {
                FileLog.d(LOG, "Adding package name to install queue: "
                        + sessionInfo.getAppPackageName());

                ItemInstallQueue.INSTANCE.get(mAppContext)
                        .queueItem(sessionInfo.getAppPackageName(), getUserHandle(sessionInfo));
            }

            getPromiseIconIds().add(sessionInfo.getSessionId());
            updatePromiseIconPrefs();