Add multi-instance state to item infos
- Add legacy resource for supported multi-instance apps that
matches the current SystemUI resource of the same name, and will
be removed as apps migrate to the V manifest property to declare
multi-instance support
- Load the multi-instance state from PackageManager when the db is
first loaded or when packages are updated
- The multi-instance check is then used to determine if an app pair
can be saved (ie. whether the action can be shown)
Bug: 323112914
Test: atest NexusLauncherTests
Change-Id: I565b4bee4ab5f7040910306b1fd60a4fc3bf9a1c
diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java
index 869b995..a4ae1c8 100644
--- a/src/com/android/launcher3/LauncherAppState.java
+++ b/src/com/android/launcher3/LauncherAppState.java
@@ -52,6 +52,7 @@
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.util.LockedUserState;
import com.android.launcher3.util.MainThreadInitializedObject;
+import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.Preconditions;
import com.android.launcher3.util.RunnableList;
import com.android.launcher3.util.SafeCloseable;
@@ -181,7 +182,7 @@
mIconCache = new IconCache(mContext, mInvariantDeviceProfile,
iconCacheFileName, mIconProvider);
mModel = new LauncherModel(context, this, mIconCache, new AppFilter(mContext),
- iconCacheFileName != null);
+ PackageManagerHelper.INSTANCE.get(context), iconCacheFileName != null);
mOnTerminateCallback.add(mIconCache::close);
mOnTerminateCallback.add(mModel::destroy);
}