Loading src/com/android/launcher3/AbstractFloatingView.java +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch } public final void close(boolean animate) { animate &= !Utilities.isPowerSaverOn(getContext()); animate &= !Utilities.isPowerSaverPreventingAnimation(getContext()); handleClose(animate); BaseActivity.fromContext(getContext()).getUserEventDispatcher() .resetElapsedContainerMillis("container closed"); Loading src/com/android/launcher3/CellLayout.java +1 −1 Original line number Diff line number Diff line Loading @@ -1980,7 +1980,7 @@ public class CellLayout extends ViewGroup { // Animations are disabled in power save mode, causing the repeated animation to jump // spastically between beginning and end states. Since this looks bad, we don't repeat // the animation in power save mode. if (!Utilities.isPowerSaverOn(getContext())) { if (!Utilities.isPowerSaverPreventingAnimation(getContext())) { va.setRepeatMode(ValueAnimator.REVERSE); va.setRepeatCount(ValueAnimator.INFINITE); } Loading src/com/android/launcher3/Utilities.java +7 −3 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import android.os.Handler; import android.os.Message; import android.os.PowerManager; import android.os.TransactionTooLargeException; import android.support.v4.os.BuildCompat; import android.text.Spannable; import android.text.SpannableString; import android.text.TextUtils; Loading Loading @@ -83,7 +82,8 @@ public final class Utilities { private static final Matrix sMatrix = new Matrix(); private static final Matrix sInverseMatrix = new Matrix(); public static final boolean ATLEAST_P = BuildCompat.isAtLeastP(); public static final boolean ATLEAST_P = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P; public static final boolean ATLEAST_OREO_MR1 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1; Loading Loading @@ -492,7 +492,11 @@ public final class Utilities { LauncherFiles.DEVICE_PREFERENCES_KEY, Context.MODE_PRIVATE); } public static boolean isPowerSaverOn(Context context) { public static boolean isPowerSaverPreventingAnimation(Context context) { if (ATLEAST_P) { // Battery saver mode no longer prevents animations. return false; } PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); return powerManager.isPowerSaveMode(); } Loading Loading
src/com/android/launcher3/AbstractFloatingView.java +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch } public final void close(boolean animate) { animate &= !Utilities.isPowerSaverOn(getContext()); animate &= !Utilities.isPowerSaverPreventingAnimation(getContext()); handleClose(animate); BaseActivity.fromContext(getContext()).getUserEventDispatcher() .resetElapsedContainerMillis("container closed"); Loading
src/com/android/launcher3/CellLayout.java +1 −1 Original line number Diff line number Diff line Loading @@ -1980,7 +1980,7 @@ public class CellLayout extends ViewGroup { // Animations are disabled in power save mode, causing the repeated animation to jump // spastically between beginning and end states. Since this looks bad, we don't repeat // the animation in power save mode. if (!Utilities.isPowerSaverOn(getContext())) { if (!Utilities.isPowerSaverPreventingAnimation(getContext())) { va.setRepeatMode(ValueAnimator.REVERSE); va.setRepeatCount(ValueAnimator.INFINITE); } Loading
src/com/android/launcher3/Utilities.java +7 −3 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import android.os.Handler; import android.os.Message; import android.os.PowerManager; import android.os.TransactionTooLargeException; import android.support.v4.os.BuildCompat; import android.text.Spannable; import android.text.SpannableString; import android.text.TextUtils; Loading Loading @@ -83,7 +82,8 @@ public final class Utilities { private static final Matrix sMatrix = new Matrix(); private static final Matrix sInverseMatrix = new Matrix(); public static final boolean ATLEAST_P = BuildCompat.isAtLeastP(); public static final boolean ATLEAST_P = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P; public static final boolean ATLEAST_OREO_MR1 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1; Loading Loading @@ -492,7 +492,11 @@ public final class Utilities { LauncherFiles.DEVICE_PREFERENCES_KEY, Context.MODE_PRIVATE); } public static boolean isPowerSaverOn(Context context) { public static boolean isPowerSaverPreventingAnimation(Context context) { if (ATLEAST_P) { // Battery saver mode no longer prevents animations. return false; } PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); return powerManager.isPowerSaveMode(); } Loading