summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/model
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-11-05 17:19:45 -0800
committerSunny Goyal <sunnygoyal@google.com>2018-11-05 17:33:15 -0800
commitd7239fcc52efbc85de7a73d666a44eaac3543637 (patch)
treec67b641191e611575be77e368a8e6a658468462f /src/com/android/launcher3/model
parent06bca75d01313e59c7e3cdb854aecf8722d023a4 (diff)
downloadandroid_packages_apps_Trebuchet-d7239fcc52efbc85de7a73d666a44eaac3543637.tar.gz
android_packages_apps_Trebuchet-d7239fcc52efbc85de7a73d666a44eaac3543637.tar.bz2
android_packages_apps_Trebuchet-d7239fcc52efbc85de7a73d666a44eaac3543637.zip
Removing UserManagerCompat wrapper for getting baded label
This removes some crass dependency on Launcher compat implementation making it easier to move iconCache to a separate library Change-Id: If5fab0c82d98089cde6f54b6a374fb7bb2db5ae8
Diffstat (limited to 'src/com/android/launcher3/model')
-rw-r--r--src/com/android/launcher3/model/LoaderCursor.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/launcher3/model/LoaderCursor.java b/src/com/android/launcher3/model/LoaderCursor.java
index ea4d32b28..3aeb1c078 100644
--- a/src/com/android/launcher3/model/LoaderCursor.java
+++ b/src/com/android/launcher3/model/LoaderCursor.java
@@ -22,6 +22,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.Intent.ShortcutIconResource;
import android.content.pm.LauncherActivityInfo;
+import android.content.pm.PackageManager;
import android.database.Cursor;
import android.database.CursorWrapper;
import android.graphics.BitmapFactory;
@@ -41,7 +42,6 @@ import com.android.launcher3.ShortcutInfo;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.compat.LauncherAppsCompat;
-import com.android.launcher3.compat.UserManagerCompat;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.BitmapInfo;
import com.android.launcher3.icons.LauncherIcons;
@@ -64,7 +64,7 @@ public class LoaderCursor extends CursorWrapper {
public final LongSparseArray<UserHandle> allUsers = new LongSparseArray<>();
private final Context mContext;
- private final UserManagerCompat mUserManager;
+ private final PackageManager mPM;
private final IconCache mIconCache;
private final InvariantDeviceProfile mIDP;
@@ -100,7 +100,7 @@ public class LoaderCursor extends CursorWrapper {
mContext = app.getContext();
mIconCache = app.getIconCache();
mIDP = app.getInvariantDeviceProfile();
- mUserManager = UserManagerCompat.getInstance(mContext);
+ mPM = mContext.getPackageManager();
// Init column indices
iconIndex = getColumnIndexOrThrow(LauncherSettings.Favorites.ICON);
@@ -228,7 +228,7 @@ public class LoaderCursor extends CursorWrapper {
throw new InvalidParameterException("Invalid restoreType " + restoreFlag);
}
- info.contentDescription = mUserManager.getBadgedLabelForUser(info.title, info.user);
+ info.contentDescription = mPM.getUserBadgedLabel(info.title, info.user);
info.itemType = itemType;
info.status = restoreFlag;
return info;
@@ -284,7 +284,7 @@ public class LoaderCursor extends CursorWrapper {
info.title = componentName.getClassName();
}
- info.contentDescription = mUserManager.getBadgedLabelForUser(info.title, info.user);
+ info.contentDescription = mPM.getUserBadgedLabel(info.title, info.user);
return info;
}