mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Skip state animation if animations are disabled
> Also update the animation disabled check to use new-API Bug: 118678948 Change-Id: Ib709844e34bdb7e369b368a7c33f2e8ff120024b
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.launcher3;
|
||||
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_DESKTOP;
|
||||
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT;
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.WallpaperManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -517,12 +518,10 @@ public final class Utilities {
|
||||
LauncherFiles.DEVICE_PREFERENCES_KEY, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
public static boolean isPowerSaverPreventingAnimation(Context context) {
|
||||
if (ATLEAST_P) {
|
||||
// Battery saver mode no longer prevents animations.
|
||||
return false;
|
||||
}
|
||||
return context.getSystemService(PowerManager.class).isPowerSaveMode();
|
||||
public static boolean areAnimationsEnabled(Context context) {
|
||||
return ATLEAST_OREO
|
||||
? ValueAnimator.areAnimatorsEnabled()
|
||||
: !context.getSystemService(PowerManager.class).isPowerSaveMode();
|
||||
}
|
||||
|
||||
public static boolean isWallpaperAllowed(Context context) {
|
||||
|
||||
Reference in New Issue
Block a user