Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 1 | package com.android.launcher3; |
| 2 | |
Sunny Goyal | ae2129e | 2018-01-24 10:26:35 -0800 | [diff] [blame] | 3 | import android.content.Context; |
Sunny Goyal | 3e9be43 | 2017-01-05 15:22:41 -0800 | [diff] [blame] | 4 | import android.content.pm.LauncherActivityInfo; |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 5 | import android.graphics.drawable.Drawable; |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 6 | |
Sunny Goyal | 7f920b8 | 2018-06-27 15:47:49 -0700 | [diff] [blame] | 7 | import com.android.launcher3.util.ResourceBasedOverride; |
| 8 | |
Sunny Goyal | 7f920b8 | 2018-06-27 15:47:49 -0700 | [diff] [blame] | 9 | public class IconProvider implements ResourceBasedOverride { |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 10 | |
Sunny Goyal | ae2129e | 2018-01-24 10:26:35 -0800 | [diff] [blame] | 11 | public static IconProvider newInstance(Context context) { |
Sunny Goyal | 1a9cbd3 | 2018-11-08 10:51:05 -0800 | [diff] [blame] | 12 | return Overrides.getObject(IconProvider.class, context, R.string.icon_provider_class); |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 13 | } |
| 14 | |
Sunny Goyal | ae2129e | 2018-01-24 10:26:35 -0800 | [diff] [blame] | 15 | public IconProvider() { } |
| 16 | |
Sunny Goyal | 1a9cbd3 | 2018-11-08 10:51:05 -0800 | [diff] [blame] | 17 | public String getSystemStateForPackage(String systemState, String packageName) { |
| 18 | return systemState; |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 19 | } |
| 20 | |
Sunny Goyal | 1da1389 | 2017-06-22 11:03:40 -0700 | [diff] [blame] | 21 | /** |
| 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 Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 26 | return info.getIcon(iconDpi); |
| 27 | } |
| 28 | } |