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

Commit 8db0d380 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Exclude dynamic shortcuts from being force themed" into main

parents 4ec961f8 3ec7d2a0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -59,4 +59,5 @@ data class SourceHint(
    val key: ComponentKey,
    val logic: CachingLogic<*>,
    val freshnessId: String? = null,
    val isFileDrawable: Boolean = false,
)
+1 −1
Original line number Diff line number Diff line
@@ -641,7 +641,7 @@ constructor(
            ComponentKey(ComponentName(packageName, packageName + EMPTY_CLASS_NAME), user)

        // Ensures themed bitmaps in the icon cache are invalidated
        @JvmField val RELEASE_VERSION = if (Flags.forceMonochromeAppIcons()) 6 else 5
        @JvmField val RELEASE_VERSION = if (Flags.forceMonochromeAppIcons()) 8 else 7

        @JvmField val TABLE_NAME = "icons"
        @JvmField val COLUMN_ROWID = "rowid"
+7 −3
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ class MonoIconThemeController(
        factory: BaseIconFactory,
        sourceHint: SourceHint?,
    ): ThemedBitmap? {
        val mono = getMonochromeDrawable(icon, info)
        val mono = getMonochromeDrawable(icon, info, sourceHint?.isFileDrawable ?: false)
        if (mono != null) {
            return MonoThemedBitmap(
                factory.createIconBitmap(mono, ICON_VISIBLE_AREA_FACTOR, MODE_ALPHA),
@@ -71,12 +71,16 @@ class MonoIconThemeController(
     *
     * @param base the original icon
     */
    private fun getMonochromeDrawable(base: AdaptiveIconDrawable, info: BitmapInfo): Drawable? {
    private fun getMonochromeDrawable(
        base: AdaptiveIconDrawable,
        info: BitmapInfo,
        isFileDrawable: Boolean,
    ): Drawable? {
        val mono = base.monochrome
        if (mono != null) {
            return ClippedMonoDrawable(mono)
        }
        if (Flags.forceMonochromeAppIcons()) {
        if (Flags.forceMonochromeAppIcons() && !isFileDrawable) {
            return MonochromeIconFactory(info.icon.width).wrap(base)
        }
        return null