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

Commit 924f2a96 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Preventing lookup flags downgrade on icon change

When a icon gets changed by something with unsupported theme bitmap, FLAG_THEMED gets lost since the bitmap is set to null
Instead using a non-null bitmap in that case to preserve FLAG_THEMED

Bug: 421151325
Bug: 421000549
Flag: EXEMPT refactor
Test: Updated unit tests
Change-Id: Ie37c89ae381778dcbf8036c540f8d0bd1fbc5321
parent 900552ab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ interface IconThemeController {
        info: BitmapInfo,
        factory: BaseIconFactory,
        sourceHint: SourceHint? = null,
    ): ThemedBitmap?
    ): ThemedBitmap

    fun decode(
        data: ByteArray,
+3 −2
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import com.android.launcher3.icons.IconThemeController
import com.android.launcher3.icons.MonochromeIconFactory
import com.android.launcher3.icons.SourceHint
import com.android.launcher3.icons.ThemedBitmap
import com.android.launcher3.icons.ThemedBitmap.Companion
import java.nio.ByteBuffer

@TargetApi(Build.VERSION_CODES.TIRAMISU)
@@ -57,7 +58,7 @@ class MonoIconThemeController(
        info: BitmapInfo,
        factory: BaseIconFactory,
        sourceHint: SourceHint?,
    ): ThemedBitmap? {
    ): ThemedBitmap {
        val mono =
            getMonochromeDrawable(
                icon,
@@ -73,7 +74,7 @@ class MonoIconThemeController(
                colorProvider,
            )
        }
        return null
        return ThemedBitmap.NOT_SUPPORTED
    }

    /**