Changing min sdk to 25
Change-Id: I0d28069967854357ca755bf25dec19d4979bdecf
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index a0f005c..c847120 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -28,7 +28,6 @@
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
-import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Point;
@@ -55,7 +54,6 @@
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.util.IntArray;
-import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.IOException;
import java.lang.reflect.Method;
@@ -98,18 +96,6 @@
public static final boolean ATLEAST_OREO =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
- public static final boolean ATLEAST_NOUGAT_MR1 =
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1;
-
- public static final boolean ATLEAST_NOUGAT =
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;
-
- public static final boolean ATLEAST_MARSHMALLOW =
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
-
- public static final boolean ATLEAST_LOLLIPOP_MR1 =
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1;
-
public static final int SINGLE_FRAME_MS = 16;
/**
@@ -123,9 +109,6 @@
// An intent extra to indicate the horizontal scroll of the wallpaper.
public static final String EXTRA_WALLPAPER_OFFSET = "com.android.launcher3.WALLPAPER_OFFSET";
- public static final int COLOR_EXTRACTION_JOB_ID = 1;
- public static final int WALLPAPER_COMPAT_JOB_ID = 2;
-
// These values are same as that in {@link AsyncTask}.
private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors();
private static final int CORE_POOL_SIZE = CPU_COUNT + 1;
@@ -512,19 +495,11 @@
// Battery saver mode no longer prevents animations.
return false;
}
- PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
- return powerManager.isPowerSaveMode();
+ return context.getSystemService(PowerManager.class).isPowerSaveMode();
}
public static boolean isWallpaperAllowed(Context context) {
- if (ATLEAST_NOUGAT) {
- try {
- WallpaperManager wm = context.getSystemService(WallpaperManager.class);
- return (Boolean) wm.getClass().getDeclaredMethod("isSetWallpaperAllowed")
- .invoke(wm);
- } catch (Exception e) { }
- }
- return true;
+ return context.getSystemService(WallpaperManager.class).isSetWallpaperAllowed();
}
public static void closeSilently(Closeable c) {
@@ -602,8 +577,4 @@
public static String getPointString(int x, int y) {
return String.format(Locale.ENGLISH, "%d,%d", x, y);
}
-
- public interface Consumer<T> {
- void accept(T var1);
- }
}