Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 1 | package com.android.launcher3; |
| 2 | |
Sunny Goyal | 3e9be43 | 2017-01-05 15:22:41 -0800 | [diff] [blame] | 3 | import android.content.pm.LauncherActivityInfo; |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 4 | import android.graphics.drawable.Drawable; |
Hyunyoung Song | 3152827 | 2017-08-28 14:27:00 -0700 | [diff] [blame] | 5 | import android.os.Build; |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 6 | |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 7 | import java.util.Locale; |
| 8 | |
| 9 | public class IconProvider { |
| 10 | |
| 11 | private static final boolean DBG = false; |
| 12 | private static final String TAG = "IconProvider"; |
| 13 | |
| 14 | protected String mSystemState; |
| 15 | |
| 16 | public IconProvider() { |
| 17 | updateSystemStateString(); |
| 18 | } |
| 19 | |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 20 | public void updateSystemStateString() { |
Hyunyoung Song | 3152827 | 2017-08-28 14:27:00 -0700 | [diff] [blame] | 21 | mSystemState = Locale.getDefault().toString() + "," + Build.VERSION.SDK_INT; |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | public String getIconSystemState(String packageName) { |
| 25 | return mSystemState; |
| 26 | } |
| 27 | |
Sunny Goyal | 1da1389 | 2017-06-22 11:03:40 -0700 | [diff] [blame] | 28 | /** |
| 29 | * @param flattenDrawable true if the caller does not care about the specification of the |
| 30 | * original icon as long as the flattened version looks the same. |
| 31 | */ |
| 32 | public Drawable getIcon(LauncherActivityInfo info, int iconDpi, boolean flattenDrawable) { |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 33 | return info.getIcon(iconDpi); |
| 34 | } |
| 35 | } |