Moving various runtime flags into the common base class.
Caching the ststemApp status for workspace shortcuts.
Change-Id: I25663e1f04a9768afcca000294adcbb00ea1db7b
diff --git a/src/com/android/launcher3/UninstallDropTarget.java b/src/com/android/launcher3/UninstallDropTarget.java
index 8e83a30..68a441a 100644
--- a/src/com/android/launcher3/UninstallDropTarget.java
+++ b/src/com/android/launcher3/UninstallDropTarget.java
@@ -1,5 +1,8 @@
package com.android.launcher3;
+import static com.android.launcher3.ItemInfoWithIcon.FLAG_SYSTEM_MASK;
+import static com.android.launcher3.ItemInfoWithIcon.FLAG_SYSTEM_NO;
+
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -83,10 +86,10 @@
return false;
}
- if (info instanceof AppInfo) {
- AppInfo appInfo = (AppInfo) info;
- if (appInfo.isSystemApp != AppInfo.FLAG_SYSTEM_UNKNOWN) {
- return (appInfo.isSystemApp & AppInfo.FLAG_SYSTEM_NO) != 0;
+ if (info instanceof ItemInfoWithIcon) {
+ ItemInfoWithIcon iconInfo = (ItemInfoWithIcon) info;
+ if ((iconInfo.runtimeStatusFlags & FLAG_SYSTEM_MASK) != 0) {
+ return (iconInfo.runtimeStatusFlags & FLAG_SYSTEM_NO) != 0;
}
}
return getUninstallTarget(info) != null;