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

Commit e540ece7 authored by Shamali Patwa's avatar Shamali Patwa
Browse files

Adds an `IFTTT` lint to bitmap info flags to ensure when flags change, cache...

Adds an `IFTTT` lint to bitmap info flags to ensure when flags change, cache release version is updated.

If a change is expected, once can bypass it with NO_IFFT tag. But this
will just make it easier to remember about existence of the release
version constant.

Bug: 430724962
Test: http://screen/7cuMRFZzCSKwa9B
Flag: EXEMPT lint change
Change-Id: I3ec805974edd126d1a2438302ba4cff353e54d6c
parent 17641910
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -213,12 +213,15 @@ data class BitmapInfo(
    companion object {
        const val TAG: String = "BitmapInfo"

        // Persisted BitmapInfo flags. Reset the cache whenever making any changes here.
        // Persisted BitmapInfo flags.
        // Reset the cache by changing RELEASE_VERSION whenever making any changes here.
        // LINT.IfChange
        const val FLAG_WORK: Int = 1 shl 0
        const val FLAG_INSTANT: Int = 1 shl 1
        const val FLAG_CLONE: Int = 1 shl 2
        const val FLAG_PRIVATE: Int = 1 shl 3
        const val FLAG_FULL_BLEED: Int = 1 shl 4
        // LINT.ThenChange(src/com/android/launcher3/icons/cache/BaseIconCache.kt:cache_release_version)

        // Drawable creation flags
        const val FLAG_THEMED: Int = 1 shl 0
+2 −0
Original line number Diff line number Diff line
@@ -653,7 +653,9 @@ constructor(
            ComponentKey(ComponentName(packageName, packageName + EMPTY_CLASS_NAME), user)

        // Ensures themed bitmaps in the icon cache are invalidated
        // LINT.IfChange(cache_release_version)
        @JvmField val RELEASE_VERSION = if (Flags.enableLauncherIconShapes()) 14 else 12
        // LINT.ThenChange()

        @JvmField val TABLE_NAME = "icons"
        @JvmField val COLUMN_ROWID = "rowid"