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

Commit 914f3ef9 authored by Aurélien Pomini's avatar Aurélien Pomini Committed by Android (Google) Code Review
Browse files

Merge "New TorusEngine onWallpaperFlagsChanged() method" into main

parents 45e8f761 c50157ce
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.google.android.torus.core.engine

import android.app.WallpaperManager
import com.google.android.torus.core.wallpaper.LiveWallpaper

/**
@@ -59,4 +60,11 @@ interface TorusEngine {
     * @param isLastActiveInstance Whether this was the last Engine instance in our Service.
     */
    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
     * [WallpaperManager.FLAG_LOCK] and/or [WallpaperManager.FLAG_SYSTEM]
     */
    fun onWallpaperFlagsChanged(which: Int) {}
}
+5 −1
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.os.Bundle
import android.service.wallpaper.WallpaperService
import android.view.MotionEvent
import android.view.SurfaceHolder
import androidx.annotation.RequiresApi
import com.google.android.torus.core.content.ConfigurationChangeListener
import com.google.android.torus.core.engine.TorusEngine
import com.google.android.torus.core.engine.listener.TorusTouchListener
@@ -398,6 +397,11 @@ abstract class LiveWallpaper : WallpaperService() {
            }
        }

        override fun onWallpaperFlagsChanged(which: Int) {
            super.onWallpaperFlagsChanged(which)
            wallpaperEngine.onWallpaperFlagsChanged(which)
        }

        /**
         * This is overriding a hidden API [WallpaperService.shouldZoomOutWallpaper].
         */