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; |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 5 | |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 6 | import java.util.Locale; |
| 7 | |
| 8 | public class IconProvider { |
| 9 | |
| 10 | private static final boolean DBG = false; |
| 11 | private static final String TAG = "IconProvider"; |
| 12 | |
| 13 | protected String mSystemState; |
| 14 | |
| 15 | public IconProvider() { |
| 16 | updateSystemStateString(); |
| 17 | } |
| 18 | |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 19 | public void updateSystemStateString() { |
| 20 | mSystemState = Locale.getDefault().toString(); |
| 21 | } |
| 22 | |
| 23 | public String getIconSystemState(String packageName) { |
| 24 | return mSystemState; |
| 25 | } |
| 26 | |
Sunny Goyal | 1da1389 | 2017-06-22 11:03:40 -0700 | [diff] [blame^] | 27 | /** |
| 28 | * @param flattenDrawable true if the caller does not care about the specification of the |
| 29 | * original icon as long as the flattened version looks the same. |
| 30 | */ |
| 31 | public Drawable getIcon(LauncherActivityInfo info, int iconDpi, boolean flattenDrawable) { |
Annie Chin | 17f8595 | 2016-03-24 17:12:30 -0700 | [diff] [blame] | 32 | return info.getIcon(iconDpi); |
| 33 | } |
| 34 | } |