Prevent DepthController crash below S
This commit is contained in:
1 parent
7360f5856e
commit
8edee5bbed
2 files changed
+5
No files matched your search
@@ -36,6 +36,8 @@ public class Utilities {
|
||||
|
||||
private static final float TABLET_MIN_DPS = 600;
|
||||
|
||||
public static final boolean ATLEAST_S = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S;
|
||||
|
||||
public static final boolean ATLEAST_S_V2 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S_V2;
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,6 +21,8 @@ import static android.view.CrossWindowBlurListeners.CROSS_WINDOW_BLUR_SUPPORTED;
|
||||
import android.app.ActivityManager;
|
||||
import android.os.SystemProperties;
|
||||
|
||||
import com.android.systemui.shared.recents.utilities.Utilities;
|
||||
|
||||
public abstract class BlurUtils {
|
||||
|
||||
/**
|
||||
@@ -29,6 +31,7 @@ public abstract class BlurUtils {
|
||||
* @return {@code true} when supported.
|
||||
*/
|
||||
public static boolean supportsBlursOnWindows() {
|
||||
if (!Utilities.ATLEAST_S) return false;
|
||||
return CROSS_WINDOW_BLUR_SUPPORTED && ActivityManager.isHighEndGfx()
|
||||
&& !SystemProperties.getBoolean("persist.sysui.disableBlur", false);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user