This shouldn't be empty if {@link #mCategory} has a value,
- * {@link PackageItemInfo#NO_CATEGORY}.
- */
- public final String mPackage;
- /** A widget category. */
- @PackageItemInfo.Category public final int mCategory;
- public final UserHandle mUser;
- private final int mHashCode;
-
- WidgetPackageOrCategoryKey(PackageUserKey key) {
- this(key.mPackageName, key.mUser);
- }
-
- WidgetPackageOrCategoryKey(String packageName, UserHandle user) {
- this(packageName, PackageItemInfo.NO_CATEGORY, user);
- }
-
- WidgetPackageOrCategoryKey(@PackageItemInfo.Category int category, UserHandle user) {
- this("", category, user);
- }
-
- private WidgetPackageOrCategoryKey(String packageName,
- @PackageItemInfo.Category int category, UserHandle user) {
- mPackage = packageName;
- mCategory = category;
- mUser = user;
- mHashCode = Arrays.hashCode(new Object[]{mPackage, mCategory, mUser});
- }
-
- @Override
- public int hashCode() {
- return mHashCode;
- }
- }
-
private static final class PackageItemInfoCache {
- private final Map