Special case the root folder in add bookmarks
Bug: 5505282
The special "Other Bookmarks" folder isn't a child of the special
"Bookmarks" folder. The merging of those two is only handled if
the URI is CONTENT_URI_DEFAULT_FOLDER, not if a specific folder
id is given. Thus we need to special case that in the AddBookmarkPage
loader.
Change-Id: Ic92fba5ea8c758fc153a9cfd0c567bcfdcbc524d
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java
index ae5ae69..fdb34c4 100644
--- a/src/com/android/browser/AddBookmarkPage.java
+++ b/src/com/android/browser/AddBookmarkPage.java
@@ -145,6 +145,13 @@
}
private Uri getUriForFolder(long folder) {
+ BookmarkAccount account =
+ (BookmarkAccount) mAccountSpinner.getSelectedItem();
+ if (folder == mRootFolder && account != null) {
+ return BookmarksLoader.addAccount(
+ BrowserContract.Bookmarks.CONTENT_URI_DEFAULT_FOLDER,
+ account.accountType, account.accountName);
+ }
return BrowserContract.Bookmarks.buildFolderUri(folder);
}
@@ -437,8 +444,8 @@
BookmarkAccount account = mAccountAdapter.getItem(i);
if (TextUtils.equals(account.accountName, accountName)
&& TextUtils.equals(account.accountType, accountType)) {
- onRootFolderFound(account.rootFolderId);
mAccountSpinner.setSelection(i);
+ onRootFolderFound(account.rootFolderId);
return;
}
}