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

Commit 35e05142 authored by Sherry Zhou's avatar Sherry Zhou Committed by Android (Google) Code Review
Browse files

Merge "Add onKeyguardAppearing to LiveWallpaperKeyguardEventListener" into main

parents 06dcc8df 8d7ac1d0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ abstract class LiveWallpaper : WallpaperService() {
        const val COMMAND_PREVIEW_INFO = "android.wallpaper.previewinfo"
        const val COMMAND_LOCKSCREEN_LAYOUT_CHANGED = "android.wallpaper.lockscreen_layout_changed"
        const val COMMAND_LOCKSCREEN_TAP = "android.wallpaper.lockscreen_tap"
        const val COMMAND_KEYGUARD_APPEARING = "android.wallpaper.keyguardappearing"
        const val WALLPAPER_FLAG_NOT_FOUND = -1
    }

@@ -423,6 +424,9 @@ abstract class LiveWallpaper : WallpaperService() {
                        onLockscreenFocalAreaTap(x, y)
                    }
                }
                COMMAND_KEYGUARD_APPEARING -> {
                    onKeyguardAppearing()
                }
            }

            if (resultRequested) return extras
@@ -475,6 +479,12 @@ abstract class LiveWallpaper : WallpaperService() {
            }
        }

        fun onKeyguardAppearing() {
            if (wallpaperEngine is LiveWallpaperKeyguardEventListener) {
                (wallpaperEngine as LiveWallpaperKeyguardEventListener).onKeyguardAppearing()
            }
        }

        fun onPreviewInfoReceived(extras: Bundle?) {
            if (wallpaperEngine is LiveWallpaperEventListener) {
                (wallpaperEngine as LiveWallpaperEventListener).onPreviewInfoReceived(extras)
+2 −0
Original line number Diff line number Diff line
@@ -21,4 +21,6 @@ interface LiveWallpaperKeyguardEventListener {

    /** Called when the keyguard is going away. */
    fun onKeyguardGoingAway()

    fun onKeyguardAppearing()
}
+2 −0
Original line number Diff line number Diff line
@@ -152,6 +152,8 @@ class WeatherEngine(
        userPresenceController.onKeyguardGoingAway()
    }

    override fun onKeyguardAppearing() {}

    override fun onOffsetChanged(xOffset: Float, xOffsetStep: Float) {
        // No-op.
    }