Bug 1298783 - Pre: add notificationUri to highlights query r=Grisha
authorAndrzej Hunt <ahunt@mozilla.com>
Thu, 08 Sep 2016 16:54:43 -0700
changeset 315778 0b9c9000ac93d1e0ddfb603dbeece6ad784754db
parent 315777 1faeb0e59cad1c322ea11e7fb6ed7d5d5a920fed
child 315779 0963e4f0247107ded32c61eaf889a5b61170303e
push id20634
push usercbook@mozilla.com
push dateFri, 30 Sep 2016 10:10:13 +0000
treeherderfx-team@afe79b010d13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGrisha
bugs1298783
milestone52.0a1
Bug 1298783 - Pre: add notificationUri to highlights query r=Grisha This ensures that a DB modification will trigger a refresh of any clients using getHighlights(). MozReview-Commit-ID: Cauc89ryDHr
mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
--- a/mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
@@ -1238,17 +1238,22 @@ public class BrowserProvider extends Sha
                 "ORDER BY " + History.DATE_LAST_VISITED + " DESC " +
                 "LIMIT " + historyLimit + ")";
 
         final String query = "SELECT DISTINCT * " +
                 "FROM (" + bookmarksQuery + " " +
                 "UNION ALL " + historyQuery + ") " +
                 "GROUP BY " + Combined.URL + ";";
 
-        return db.rawQuery(query, null);
+        final Cursor cursor = db.rawQuery(query, null);
+
+        cursor.setNotificationUri(getContext().getContentResolver(),
+                BrowserContract.AUTHORITY_URI);
+
+        return cursor;
     }
 
     @Override
     public Cursor query(Uri uri, String[] projection, String selection,
             String[] selectionArgs, String sortOrder) {
         final int match = URI_MATCHER.match(uri);
 
         // Handle only queries requiring a writable DB connection here: most queries need only a readable