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

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

Merge "Add AOD support in TorusLib" into main

parents 5cc433e3 08337b29
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -434,6 +434,17 @@ abstract class LiveWallpaper : WallpaperService() {
            return super.onCommand(action, x, y, z, extras, resultRequested)
        }

        override fun onAmbientModeChanged(inAmbientMode: Boolean, animationDuration: Long) {
            super.onAmbientModeChanged(inAmbientMode, animationDuration)

            if (wallpaperEngine is LiveWallpaperEventListener) {
                (wallpaperEngine as LiveWallpaperEventListener).onAmbientModeChanged(
                    inAmbientMode,
                    animationDuration,
                )
            }
        }

        override fun onTouchEvent(event: MotionEvent) {
            super.onTouchEvent(event)

+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.google.android.torus.core.wallpaper.listener

import android.app.WallpaperColors
import android.os.Bundle
import android.service.wallpaper.WallpaperService

/**
 * Interface that is used to implement specific wallpaper callbacks like offset change (user swipes
@@ -101,6 +102,9 @@ interface LiveWallpaperEventListener {
     */
    fun onSleep(extras: Bundle)

    /** @see WallpaperService.Engine.onAmbientModeChanged */
    fun onAmbientModeChanged(inAmbientMode: Boolean, animationDuration: Long) {}

    /**
     * Indicates whether the zoom animation should be handled in WindowManager. Preferred to be set
     * to true to avoid pressuring GPU.