Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 1 | package com.android.launcher3; |
| 2 | |
Sunny Goyal | e529a86 | 2019-08-06 09:48:36 -0700 | [diff] [blame] | 3 | import static com.android.launcher3.util.MainThreadInitializedObject.forOverride; |
| 4 | |
Sunny Goyal | 3e9be43 | 2017-01-05 15:22:41 -0800 | [diff] [blame] | 5 | import android.content.pm.LauncherActivityInfo; |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 6 | import android.graphics.drawable.Drawable; |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 7 | |
Sunny Goyal | e529a86 | 2019-08-06 09:48:36 -0700 | [diff] [blame] | 8 | import com.android.launcher3.util.MainThreadInitializedObject; |
Sunny Goyal | 7f920b8 | 2018-06-27 15:47:49 -0700 | [diff] [blame] | 9 | import com.android.launcher3.util.ResourceBasedOverride; |
| 10 | |
Sunny Goyal | 7f920b8 | 2018-06-27 15:47:49 -0700 | [diff] [blame] | 11 | public class IconProvider implements ResourceBasedOverride { |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 12 | |
Sunny Goyal | e529a86 | 2019-08-06 09:48:36 -0700 | [diff] [blame] | 13 | public static MainThreadInitializedObject<IconProvider> INSTANCE = |
| 14 | forOverride(IconProvider.class, R.string.icon_provider_class); |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 15 | |
Sunny Goyal | ae2129e | 2018-01-24 10:26:35 -0800 | [diff] [blame] | 16 | public IconProvider() { } |
| 17 | |
Sunny Goyal | 1a9cbd3 | 2018-11-08 10:51:05 -0800 | [diff] [blame] | 18 | public String getSystemStateForPackage(String systemState, String packageName) { |
| 19 | return systemState; |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 20 | } |
| 21 | |
Sunny Goyal | 1da1389 | 2017-06-22 11:03:40 -0700 | [diff] [blame] | 22 | /** |
| 23 | * @param flattenDrawable true if the caller does not care about the specification of the |
| 24 | * original icon as long as the flattened version looks the same. |
| 25 | */ |
| 26 | public Drawable getIcon(LauncherActivityInfo info, int iconDpi, boolean flattenDrawable) { |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 27 | return info.getIcon(iconDpi); |
| 28 | } |
| 29 | } |