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

Commit 08337b29 authored by Aurélien Pomini's avatar Aurélien Pomini
Browse files

Add AOD support in TorusLib

Flag: EXEMPT no logic change
Bug: 419518170
Test: presubmit

Change-Id: Idec72193cb478a76d2828f26827007b52472050b
parent 46bf7490
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.