Lines Matching full:favorites
56 import com.android.launcher3.LauncherSettings.Favorites;
83 static final String TABLE_FAVORITES = "favorites";
157 Uri uri = LauncherSettings.Favorites.getContentUri(id, false);
306 // Populate favorites table with initial favorites
321 LauncherSettings.Favorites.OLD_CONTENT_URI);
355 private static final String TAG_FAVORITES = "favorites";
410 db.execSQL("CREATE TABLE favorites (" +
445 int container = values.getAsInteger(LauncherSettings.Favorites.CONTAINER);
446 if (container == Favorites.CONTAINER_DESKTOP) {
447 int screen = values.getAsInteger(LauncherSettings.Favorites.SCREEN);
449 values.put(LauncherSettings.Favorites.SCREEN, screen);
457 uri = LauncherSettings.Favorites.OLD_CONTENT_URI;
525 // We already have a favorites database in the old provider
553 final int idIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites._ID);
554 final int intentIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.INTENT);
555 final int titleIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.TITLE);
556 final int iconTypeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_TYPE);
557 final int iconIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON);
558 final int iconPackageIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_PACKAGE);
559 final int iconResourceIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_RESOURCE);
560 final int containerIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CONTAINER);
561 final int itemTypeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ITEM_TYPE);
562 final int screenIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.SCREEN);
563 final int cellXIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLX);
564 final int cellYIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLY);
565 final int uriIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.URI);
566 final int displayModeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.DISPLAY_MODE);
572 values.put(LauncherSettings.Favorites._ID, c.getLong(idIndex));
573 values.put(LauncherSettings.Favorites.INTENT, c.getString(intentIndex));
574 values.put(LauncherSettings.Favorites.TITLE, c.getString(titleIndex));
575 values.put(LauncherSettings.Favorites.ICON_TYPE, c.getInt(iconTypeIndex));
576 values.put(LauncherSettings.Favorites.ICON, c.getBlob(iconIndex));
577 values.put(LauncherSettings.Favorites.ICON_PACKAGE, c.getString(iconPackageIndex));
578 values.put(LauncherSettings.Favorites.ICON_RESOURCE, c.getString(iconResourceIndex));
579 values.put(LauncherSettings.Favorites.CONTAINER, c.getInt(containerIndex));
580 values.put(LauncherSettings.Favorites.ITEM_TYPE, c.getInt(itemTypeIndex));
581 values.put(LauncherSettings.Favorites.APPWIDGET_ID, -1);
582 values.put(LauncherSettings.Favorites.SCREEN, c.getInt(screenIndex));
583 values.put(LauncherSettings.Favorites.CELLX, c.getInt(cellXIndex));
584 values.put(LauncherSettings.Favorites.CELLY, c.getInt(cellYIndex));
585 values.put(LauncherSettings.Favorites.URI, c.getString(uriIndex));
586 values.put(LauncherSettings.Favorites.DISPLAY_MODE, c.getInt(displayModeIndex));
624 db.execSQL("ALTER TABLE favorites " +
657 db.execSQL("UPDATE favorites SET screen=(screen + 1);");
726 db.execSQL("ALTER TABLE favorites " +
742 db.execSQL("ALTER TABLE favorites " +
761 db.execSQL("ALTER TABLE favorites " +
793 Favorites.ITEM_TYPE,
794 new int[] { Favorites.ITEM_TYPE_SHORTCUT });
802 new String[] { Favorites._ID, Favorites.INTENT },
808 final int idIndex = c.getColumnIndex(Favorites._ID);
809 final int intentIndex = c.getColumnIndex(Favorites.INTENT);
843 values.put(LauncherSettings.Favorites.INTENT,
846 String updateWhere = Favorites._ID + "=" + favoriteId;
880 update = db.compileStatement("UPDATE favorites "
883 c = db.rawQuery("SELECT _id, icon FROM favorites WHERE iconType=" +
884 Favorites.ICON_TYPE_BITMAP, null);
886 final int idIndex = c.getColumnIndexOrThrow(Favorites._ID);
887 final int iconIndex = c.getColumnIndexOrThrow(Favorites.ICON);
955 Cursor c = db.rawQuery("SELECT MAX(_id) FROM favorites", null);
1024 Favorites.ITEM_TYPE_WIDGET_CLOCK,
1025 Favorites.ITEM_TYPE_WIDGET_PHOTO_FRAME,
1026 Favorites.ITEM_TYPE_WIDGET_SEARCH,
1029 final String selectWhere = buildOrWhereString(Favorites.ITEM_TYPE, bindSources);
1036 c = db.query(TABLE_FAVORITES, new String[] { Favorites._ID, Favorites.ITEM_TYPE },
1055 values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPWIDGET);
1056 values.put(Favorites.APPWIDGET_ID, appWidgetId);
1059 if (favoriteType == Favorites.ITEM_TYPE_WIDGET_SEARCH) {
1060 values.put(LauncherSettings.Favorites.SPANX, 4);
1061 values.put(LauncherSettings.Favorites.SPANY, 1);
1063 values.put(LauncherSettings.Favorites.SPANX, 2);
1064 values.put(LauncherSettings.Favorites.SPANY, 2);
1067 String updateWhere = Favorites._ID + "=" + favoriteId;
1070 if (favoriteType == Favorites.ITEM_TYPE_WIDGET_CLOCK) {
1075 } else if (favoriteType == Favorites.ITEM_TYPE_WIDGET_PHOTO_FRAME) {
1080 } else if (favoriteType == Favorites.ITEM_TYPE_WIDGET_SEARCH) {
1134 if (LOGD) Log.v(TAG, String.format("Loading favorites from resid=0x%08x", workspaceResourceId));
1165 // recursively load some more favorites, why not?
1181 long container = LauncherSettings.Favorites.CONTAINER_DESKTOP;
1191 values.put(LauncherSettings.Favorites.CONTAINER, container);
1192 values.put(LauncherSettings.Favorites.SCREEN, screen);
1193 values.put(LauncherSettings.Favorites.CELLX, x);
1194 values.put(LauncherSettings.Favorites.CELLY, y);
1227 values.put(LauncherSettings.Favorites.TITLE, title);
1244 values.put(LauncherSettings.Favorites.CONTAINER, folderId);
1286 Log.w(TAG, "Got exception parsing favorites.", e);
1288 Log.w(TAG, "Got exception parsing favorites.", e);
1290 Log.w(TAG, "Got exception parsing favorites.", e);
1322 values.put(Favorites.INTENT, intent.toUri(0));
1323 values.put(Favorites.TITLE, info.loadLabel(packageManager).toString());
1324 values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPLICATION);
1325 values.put(Favorites.SPANX, 1);
1326 values.put(Favorites.SPANY, 1);
1327 values.put(Favorites._ID, generateNewItemId());
1339 values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_FOLDER);
1340 values.put(Favorites.SPANX, 1);
1341 values.put(Favorites.SPANY, 1);
1343 values.put(Favorites._ID, id);
1455 values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPWIDGET);
1456 values.put(Favorites.SPANX, spanX);
1457 values.put(Favorites.SPANY, spanY);
1458 values.put(Favorites.APPWIDGET_ID, appWidgetId);
1459 values.put(Favorites.APPWIDGET_PROVIDER, cn.flattenToString());
1460 values.put(Favorites._ID, generateNewItemId());
1507 values.put(Favorites.INTENT, intent.toUri(0));
1508 values.put(Favorites.TITLE, r.getString(titleResId));
1509 values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_SHORTCUT);
1510 values.put(Favorites.SPANX, 1);
1511 values.put(Favorites.SPANY, 1);
1512 values.put(Favorites.ICON_TYPE, Favorites.ICON_TYPE_RESOURCE);
1513 values.put(Favorites.ICON_PACKAGE, mContext.getPackageName());
1514 values.put(Favorites.ICON_RESOURCE, r.getResourceName(iconResId));
1515 values.put(Favorites._ID, id);
1535 // We already have a favorites database in the old provider
1539 final int idIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites._ID);
1541 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.INTENT);
1543 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.TITLE);
1545 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_TYPE);
1547 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON);
1549 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_PACKAGE);
1551 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_RESOURCE);
1553 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CONTAINER);
1555 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ITEM_TYPE);
1557 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.SCREEN);
1559 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLX);
1561 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLY);
1563 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.URI);
1565 = c.getColumnIndexOrThrow(LauncherSettings.Favorites.DISPLAY_MODE);
1586 if (itemType != Favorites.ITEM_TYPE_APPLICATION
1587 && itemType != Favorites.ITEM_TYPE_SHORTCUT
1588 && itemType != Favorites.ITEM_TYPE_FOLDER) {
1600 + LauncherSettings.Favorites.containerToString(container)
1604 if (itemType != Favorites.ITEM_TYPE_FOLDER) {
1629 LauncherSettings.Favorites.CONTAINER_DESKTOP) {
1647 values.put(LauncherSettings.Favorites._ID, c.getInt(idIndex));
1648 values.put(LauncherSettings.Favorites.INTENT, intentStr);
1649 values.put(LauncherSettings.Favorites.TITLE, c.getString(titleIndex));
1650 values.put(LauncherSettings.Favorites.ICON_TYPE,
1652 values.put(LauncherSettings.Favorites.ICON, c.getBlob(iconIndex));
1653 values.put(LauncherSettings.Favorites.ICON_PACKAGE,
1655 values.put(LauncherSettings.Favorites.ICON_RESOURCE,
1657 values.put(LauncherSettings.Favorites.ITEM_TYPE, itemType);
1658 values.put(LauncherSettings.Favorites.APPWIDGET_ID, -1);
1659 values.put(LauncherSettings.Favorites.URI, c.getString(uriIndex));
1660 values.put(LauncherSettings.Favorites.DISPLAY_MODE,
1663 if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
1667 if (container != LauncherSettings.Favorites.CONTAINER_DESKTOP) {
1669 values.put(LauncherSettings.Favorites.SCREEN, screen);
1670 values.put(LauncherSettings.Favorites.CELLX, cellX);
1671 values.put(LauncherSettings.Favorites.CELLY, cellY);
1677 values.put(LauncherSettings.Favorites.CONTAINER, container);
1679 if (itemType != Favorites.ITEM_TYPE_FOLDER) {
1698 values.put(LauncherSettings.Favorites.SCREEN,
1706 values.put(LauncherSettings.Favorites.CONTAINER,
1707 Favorites.CONTAINER_DESKTOP);
1719 if (values.getAsInteger(LauncherSettings.Favorites.CONTAINER) !=
1720 LauncherSettings.Favorites.CONTAINER_DESKTOP) {
1725 values.put(LauncherSettings.Favorites.SCREEN, curScreen);
1726 values.put(LauncherSettings.Favorites.CELLX, curX);
1727 values.put(LauncherSettings.Favorites.CELLY, curY);