Removing some wallpaper dependency

Change-Id: I3f88a76df40c64678e297f217d703ca296f2d5cd
This commit is contained in:
Sunny Goyal
2016-04-05 18:02:13 -07:00
parent e1f1c34c09
commit b0e378000f
2 changed files with 3 additions and 7 deletions
@@ -22,7 +22,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import com.android.launcher3.Utilities;
import com.android.wallpaperpicker.common.WallpaperManagerCompat;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -34,6 +33,8 @@ public class ExtractionUtils {
public static final String EXTRACTED_COLORS_PREFERENCE_KEY = "pref_extractedColors";
public static final String WALLPAPER_ID_PREFERENCE_KEY = "pref_wallpaperId";
private static final int FLAG_SET_SYSTEM = 1 << 0; // TODO: use WallpaperManager.FLAG_SET_SYSTEM
/**
* Extract colors in the :wallpaper-chooser process, if the wallpaper id has changed.
* When the new colors are saved in the LauncherProvider,
@@ -66,8 +67,7 @@ public class ExtractionUtils {
// TODO: use WallpaperManager#getWallpaperId(WallpaperManager.FLAG_SET_SYSTEM) directly.
try {
Method getWallpaperId = WallpaperManager.class.getMethod("getWallpaperId", int.class);
return (int) getWallpaperId.invoke(wallpaperManager,
WallpaperManagerCompat.FLAG_SET_SYSTEM);
return (int) getWallpaperId.invoke(wallpaperManager, FLAG_SET_SYSTEM);
} catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
return -1;
}