diff options
author | Tony Wickham <twickham@google.com> | 2015-11-12 12:31:50 -0800 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2015-11-12 12:51:06 -0800 |
commit | 112ac95571c9b81921a912d67b9c369fb523a235 (patch) | |
tree | bea1a6c7af12f5124157beeb4730ff2be18de0cc /src/com/android/launcher3/Utilities.java | |
parent | a43f78fc4b70bf54b9c90758660b6155ef0257aa (diff) | |
download | android_packages_apps_Trebuchet-112ac95571c9b81921a912d67b9c369fb523a235.tar.gz android_packages_apps_Trebuchet-112ac95571c9b81921a912d67b9c369fb523a235.tar.bz2 android_packages_apps_Trebuchet-112ac95571c9b81921a912d67b9c369fb523a235.zip |
Skip to the end of the folder open animation in battery saver mode.
Bug: 25666809
Change-Id: I867d56a34fc5e0ad6aaabd8b6df47be05ec31966
Diffstat (limited to 'src/com/android/launcher3/Utilities.java')
-rw-r--r-- | src/com/android/launcher3/Utilities.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index d14d056fe..735cbebb7 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -46,6 +46,7 @@ import android.graphics.drawable.Drawable; import android.graphics.drawable.PaintDrawable; import android.os.Build; import android.os.Bundle; +import android.os.PowerManager; import android.os.Process; import android.text.Spannable; import android.text.SpannableString; @@ -759,4 +760,10 @@ public final class Utilities { return context.getSharedPreferences( LauncherFiles.SHARED_PREFERENCES_KEY, Context.MODE_PRIVATE); } + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + public static boolean isPowerSaverOn(Context context) { + PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); + return ATLEAST_LOLLIPOP && powerManager.isPowerSaveMode(); + } } |