2016-03-24 17:12:30 -07:00
|
|
|
package com.android.launcher3;
|
|
|
|
|
|
2018-01-24 10:26:35 -08:00
|
|
|
import android.content.Context;
|
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;
|
|
|
|
|
|
2018-06-27 15:47:49 -07:00
|
|
|
import com.android.launcher3.util.ResourceBasedOverride;
|
|
|
|
|
|
|
|
|
|
public class IconProvider implements ResourceBasedOverride {
|
2016-03-24 17:12:30 -07:00
|
|
|
|
2018-01-24 10:26:35 -08:00
|
|
|
public static IconProvider newInstance(Context context) {
|
2018-11-08 10:51:05 -08:00
|
|
|
return Overrides.getObject(IconProvider.class, context, R.string.icon_provider_class);
|
2016-03-24 17:12:30 -07:00
|
|
|
}
|
|
|
|
|
|
2018-01-24 10:26:35 -08:00
|
|
|
public IconProvider() { }
|
|
|
|
|
|
2018-11-08 10:51:05 -08:00
|
|
|
public String getSystemStateForPackage(String systemState, String packageName) {
|
|
|
|
|
return systemState;
|
2016-03-24 17:12:30 -07:00
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|