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

Commit 25bf7dfc authored by Catherine Liang's avatar Catherine Liang Committed by Android (Google) Code Review
Browse files

Merge "Move custom Launcher theme flag to shared SysUI package (3/3)" into main

parents 3cd914b3 636bb3f9
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -179,3 +179,10 @@ flag {
    }
}

flag {
  name: "extendible_theme_manager"
  namespace: "launcher"
  description: "Enables custom theme manager in Launcher and Customization Picker"
  bug: "381897614"
}
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ android_library {
    static_libs: [
        "androidx.core_core",
        "com_android_launcher3_flags_lib",
        "com_android_systemui_shared_flags_lib",
    ],
    resource_dirs: [
        "res",
@@ -40,6 +41,7 @@ android_library {
    static_libs: [
        "androidx.core_core",
        "com_android_launcher3_flags_lib",
        "com_android_systemui_shared_flags_lib",
    ],
    resource_dirs: [
        "res",
+1 −0
Original line number Diff line number Diff line
@@ -17,4 +17,5 @@ android {
dependencies {
    implementation("androidx.core:core")
    api(project(":NexusLauncher:Flags"))
    api(project(":frameworks:base:packages:SystemUI:SystemUISharedFlags"))
}
+4 −3
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ import com.android.launcher3.icons.cache.CacheLookupFlag.Companion.DEFAULT_LOOKU
import com.android.launcher3.util.ComponentKey
import com.android.launcher3.util.FlagOp
import com.android.launcher3.util.SQLiteCacheHelper
import com.android.systemui.shared.Flags.extendibleThemeManager
import java.util.function.Supplier
import kotlin.collections.MutableMap.MutableEntry

@@ -549,7 +550,7 @@ constructor(
                return false
            }

            if (!Flags.extendibleThemeManager() || lookupFlags.hasThemeIcon()) {
            if (!extendibleThemeManager() || lookupFlags.hasThemeIcon()) {
                // Always set a non-null theme bitmap if theming was requested
                entry.bitmap.themedBitmap = ThemedBitmap.NOT_SUPPORTED

@@ -695,14 +696,14 @@ constructor(
        fun CacheLookupFlag.toLookupColumns() =
            when {
                useLowRes() -> COLUMNS_LOW_RES
                Flags.extendibleThemeManager() && !hasThemeIcon() -> COLUMNS_HIGH_RES_NO_THEME
                extendibleThemeManager() && !hasThemeIcon() -> COLUMNS_HIGH_RES_NO_THEME
                else -> COLUMNS_HIGH_RES
            }

        @JvmStatic
        protected fun BitmapInfo.downSampleToLookupFlag(flag: CacheLookupFlag) =
            when {
                !Flags.extendibleThemeManager() -> this
                !extendibleThemeManager() -> this
                flag.useLowRes() -> BitmapInfo.of(LOW_RES_ICON, color)
                !flag.hasThemeIcon() && themedBitmap != null ->
                    clone().apply { themedBitmap = null }
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
package com.android.launcher3.icons.cache

import androidx.annotation.IntDef
import com.android.launcher3.Flags
import com.android.systemui.shared.Flags.extendibleThemeManager
import kotlin.annotation.AnnotationRetention.SOURCE

/** Flags to control cache lookup behavior */
@@ -61,7 +61,7 @@ data class CacheLookupFlag private constructor(@LookupFlag private val flag: Int
    fun isVisuallyLessThan(other: CacheLookupFlag) =
        when {
            useLowRes() && !other.useLowRes() -> true
            Flags.extendibleThemeManager() && !hasThemeIcon() && other.hasThemeIcon() -> true
            extendibleThemeManager() && !hasThemeIcon() && other.hasThemeIcon() -> true
            else -> false
        }