项目: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;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。