Java 类android.util.MutableInt 实例源码

项目:LaunchEnr    文件:BgDataModel.java   
synchronized void removeItem(Context context, Iterable<? extends ItemInfo> items) {
    for (ItemInfo item : items) {
        switch (item.itemType) {
            case LauncherSettings.Favorites.ITEM_TYPE_FOLDER:
                folders.remove(item.id);

                workspaceItems.remove(item);
                break;
            case LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT: {
                // Decrement pinned shortcut count
                ShortcutKey pinnedShortcut = ShortcutKey.fromItemInfo(item);
                MutableInt count = pinnedShortcutCounts.get(pinnedShortcut);
                if ((count == null || --count.value == 0)
                        && !InstallShortcutReceiver.getPendingShortcuts(context)
                            .contains(pinnedShortcut)) {
                    DeepShortcutManager.getInstance(context).unpinShortcut(pinnedShortcut);
                }
                // Fall through.
            }
            case LauncherSettings.Favorites.ITEM_TYPE_APPLICATION:
            case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
                workspaceItems.remove(item);
                break;
            case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
            case LauncherSettings.Favorites.ITEM_TYPE_CUSTOM_APPWIDGET:
                appWidgets.remove(item);
                break;
        }
        itemsIdMap.remove(item.id);
    }
}
项目:FlickLauncher    文件:LauncherModel.java   
/**
 * Decrement the count for the given pinned shortcut, unpinning it if the count becomes 0.
 */
private static void decrementPinnedShortcutCount(final ShortcutKey pinnedShortcut) {
    synchronized (sBgLock) {
        MutableInt count = sBgPinnedShortcutCounts.get(pinnedShortcut);
        if (count == null || --count.value == 0) {
            LauncherAppState.getInstance().getShortcutManager().unpinShortcut(pinnedShortcut);
        }
    }
}
项目:SimpleUILauncher    文件:LauncherModel.java   
/**
 * Decrement the count for the given pinned shortcut, unpinning it if the count becomes 0.
 */
private static void decrementPinnedShortcutCount(final ShortcutKey pinnedShortcut) {
    synchronized (sBgLock) {
        MutableInt count = sBgPinnedShortcutCounts.get(pinnedShortcut);
        if (count == null || --count.value == 0) {
            LauncherAppState.getInstance().getShortcutManager().unpinShortcut(pinnedShortcut);
        }
    }
}
项目:android_packages_apps_tv    文件:ChannelDataManager.java   
private void addChannel(Channel channel) {
    mChannels.add(channel);
    String inputId = channel.getInputId();
    MutableInt count = mChannelCountMap.get(inputId);
    if (count == null) {
        mChannelCountMap.put(inputId, new MutableInt(1));
    } else {
        count.value++;
    }
}
项目:android_packages_apps_tv    文件:ChannelDataManager.java   
/**
 * Returns the total channel count for a given input.
 *
 * @param inputId The ID of the input.
 */
public int getChannelCountForInput(String inputId) {
    MutableInt count = mChannelCountMap.get(inputId);
    return count == null ? 0 : count.value;
}