mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-05 03:54:35 +00:00
Bug 708485 - Create "mobile" special bookmarks folder on DB creation (r=blassey, a=mfinkle)
This commit is contained in:
parent
97466ba4ae
commit
98655b3f10
@ -93,6 +93,13 @@ public class BrowserContract {
|
||||
public static final class Bookmarks implements CommonColumns, URLColumns, ImageColumns, SyncColumns {
|
||||
private Bookmarks() {}
|
||||
|
||||
public static final String MOBILE_FOLDER_GUID = "mobile";
|
||||
public static final String PLACES_FOLDER_GUID = "places";
|
||||
public static final String MENU_FOLDER_GUID = "menu";
|
||||
public static final String TAGS_FOLDER_GUID = "tags";
|
||||
public static final String TOOLBAR_FOLDER_GUID = "toolbar";
|
||||
public static final String UNFILED_FOLDER_GUID = "unfiled";
|
||||
|
||||
public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "bookmarks");
|
||||
|
||||
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/bookmark";
|
||||
@ -133,4 +140,4 @@ public class BrowserContract {
|
||||
|
||||
public static final String VERSION = "version";
|
||||
}
|
||||
}
|
||||
}
|
@ -341,9 +341,24 @@ public class BrowserProvider extends ContentProvider {
|
||||
", " + Images.FAVICON + ", " + Images.THUMBNAIL + " FROM " +
|
||||
TABLE_HISTORY_JOIN_IMAGES);
|
||||
|
||||
createMobileBookmarksFolder(db);
|
||||
|
||||
// FIXME: Create default bookmarks here
|
||||
}
|
||||
|
||||
private void createMobileBookmarksFolder(SQLiteDatabase db) {
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(Bookmarks.GUID, Bookmarks.MOBILE_FOLDER_GUID);
|
||||
values.put(Bookmarks.IS_FOLDER, 1);
|
||||
values.put(Bookmarks.POSITION, 0);
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
values.put(Bookmarks.DATE_CREATED, now);
|
||||
values.put(Bookmarks.DATE_MODIFIED, now);
|
||||
|
||||
db.insertOrThrow(TABLE_BOOKMARKS, Bookmarks.GUID, values);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
Log.d(LOGTAG, "Upgrading browser.db: " + db.getPath() + " from " +
|
||||
|
Loading…
Reference in New Issue
Block a user