diff options
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 5ae3a30d7..84e29b565 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -3080,11 +3080,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; @@ -5537,6 +5541,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; |