Moving come helper methods to corresponding classes
> Moving isPackageEnabled to InstallShortcutReceiver > Moving the deep shortcut map to the data model > Removing appInfo.flags. Instead fetching the flags when needed Change-Id: I654dd8acefa7b7d183b0419afbe112bef001d536
This commit is contained in:
1 parent
5fe414f9a4
commit
8e0e1d7609
8 files changed
+81
-113
No files matched your search
@@ -52,11 +52,6 @@ public class AppInfo extends ItemInfo {
|
||||
|
||||
public ComponentName componentName;
|
||||
|
||||
static final int DOWNLOADED_FLAG = 1;
|
||||
static final int UPDATED_SYSTEM_APP_FLAG = 2;
|
||||
|
||||
int flags = 0;
|
||||
|
||||
/**
|
||||
* {@see ShortcutInfo#isDisabled}
|
||||
*/
|
||||
@@ -88,7 +83,6 @@ public class AppInfo extends ItemInfo {
|
||||
IconCache iconCache, boolean quietModeEnabled) {
|
||||
this.componentName = info.getComponentName();
|
||||
this.container = ItemInfo.NO_ID;
|
||||
flags = initFlags(info);
|
||||
if (PackageManagerHelper.isAppSuspended(info.getApplicationInfo())) {
|
||||
isDisabled |= ShortcutInfo.FLAG_DISABLED_SUSPENDED;
|
||||
}
|
||||
@@ -101,25 +95,11 @@ public class AppInfo extends ItemInfo {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public static int initFlags(LauncherActivityInfoCompat info) {
|
||||
int appFlags = info.getApplicationInfo().flags;
|
||||
int flags = 0;
|
||||
if ((appFlags & android.content.pm.ApplicationInfo.FLAG_SYSTEM) == 0) {
|
||||
flags |= DOWNLOADED_FLAG;
|
||||
|
||||
if ((appFlags & android.content.pm.ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
|
||||
flags |= UPDATED_SYSTEM_APP_FLAG;
|
||||
}
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
public AppInfo(AppInfo info) {
|
||||
super(info);
|
||||
componentName = info.componentName;
|
||||
title = Utilities.trim(info.title);
|
||||
intent = new Intent(info.intent);
|
||||
flags = info.flags;
|
||||
isDisabled = info.isDisabled;
|
||||
iconBitmap = info.iconBitmap;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user