version:4.4

fix:优化解锁后的app显示
update:
This commit is contained in:
2022-04-20 16:02:43 +08:00
parent 9f6c360a9a
commit 7903e3c21b
7 changed files with 67 additions and 20 deletions

View File

@@ -45,6 +45,7 @@ import com.aoleyun.os.icons.BitmapInfo;
import com.aoleyun.os.icons.LauncherIcons;
import com.aoleyun.os.logging.FileLog;
import com.aoleyun.os.shortcuts.DeepShortcutManager;
import com.aoleyun.os.uiuiutils.JGYUtils;
import com.aoleyun.os.util.FlagOp;
import com.aoleyun.os.util.IntSparseArrayMap;
import com.aoleyun.os.util.ItemInfoMatcher;
@@ -104,7 +105,9 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
case OP_ADD: {
for (int i = 0; i < N; i++) {
if (DEBUG) Log.e(TAG, "mAllAppsList.addPackage " + packages[i]);
if (hideAppList.contains(packages[i])) continue;
if (JGYUtils.getInstance().getDeviceIsLocked()) {
if (hideAppList.contains(packages[i])) continue;
}
iconCache.updateIconsForPkg(packages[i], mUser);
if (FeatureFlags.LAUNCHER3_PROMISE_APPS_IN_ALL_APPS) {
appsList.removePackage(packages[i], Process.myUserHandle());
@@ -326,7 +329,7 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
} else if (mOp == OP_UPDATE) {
// Mark disabled packages in the broadcast to be removed
final LauncherAppsCompat launcherApps = LauncherAppsCompat.getInstance(context);
for (int i=0; i<N; i++) {
for (int i = 0; i < N; i++) {
if (!launcherApps.isPackageEnabledForProfile(packages[i], mUser)) {
removedPackages.add(packages[i]);
}
@@ -364,7 +367,7 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
}
//add for load new install app on workspace
public void updateToWorkSpace(Context context, LauncherAppState app , AllAppsList appsList){
public void updateToWorkSpace(Context context, LauncherAppState app, AllAppsList appsList) {
ArrayList<Pair<ItemInfo, Object>> installQueue = new ArrayList<>();
final List<UserHandle> profiles = UserManagerCompat.getInstance(context).getUserProfiles();
ArrayList<InstallShortcutReceiver.PendingInstallShortcutInfo> added
@@ -375,9 +378,9 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
synchronized (this) {
for (LauncherActivityInfo info : apps) {
for (AppInfo appInfo : appsList.added) {
if(info.getComponentName().equals(appInfo.componentName)){
if (info.getComponentName().equals(appInfo.componentName)) {
InstallShortcutReceiver.PendingInstallShortcutInfo mPendingInstallShortcutInfo
= new InstallShortcutReceiver.PendingInstallShortcutInfo(info,context);
= new InstallShortcutReceiver.PendingInstallShortcutInfo(info, context);
added.add(mPendingInstallShortcutInfo);
installQueue.add(mPendingInstallShortcutInfo.getItemInfo());
}
@@ -392,10 +395,11 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
/**
* Updates {@param si}'s intent to point to a new ComponentName.
*
* @return Whether the shortcut intent was changed.
*/
private boolean updateWorkspaceItemIntent(Context context,
WorkspaceItemInfo si, String packageName) {
WorkspaceItemInfo si, String packageName) {
// Try to find the best match activity.
Intent intent = new PackageManagerHelper(context).getAppLaunchIntent(packageName, mUser);
if (intent != null) {