Loading core/java/android/app/WallpaperManager.java +9 −3 Original line number Diff line number Diff line Loading @@ -1962,14 +1962,20 @@ public class WallpaperManager { } /** * Set the current zoom out level of the wallpaper * Set the current zoom out level of the wallpaper. * * @param windowToken window requesting wallpaper zoom. Zoom level will only be applier while * such window is visible. * @param zoom from 0 to 1 (inclusive) where 1 means fully zoomed out, 0 means fully zoomed in * * @hide */ public void setWallpaperZoomOut(IBinder windowToken, float zoom) { public void setWallpaperZoomOut(@NonNull IBinder windowToken, float zoom) { if (zoom < 0 || zoom > 1f) { throw new IllegalArgumentException("zoom must be between 0 and one: " + zoom); throw new IllegalArgumentException("zoom must be between 0 and 1: " + zoom); } if (windowToken == null) { throw new IllegalArgumentException("windowToken must not be null"); } try { WindowManagerGlobal.getWindowSession().setWallpaperZoomOut(windowToken, zoom); Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +1 −1 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ class NotificationShadeDepthController @Inject constructor( blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur) val zoomOut = blurUtils.ratioOfBlurRadius(blur) try { if (root.isAttachedToWindow) { if (root.isAttachedToWindow && root.windowToken != null) { wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomOut) } else { Log.i(TAG, "Won't set zoom. Window not attached $root") Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar import android.app.WallpaperManager import android.os.IBinder import android.testing.AndroidTestingRunner import android.testing.TestableLooper.RunWithLooper import android.view.Choreographer Loading Loading @@ -64,6 +65,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { @Mock private lateinit var dumpManager: DumpManager @Mock private lateinit var root: View @Mock private lateinit var viewRootImpl: ViewRootImpl @Mock private lateinit var windowToken: IBinder @Mock private lateinit var shadeSpring: NotificationShadeDepthController.DepthAnimation @Mock private lateinit var shadeAnimation: NotificationShadeDepthController.DepthAnimation @Mock private lateinit var globalActionsSpring: NotificationShadeDepthController.DepthAnimation Loading @@ -80,6 +82,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { @Before fun setup() { `when`(root.viewRootImpl).thenReturn(viewRootImpl) `when`(root.windowToken).thenReturn(windowToken) `when`(root.isAttachedToWindow).thenReturn(true) `when`(statusBarStateController.state).then { statusBarState } `when`(blurUtils.blurRadiusOfRatio(anyFloat())).then { answer -> Loading Loading
core/java/android/app/WallpaperManager.java +9 −3 Original line number Diff line number Diff line Loading @@ -1962,14 +1962,20 @@ public class WallpaperManager { } /** * Set the current zoom out level of the wallpaper * Set the current zoom out level of the wallpaper. * * @param windowToken window requesting wallpaper zoom. Zoom level will only be applier while * such window is visible. * @param zoom from 0 to 1 (inclusive) where 1 means fully zoomed out, 0 means fully zoomed in * * @hide */ public void setWallpaperZoomOut(IBinder windowToken, float zoom) { public void setWallpaperZoomOut(@NonNull IBinder windowToken, float zoom) { if (zoom < 0 || zoom > 1f) { throw new IllegalArgumentException("zoom must be between 0 and one: " + zoom); throw new IllegalArgumentException("zoom must be between 0 and 1: " + zoom); } if (windowToken == null) { throw new IllegalArgumentException("windowToken must not be null"); } try { WindowManagerGlobal.getWindowSession().setWallpaperZoomOut(windowToken, zoom); Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt +1 −1 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ class NotificationShadeDepthController @Inject constructor( blurUtils.applyBlur(blurRoot?.viewRootImpl ?: root.viewRootImpl, blur) val zoomOut = blurUtils.ratioOfBlurRadius(blur) try { if (root.isAttachedToWindow) { if (root.isAttachedToWindow && root.windowToken != null) { wallpaperManager.setWallpaperZoomOut(root.windowToken, zoomOut) } else { Log.i(TAG, "Won't set zoom. Window not attached $root") Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar import android.app.WallpaperManager import android.os.IBinder import android.testing.AndroidTestingRunner import android.testing.TestableLooper.RunWithLooper import android.view.Choreographer Loading Loading @@ -64,6 +65,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { @Mock private lateinit var dumpManager: DumpManager @Mock private lateinit var root: View @Mock private lateinit var viewRootImpl: ViewRootImpl @Mock private lateinit var windowToken: IBinder @Mock private lateinit var shadeSpring: NotificationShadeDepthController.DepthAnimation @Mock private lateinit var shadeAnimation: NotificationShadeDepthController.DepthAnimation @Mock private lateinit var globalActionsSpring: NotificationShadeDepthController.DepthAnimation Loading @@ -80,6 +82,7 @@ class NotificationShadeDepthControllerTest : SysuiTestCase() { @Before fun setup() { `when`(root.viewRootImpl).thenReturn(viewRootImpl) `when`(root.windowToken).thenReturn(windowToken) `when`(root.isAttachedToWindow).thenReturn(true) `when`(statusBarStateController.state).then { statusBarState } `when`(blurUtils.blurRadiusOfRatio(anyFloat())).then { answer -> Loading