Lines Matching full:favorites
53 import com.android.launcher2.LauncherSettings.Favorites;
74 static final String TABLE_FAVORITES = "favorites";
128 if (!values.containsKey(LauncherSettings.Favorites._ID)) {
135 Uri uri = LauncherSettings.Favorites.getContentUri(id, false);
226 // Populate favorites table with initial favorites
254 private static final String TAG_FAVORITES = "favorites";
296 db.execSQL("CREATE TABLE favorites (" +
352 // We already have a favorites database in the old provider
375 final int idIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites._ID);
376 final int intentIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.INTENT);
377 final int titleIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.TITLE);
378 final int iconTypeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_TYPE);
379 final int iconIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON);
380 final int iconPackageIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_PACKAGE);
381 final int iconResourceIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_RESOURCE);
382 final int containerIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CONTAINER);
383 final int itemTypeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.ITEM_TYPE);
384 final int screenIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.SCREEN);
385 final int cellXIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLX);
386 final int cellYIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.CELLY);
387 final int uriIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.URI);
388 final int displayModeIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites.DISPLAY_MODE);
394 values.put(LauncherSettings.Favorites._ID, c.getLong(idIndex));
395 values.put(LauncherSettings.Favorites.INTENT, c.getString(intentIndex));
396 values.put(LauncherSettings.Favorites.TITLE, c.getString(titleIndex));
397 values.put(LauncherSettings.Favorites.ICON_TYPE, c.getInt(iconTypeIndex));
398 values.put(LauncherSettings.Favorites.ICON, c.getBlob(iconIndex));
399 values.put(LauncherSettings.Favorites.ICON_PACKAGE, c.getString(iconPackageIndex));
400 values.put(LauncherSettings.Favorites.ICON_RESOURCE, c.getString(iconResourceIndex));
401 Favorites.CONTAINER, c.getInt(containerIndex));
402 values.put(LauncherSettings.Favorites.ITEM_TYPE, c.getInt(itemTypeIndex));
403 values.put(LauncherSettings.Favorites.APPWIDGET_ID, -1);
404 values.put(LauncherSettings.Favorites.SCREEN, c.getInt(screenIndex));
405 values.put(LauncherSettings.Favorites.CELLX, c.getInt(cellXIndex));
406 values.put(LauncherSettings.Favorites.CELLY, c.getInt(cellYIndex));
407 values.put(LauncherSettings.Favorites.URI, c.getString(uriIndex));
408 values.put(LauncherSettings.Favorites.DISPLAY_MODE, c.getInt(displayModeIndex));
441 db.execSQL("ALTER TABLE favorites " +
474 db.execSQL("UPDATE favorites SET screen=(screen + 1);");
534 final String selectWhere = buildOrWhereString(Favorites.ITEM_TYPE,
535 new int[] { Favorites.ITEM_TYPE_SHORTCUT });
543 new String[] { Favorites._ID, Favorites.INTENT },
549 final int idIndex = c.getColumnIndex(Favorites._ID);
550 final int intentIndex = c.getColumnIndex(Favorites.INTENT);
584 values.put(LauncherSettings.Favorites.INTENT,
587 String updateWhere = Favorites._ID + "=" + favoriteId;
621 update = db.compileStatement("UPDATE favorites "
624 c = db.rawQuery("SELECT _id, icon FROM favorites WHERE iconType=" +
625 Favorites.ICON_TYPE_BITMAP, null);
627 final int idIndex = c.getColumnIndexOrThrow(Favorites._ID);
628 final int iconIndex = c.getColumnIndexOrThrow(Favorites.ICON);
683 Cursor c = db.rawQuery("SELECT MAX(_id) FROM favorites", null);
709 Favorites.ITEM_TYPE_WIDGET_CLOCK,
710 Favorites.ITEM_TYPE_WIDGET_PHOTO_FRAME,
711 Favorites.ITEM_TYPE_WIDGET_SEARCH,
714 final String selectWhere = buildOrWhereString(Favorites.ITEM_TYPE, bindSources);
721 c = db.query(TABLE_FAVORITES, new String[] { Favorites._ID, Favorites.ITEM_TYPE },
740 values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPWIDGET);
741 values.put(Favorites.APPWIDGET_ID, appWidgetId);
744 if (favoriteType == Favorites.ITEM_TYPE_WIDGET_SEARCH) {
745 values.put(LauncherSettings.Favorites.SPANX, 4);
746 values.put(LauncherSettings.Favorites.SPANY, 1);
748 values.put(LauncherSettings.Favorites.SPANX, 2);
749 values.put(LauncherSettings.Favorites.SPANY, 2);
752 String updateWhere = Favorites._ID + "=" + favoriteId;
755 if (favoriteType == Favorites.ITEM_TYPE_WIDGET_CLOCK) {
760 } else if (favoriteType == Favorites.ITEM_TYPE_WIDGET_PHOTO_FRAME) {
765 } else if (favoriteType == Favorites.ITEM_TYPE_WIDGET_SEARCH) {
839 long container = LauncherSettings.Favorites.CONTAINER_DESKTOP;
851 if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT
857 values.put(LauncherSettings.Favorites.CONTAINER, container);
858 values.put(LauncherSettings.Favorites.SCREEN, screen);
859 values.put(LauncherSettings.Favorites.CELLX, x);
860 values.put(LauncherSettings.Favorites.CELLY, y);
882 values.put(LauncherSettings.Favorites.TITLE, title);
899 values.put(LauncherSettings.Favorites.CONTAINER, folderId);
934 Log.w(TAG, "Got exception parsing favorites.", e);
936 Log.w(TAG, "Got exception parsing favorites.", e);
938 Log.w(TAG, "Got exception parsing favorites.", e);
965 values.put(Favorites.INTENT, intent.toUri(0));
966 values.put(Favorites.TITLE, info.loadLabel(packageManager).toString());
967 values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPLICATION);
968 values.put(Favorites.SPANX, 1);
969 values.put(Favorites.SPANY, 1);
970 values.put(Favorites._ID, generateNewId());
982 values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_FOLDER);
983 values.put(Favorites.SPANX, 1);
984 values.put(Favorites.SPANY, 1);
986 values.put(Favorites._ID, id);
1099 values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPWIDGET);
1100 values.put(Favorites.SPANX, spanX);
1101 values.put(Favorites.SPANY, spanY);
1102 values.put(Favorites
1103 values.put(Favorites._ID, generateNewId());
1150 values.put(Favorites.INTENT, intent.toUri(0));
1151 values.put(Favorites.TITLE, r.getString(titleResId));
1152 values.put(Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_SHORTCUT);
1153 values.put(Favorites.SPANX, 1);
1154 values.put(Favorites.SPANY, 1);
1155 values.put(Favorites.ICON_TYPE, Favorites.ICON_TYPE_RESOURCE);
1156 values.put(Favorites.ICON_PACKAGE, mContext.getPackageName());
1157 values.put(Favorites.ICON_RESOURCE, r.getResourceName(iconResId));
1158 values.put(Favorites._ID, id);