Bug 970372 - Invalidate LocalBrowserDB cache when bookmarks content changes are observed. r=lucasr, a=sledru
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Tue, 18 Feb 2014 21:33:01 -0800
changeset 182941 06c41a48e27a669121b8cbfa9b170404606462bc
parent 182940 a47082eaf863998e18145e3f5a888808562b758e
child 182942 801ada2044a253a78b9de38d8c7ad03ee51e0b12
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, sledru
bugs970372
milestone29.0a2
Bug 970372 - Invalidate LocalBrowserDB cache when bookmarks content changes are observed. r=lucasr, a=sledru
mobile/android/base/home/BookmarksPanel.java
--- a/mobile/android/base/home/BookmarksPanel.java
+++ b/mobile/android/base/home/BookmarksPanel.java
@@ -118,20 +118,16 @@ public class BookmarksPanel extends Home
                 Bundle bundle = new Bundle();
                 bundle.putParcelable(BOOKMARKS_FOLDER_INFO, folderInfo);
                 bundle.putParcelable(BOOKMARKS_REFRESH_TYPE, refreshType);
                 getLoaderManager().restartLoader(LOADER_ID_BOOKMARKS_LIST, bundle, mLoaderCallbacks);
             }
         });
         mList.setAdapter(mListAdapter);
 
-        // Invalidate the cached value that keeps track of whether or
-        // not desktop bookmarks (or reading list items) exist.
-        BrowserDB.invalidateCachedState();
-
         // Create callbacks before the initial loader is started.
         mLoaderCallbacks = new CursorLoaderCallbacks();
         loadIfVisible();
     }
 
     @Override
     public void onDestroyView() {
         mList = null;
@@ -202,16 +198,24 @@ public class BookmarksPanel extends Home
             mRefreshType = refreshType;
         }
 
         @Override
         public Cursor loadCursor() {
             return BrowserDB.getBookmarksInFolder(getContext().getContentResolver(), mFolderInfo.id);
         }
 
+        @Override
+        public void onContentChanged() {
+            // Invalidate the cached value that keeps track of whether or
+            // not desktop bookmarks exist.
+            BrowserDB.invalidateCachedState();
+            super.onContentChanged();
+        }
+
         public FolderInfo getFolderInfo() {
             return mFolderInfo;
         }
 
         public RefreshType getRefreshType() {
             return mRefreshType;
         }
     }