summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Launcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r--src/com/android/launcher3/Launcher.java40
1 files changed, 38 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 87a3d2483..b7a2c941d 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3076,11 +3076,15 @@ public class Launcher extends Activity
final Intent intent;
if (tag instanceof ShortcutInfo) {
shortcut = (ShortcutInfo) tag;
+ if (shortcut.isDisabled) {
+ Toast.makeText(this, R.string.app_not_available, Toast.LENGTH_SHORT).show();
+ return;
+ }
intent = shortcut.intent;
int[] pos = new int[2];
v.getLocationOnScreen(pos);
- intent.setSourceBounds(new Rect(pos[0], pos[1],
- pos[0] + v.getWidth(), pos[1] + v.getHeight()));
+ intent.setSourceBounds(
+ new Rect(pos[0], pos[1], pos[0] + v.getWidth(), pos[1] + v.getHeight()));
} else if (tag instanceof AppInfo) {
shortcut = null;
@@ -5474,6 +5478,38 @@ public class Launcher extends Activity
}
/**
+ * A package has become unavailable.
+ *
+ * Implementation of the method from LauncherModel.Callbacks.
+ */
+ public void bindComponentsUnavailable(final ArrayList<String> packageNames,
+ final ArrayList<AppInfo> appInfos) {
+ if (!packageNames.isEmpty()) {
+ mWorkspace.updateUnavailableItemsByPackageName(packageNames);
+ }
+ // Notify the drag controller
+ mDragController.onAppsRemoved(packageNames, appInfos);
+
+ // Update AllApps
+ if (!LauncherAppState.isDisableAllApps() &&
+ mAppsCustomizeContent != null) {
+ mAppsCustomizeContent.removeApps(appInfos);
+ mAppDrawerAdapter.removeApps(appInfos);
+ }
+ }
+
+ /**
+ * A package has become unavailable.
+ *
+ * Implementation of the method from LauncherModel.Callbacks.
+ */
+ public void bindComponentsAvailable(final ArrayList<ItemInfo> itemInfos) {
+ if (!itemInfos.isEmpty()) {
+ mWorkspace.updateAvailableItems(itemInfos);
+ }
+ }
+
+ /**
* A number of packages were updated.
*/
private ArrayList<Object> mWidgetsAndShortcuts;