Ensure icons are invalidated when useNewIconForArchivedApps flag is flipped.
This way when launcher loads and the flag value has changed, archived apps fetch new icons to avoid having the wrong icon from cache.
Bug: 364856793
Flag: com.android.launcher3.use_new_icon_for_archived_apps
Test: manually flipping flag and rebooting
Change-Id: I5c83fea4138c1afad703dd43242d4afe620448d4
diff --git a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java
index b96b4f7..6b5b85d 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java
@@ -57,6 +57,7 @@
import androidx.annotation.VisibleForTesting;
import androidx.annotation.WorkerThread;
+import com.android.launcher3.Flags;
import com.android.launcher3.icons.BaseIconFactory;
import com.android.launcher3.icons.BaseIconFactory.IconOptions;
import com.android.launcher3.icons.BitmapInfo;
@@ -750,7 +751,9 @@
* Cache class to store the actual entries on disk
*/
public static final class IconDB extends SQLiteCacheHelper {
- private static final int RELEASE_VERSION = 34;
+ // Ensures archived app icons are invalidated after flag is flipped.
+ // TODO: Remove conditional with FLAG_USE_NEW_ICON_FOR_ARCHIVED_APPS
+ private static final int RELEASE_VERSION = Flags.useNewIconForArchivedApps() ? 35 : 34;
public static final String TABLE_NAME = "icons";
public static final String COLUMN_ROWID = "rowid";