Bug 760956 - Part 3: Add getSuggestedSites to BrowserDB r=rnewman
authorAndrzej Hunt <ahunt@mozilla.com>
Wed, 17 Feb 2016 09:28:13 -0800
changeset 322370 633a0cff7f55ec82a3b75b22e424dc5f68779912
parent 322369 d6e7971cd98b8db5ed78421652e52848d29f71fa
child 322371 613f1eb88443821b3a7c3787d14e1f0238e4a4d0
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs760956
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 760956 - Part 3: Add getSuggestedSites to BrowserDB r=rnewman We'll need access to the SuggestedSites in BrowserProvider when assembling the topsites query there, hence we need to allow access via BrowserDB. MozReview-Commit-ID: BkZghDhQGxr
mobile/android/base/java/org/mozilla/gecko/db/BrowserDB.java
mobile/android/base/java/org/mozilla/gecko/db/LocalBrowserDB.java
mobile/android/base/java/org/mozilla/gecko/db/StubBrowserDB.java
--- a/mobile/android/base/java/org/mozilla/gecko/db/BrowserDB.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/BrowserDB.java
@@ -171,12 +171,13 @@ public interface BrowserDB {
 
 
     public abstract Cursor getPinnedSites(ContentResolver cr, int limit);
     public abstract void pinSite(ContentResolver cr, String url, String title, int position);
     public abstract void unpinSite(ContentResolver cr, int position);
 
     public abstract boolean hideSuggestedSite(String url);
     public abstract void setSuggestedSites(SuggestedSites suggestedSites);
+    public abstract SuggestedSites getSuggestedSites();
     public abstract boolean hasSuggestedImageUrl(String url);
     public abstract String getSuggestedImageUrlForUrl(String url);
     public abstract int getSuggestedBackgroundColorForUrl(String url);
 }
--- a/mobile/android/base/java/org/mozilla/gecko/db/LocalBrowserDB.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/LocalBrowserDB.java
@@ -1630,16 +1630,21 @@ public class LocalBrowserDB implements B
     }
 
     @Override
     public void setSuggestedSites(SuggestedSites suggestedSites) {
         mSuggestedSites = suggestedSites;
     }
 
     @Override
+    public SuggestedSites getSuggestedSites() {
+        return mSuggestedSites;
+    }
+
+    @Override
     public boolean hasSuggestedImageUrl(String url) {
         if (mSuggestedSites == null) {
             return false;
         }
         return mSuggestedSites.contains(url);
     }
 
     @Override
--- a/mobile/android/base/java/org/mozilla/gecko/db/StubBrowserDB.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/StubBrowserDB.java
@@ -373,16 +373,20 @@ public class StubBrowserDB implements Br
     @RobocopTarget
     public Cursor getBookmarkForUrl(ContentResolver cr, String url) {
         return null;
     }
 
     public void setSuggestedSites(SuggestedSites suggestedSites) {
     }
 
+    public SuggestedSites getSuggestedSites() {
+        return null;
+    }
+
     public boolean hasSuggestedImageUrl(String url) {
         return false;
     }
 
     public String getSuggestedImageUrlForUrl(String url) {
         return null;
     }