From 7c26603f3300a937032fc62f5fd606c6497afe8b Mon Sep 17 00:00:00 2001 From: Suphon Thanakornpakapong Date: Mon, 31 May 2021 10:15:19 +0700 Subject: [PATCH] Fix depth controller crash below 11 --- .../com/android/launcher3/statehandlers/DepthController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java index fe8f0c653d..6e71a6f148 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java +++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java @@ -123,7 +123,7 @@ public class DepthController implements StateHandler, mMaxBlurRadius = mLauncher.getResources().getInteger(R.integer.max_depth_blur_radius); mWallpaperManager = new WallpaperManagerCompat(mLauncher); } - if (mLauncher.getRootView() != null && mOnAttachListener == null) { + if (Utilities.ATLEAST_R && mLauncher.getRootView() != null && mOnAttachListener == null) { mOnAttachListener = new View.OnAttachStateChangeListener() { @Override public void onViewAttachedToWindow(View view) { @@ -210,7 +210,7 @@ public class DepthController implements StateHandler, // Round out the depth to dedupe frequent, non-perceptable updates int depthI = (int) (depth * 256); float depthF = depthI / 256f; - if (Float.compare(mDepth, depthF) == 0) { + if (!Utilities.ATLEAST_R || Float.compare(mDepth, depthF) == 0) { return; }