From 903a0724c7cfd7c8d8eca790622d96d2c3ce63df Mon Sep 17 00:00:00 2001 From: John Reck Date: Wed, 9 Nov 2011 17:53:10 -0800 Subject: 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 --- src/com/android/browser/AddBookmarkPage.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/com/android/browser/AddBookmarkPage.java') 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 @@ public class AddBookmarkPage extends Activity } 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 @@ public class AddBookmarkPage extends Activity 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; } } -- cgit v1.1