Loading src/com/android/launcher3/model/WorkspaceItemProcessor.kt +3 −1 Original line number Diff line number Diff line Loading @@ -433,7 +433,9 @@ class WorkspaceItemProcessor( !c.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_RESTORE_STARTED) && !isSafeMode && (si == null) && (lapi == null) (lapi == null) && !(Utilities.enableSupportForArchiving() && pmHelper.isAppArchived(component.packageName)) ) { // Restore never started c.markDeleted( Loading src/com/android/launcher3/util/PackageManagerHelper.java +17 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,23 @@ public class PackageManagerHelper { return info != null; } /** * Returns whether the target app is in archived state */ @SuppressWarnings("NewApi") public boolean isAppArchived(@NonNull final String packageName) { final ApplicationInfo info; try { info = mPm.getPackageInfo(packageName, PackageManager.PackageInfoFlags.of( PackageManager.MATCH_ARCHIVED_PACKAGES)).applicationInfo; return info.isArchived; } catch (NameNotFoundException e) { Log.e(TAG, "Failed to get applicationInfo for package: " + packageName, e); return false; } } /** * Returns the application info for the provided package or null */ Loading Loading
src/com/android/launcher3/model/WorkspaceItemProcessor.kt +3 −1 Original line number Diff line number Diff line Loading @@ -433,7 +433,9 @@ class WorkspaceItemProcessor( !c.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_RESTORE_STARTED) && !isSafeMode && (si == null) && (lapi == null) (lapi == null) && !(Utilities.enableSupportForArchiving() && pmHelper.isAppArchived(component.packageName)) ) { // Restore never started c.markDeleted( Loading
src/com/android/launcher3/util/PackageManagerHelper.java +17 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,23 @@ public class PackageManagerHelper { return info != null; } /** * Returns whether the target app is in archived state */ @SuppressWarnings("NewApi") public boolean isAppArchived(@NonNull final String packageName) { final ApplicationInfo info; try { info = mPm.getPackageInfo(packageName, PackageManager.PackageInfoFlags.of( PackageManager.MATCH_ARCHIVED_PACKAGES)).applicationInfo; return info.isArchived; } catch (NameNotFoundException e) { Log.e(TAG, "Failed to get applicationInfo for package: " + packageName, e); return false; } } /** * Returns the application info for the provided package or null */ Loading