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

Commit 9cc87830 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13046591 from ed3da0e4 to 25Q2-release

Change-Id: I0f47c76962f7fb287e6a7469c2aff4ab3962501f
parents bfa154a4 ed3da0e4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@ interface ThemedBitmap {

interface IconThemeController {

    val themeID: String

    fun createThemedBitmap(
        icon: AdaptiveIconDrawable,
        info: BitmapInfo,
+7 −4
Original line number Diff line number Diff line
@@ -551,7 +551,8 @@ constructor(
                            data = monoIconData,
                            info = entry.bitmap,
                            factory = factory,
                            sourceHint = SourceHint(cacheKey, logic),
                            sourceHint =
                                SourceHint(cacheKey, logic, c.getString(INDEX_FRESHNESS_ID)),
                        )
                }
            }
@@ -659,9 +660,10 @@ constructor(

        @JvmField
        val COLUMNS_HIGH_RES =
            COLUMNS_LOW_RES.copyOf(COLUMNS_LOW_RES.size + 2).apply {
                this[size - 2] = COLUMN_ICON
                this[size - 1] = COLUMN_MONO_ICON
            COLUMNS_LOW_RES.copyOf(COLUMNS_LOW_RES.size + 3).apply {
                this[size - 3] = COLUMN_ICON
                this[size - 2] = COLUMN_MONO_ICON
                this[size - 1] = COLUMN_FRESHNESS_ID
            }

        @JvmField val INDEX_TITLE = COLUMNS_HIGH_RES.indexOf(COLUMN_LABEL)
@@ -669,6 +671,7 @@ constructor(
        @JvmField val INDEX_FLAGS = COLUMNS_HIGH_RES.indexOf(COLUMN_FLAGS)
        @JvmField val INDEX_ICON = COLUMNS_HIGH_RES.indexOf(COLUMN_ICON)
        @JvmField val INDEX_MONO_ICON = COLUMNS_HIGH_RES.indexOf(COLUMN_MONO_ICON)
        @JvmField val INDEX_FRESHNESS_ID = COLUMNS_HIGH_RES.indexOf(COLUMN_FRESHNESS_ID)

        @JvmStatic
        fun CacheLookupFlag.toLookupColumns() =
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ class MonoIconThemeController(
    private val colorProvider: (Context) -> IntArray = ThemedIconDrawable.Companion::getColors
) : IconThemeController {

    override val themeID = "with-theme"

    override fun createThemedBitmap(
        icon: AdaptiveIconDrawable,
        info: BitmapInfo,
+16 −9
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.google.android.torus.core.engine

import android.app.WallpaperManager
import android.app.wallpaper.WallpaperDescription
import android.service.wallpaper.WallpaperService.Engine
import com.google.android.torus.core.wallpaper.LiveWallpaper

/**
@@ -25,8 +27,8 @@ import com.google.android.torus.core.wallpaper.LiveWallpaper
 */
interface TorusEngine {
    /**
     * Called when the engine is created. You should load the assets and initialize the
     * resources here.
     * Called when the engine is created. You should load the assets and initialize the resources
     * here.
     *
     * IMPORTANT: When this function is called, the surface used to render the engine has to be
     * ready.
@@ -37,13 +39,18 @@ interface TorusEngine {
    fun create(isFirstActiveInstance: Boolean = true)

    /**
     * Called when the [TorusEngine] resumes.
     * Called when the event [Engine.onApplyWallpaper] is called.
     *
     * @see Engine.onApplyWallpaper
     */
    fun applyWallpaper(which: Int): WallpaperDescription? {
        return null
    }

    /** Called when the [TorusEngine] resumes. */
    fun resume()

    /**
     * Called when the [TorusEngine] is paused.
     */
    /** Called when the [TorusEngine] is paused. */
    fun pause()

    /**
@@ -62,8 +69,8 @@ interface TorusEngine {
    fun destroy(isLastActiveInstance: Boolean = true)

    /**
     * Called when the engine changes its destination flag. The destination indicates whether
     * the wallpaper is drawn on home screen, lock screen, or both. It is a combination of
     * Called when the engine changes its destination flag. The destination indicates whether the
     * wallpaper is drawn on home screen, lock screen, or both. It is a combination of
     * [WallpaperManager.FLAG_LOCK] and/or [WallpaperManager.FLAG_SYSTEM]
     */
    fun onWallpaperFlagsChanged(which: Int) {}
+5 −0
Original line number Diff line number Diff line
@@ -284,6 +284,11 @@ abstract class LiveWallpaper : WallpaperService() {
            if (wallpaperEngine is TorusTouchListener) setTouchEventsEnabled(true)
        }

        override fun onApplyWallpaper(which: Int): WallpaperDescription? {
            super.onApplyWallpaper(which)
            return wallpaperEngine.applyWallpaper(which)
        }

        override fun onSurfaceCreated(holder: SurfaceHolder) {
            super.onSurfaceCreated(holder)

Loading