2016-03-24 17:12:30 -07:00
|
|
|
package com.android.launcher3;
|
|
|
|
|
|
2017-01-05 15:22:41 -08:00
|
|
|
import android.content.pm.LauncherActivityInfo;
|
2016-03-24 17:12:30 -07:00
|
|
|
import android.graphics.drawable.Drawable;
|
2017-08-28 14:27:00 -07:00
|
|
|
import android.os.Build;
|
2016-03-24 17:12:30 -07:00
|
|
|
|
|
|
|
|
import java.util.Locale;
|
|
|
|
|
|
|
|
|
|
public class IconProvider {
|
|
|
|
|
|
|
|
|
|
private static final boolean DBG = false;
|
|
|
|
|
private static final String TAG = "IconProvider";
|
|
|
|
|
|
|
|
|
|
protected String mSystemState;
|
|
|
|
|
|
|
|
|
|
public IconProvider() {
|
|
|
|
|
updateSystemStateString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void updateSystemStateString() {
|
2017-08-28 14:27:00 -07:00
|
|
|
mSystemState = Locale.getDefault().toString() + "," + Build.VERSION.SDK_INT;
|
2016-03-24 17:12:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getIconSystemState(String packageName) {
|
|
|
|
|
return mSystemState;
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-22 11:03:40 -07:00
|
|
|
/**
|
|
|
|
|
* @param flattenDrawable true if the caller does not care about the specification of the
|
|
|
|
|
* original icon as long as the flattened version looks the same.
|
|
|
|
|
*/
|
|
|
|
|
public Drawable getIcon(LauncherActivityInfo info, int iconDpi, boolean flattenDrawable) {
|
2016-03-24 17:12:30 -07:00
|
|
|
return info.getIcon(iconDpi);
|
|
|
|
|
}
|
|
|
|
|
}
|