am 1e6561dd: (-s ours) am 17f1fe1a: Reconcile with jb-mr1-factory-release jb-mr1-release - do not merge

* commit '1e6561ddfc941d51592a4285c8fe2d054ed29f02':
diff --git a/src/com/android/providers/contacts/ContactsProvider2.java b/src/com/android/providers/contacts/ContactsProvider2.java
index 08e26ef..b91e577 100644
--- a/src/com/android/providers/contacts/ContactsProvider2.java
+++ b/src/com/android/providers/contacts/ContactsProvider2.java
@@ -5932,7 +5932,7 @@
 
             case SEARCH_SUGGESTIONS: {
                 return mGlobalSearchSupport.handleSearchSuggestionsQuery(
-                        db, uri, projection, limit);
+                        db, uri, projection, limit, cancellationSignal);
             }
 
             case SEARCH_SHORTCUT: {
@@ -5940,7 +5940,7 @@
                 String filter = getQueryParameter(
                         uri, SearchManager.SUGGEST_COLUMN_INTENT_EXTRA_DATA);
                 return mGlobalSearchSupport.handleSearchShortcutRefresh(
-                        db, projection, lookupKey, filter);
+                        db, projection, lookupKey, filter, cancellationSignal);
             }
 
             case RAW_CONTACT_ENTITIES:
diff --git a/src/com/android/providers/contacts/GlobalSearchSupport.java b/src/com/android/providers/contacts/GlobalSearchSupport.java
index d4cddee..0febf56 100644
--- a/src/com/android/providers/contacts/GlobalSearchSupport.java
+++ b/src/com/android/providers/contacts/GlobalSearchSupport.java
@@ -22,6 +22,7 @@
 import android.database.MatrixCursor;
 import android.database.sqlite.SQLiteDatabase;
 import android.net.Uri;
+import android.os.CancellationSignal;
 import android.provider.ContactsContract.CommonDataKinds.Email;
 import android.provider.ContactsContract.CommonDataKinds.Organization;
 import android.provider.ContactsContract.CommonDataKinds.Phone;
@@ -178,8 +179,8 @@
         }
     }
 
-    public Cursor handleSearchSuggestionsQuery(
-            SQLiteDatabase db, Uri uri, String[] projection, String limit) {
+    public Cursor handleSearchSuggestionsQuery(SQLiteDatabase db, Uri uri, String[] projection,
+            String limit, CancellationSignal cancellationSignal) {
         final MatrixCursor cursor = new MatrixCursor(
                 projection == null ? SEARCH_SUGGESTIONS_COLUMNS : projection);
 
@@ -189,7 +190,7 @@
             String selection = null;
             String searchClause = uri.getLastPathSegment();
             addSearchSuggestionsBasedOnFilter(
-                    cursor, db, projection, selection, searchClause, limit);
+                    cursor, db, projection, selection, searchClause, limit, cancellationSignal);
         }
 
         return cursor;
@@ -206,7 +207,7 @@
      * instead of the lookup key.
      */
     public Cursor handleSearchShortcutRefresh(SQLiteDatabase db, String[] projection,
-            String lookupKey, String filter) {
+            String lookupKey, String filter, CancellationSignal cancellationSignal) {
         long contactId;
         try {
             contactId = mContactsProvider.lookupContactIdByLookupKey(db, lookupKey);
@@ -216,11 +217,13 @@
         MatrixCursor cursor = new MatrixCursor(
                 projection == null ? SEARCH_SUGGESTIONS_COLUMNS : projection);
         return addSearchSuggestionsBasedOnFilter(cursor,
-                db, projection, ContactsColumns.CONCRETE_ID + "=" + contactId, filter, null);
+                db, projection, ContactsColumns.CONCRETE_ID + "=" + contactId, filter, null,
+                cancellationSignal);
     }
 
     private Cursor addSearchSuggestionsBasedOnFilter(MatrixCursor cursor, SQLiteDatabase db,
-            String[] projection, String selection, String filter, String limit) {
+            String[] projection, String selection, String filter, String limit,
+            CancellationSignal cancellationSignal) {
         StringBuilder sb = new StringBuilder();
         final boolean haveFilter = !TextUtils.isEmpty(filter);
         sb.append("SELECT "
@@ -247,7 +250,7 @@
         if (limit != null) {
             sb.append(" LIMIT " + limit);
         }
-        Cursor c = db.rawQuery(sb.toString(), null);
+        Cursor c = db.rawQuery(sb.toString(), null, cancellationSignal);
         SearchSuggestion suggestion = new SearchSuggestion();
         suggestion.filter = filter;
         try {
diff --git a/src/com/android/providers/contacts/LegacyApiSupport.java b/src/com/android/providers/contacts/LegacyApiSupport.java
index 9859d11..1ed7488 100644
--- a/src/com/android/providers/contacts/LegacyApiSupport.java
+++ b/src/com/android/providers/contacts/LegacyApiSupport.java
@@ -1877,13 +1877,13 @@
 
             case SEARCH_SUGGESTIONS:
                 return mGlobalSearchSupport.handleSearchSuggestionsQuery(
-                        db, uri, projection, limit);
+                        db, uri, projection, limit, null);
 
             case SEARCH_SHORTCUT: {
                 String lookupKey = uri.getLastPathSegment();
                 String filter = ContactsProvider2.getQueryParameter(uri, "filter");
                 return mGlobalSearchSupport.handleSearchShortcutRefresh(
-                        db, projection, lookupKey, filter);
+                        db, projection, lookupKey, filter, null);
             }
 
             case LIVE_FOLDERS_PEOPLE: