Bug 1267580 - Hide Reading List smartfolder if empty r=mcomella a=sylvestre
authorAndrzej Hunt <ahunt@mozilla.com>
Wed, 18 May 2016 08:59:56 -0700
changeset 333038 69d24df550f760a2a03368914d0cf4dc99903263
parent 333037 683a20539adac5be187179e8c0f32a503f9e91bf
child 333039 dd5adec22e6ac0a7e628d3c0bc1cec6567625a34
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella, sylvestre
bugs1267580
milestone48.0a2
Bug 1267580 - Hide Reading List smartfolder if empty r=mcomella a=sylvestre MozReview-Commit-ID: HIGkK9Z19aq
mobile/android/base/java/org/mozilla/gecko/db/LocalBrowserDB.java
--- a/mobile/android/base/java/org/mozilla/gecko/db/LocalBrowserDB.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/LocalBrowserDB.java
@@ -831,17 +831,19 @@ public class LocalBrowserDB implements B
         // We always want to show mobile bookmarks in the root view.
         if (folderId == Bookmarks.FIXED_ROOT_ID) {
             folderId = getFolderIdFromGuid(cr, Bookmarks.MOBILE_FOLDER_GUID);
 
             // We'll add a fake "Desktop Bookmarks" folder to the root view if desktop
             // bookmarks exist, so that the user can still access non-mobile bookmarks.
             addDesktopFolder = desktopBookmarksExist(cr);
             addScreenshotsFolder = AppConstants.SCREENSHOTS_IN_BOOKMARKS_ENABLED;
-            addReadingListFolder = true;
+
+            final int readingListItemCount = getBookmarkCountForFolder(cr, Bookmarks.FAKE_READINGLIST_SMARTFOLDER_ID);
+            addReadingListFolder = (readingListItemCount > 0);
         } else {
             addDesktopFolder = false;
             addScreenshotsFolder = false;
             addReadingListFolder = false;
         }
 
         final Cursor c;