blob: e1ef9548cdbc632c1f735dd463934ad923eeb53c [file] [log] [blame]
Annie Chin17f85952016-03-24 17:12:30 -07001package com.android.launcher3;
2
Sunny Goyalae2129e2018-01-24 10:26:35 -08003import android.content.Context;
Sunny Goyal3e9be432017-01-05 15:22:41 -08004import android.content.pm.LauncherActivityInfo;
Annie Chin17f85952016-03-24 17:12:30 -07005import android.graphics.drawable.Drawable;
Annie Chin17f85952016-03-24 17:12:30 -07006
Sunny Goyal7f920b82018-06-27 15:47:49 -07007import com.android.launcher3.util.ResourceBasedOverride;
8
Sunny Goyal7f920b82018-06-27 15:47:49 -07009public class IconProvider implements ResourceBasedOverride {
Annie Chin17f85952016-03-24 17:12:30 -070010
Sunny Goyalae2129e2018-01-24 10:26:35 -080011 public static IconProvider newInstance(Context context) {
Sunny Goyal1a9cbd32018-11-08 10:51:05 -080012 return Overrides.getObject(IconProvider.class, context, R.string.icon_provider_class);
Annie Chin17f85952016-03-24 17:12:30 -070013 }
14
Sunny Goyalae2129e2018-01-24 10:26:35 -080015 public IconProvider() { }
16
Sunny Goyal1a9cbd32018-11-08 10:51:05 -080017 public String getSystemStateForPackage(String systemState, String packageName) {
18 return systemState;
Annie Chin17f85952016-03-24 17:12:30 -070019 }
20
Sunny Goyal1da13892017-06-22 11:03:40 -070021 /**
22 * @param flattenDrawable true if the caller does not care about the specification of the
23 * original icon as long as the flattened version looks the same.
24 */
25 public Drawable getIcon(LauncherActivityInfo info, int iconDpi, boolean flattenDrawable) {
Annie Chin17f85952016-03-24 17:12:30 -070026 return info.getIcon(iconDpi);
27 }
28}