From ef94d9285ea58e3db47871cd73b0e9270c673021 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Thu, 8 Mar 2012 08:16:23 -0800 Subject: [PATCH] Return searchUri with accounts; return empty cursor for now Change-Id: I160676a492ef359007676c3aa9f56f9015b64c64 --- src/com/android/email/provider/EmailProvider.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index f123ebadb..772e4e1d2 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -209,6 +209,7 @@ public class EmailProvider extends ContentProvider { private static final int UI_SETTINGS = UI_BASE + 13; private static final int UI_ATTACHMENTS = UI_BASE + 14; private static final int UI_ATTACHMENT = UI_BASE + 15; + private static final int UI_SEARCH = UI_BASE + 16; // MUST ALWAYS EQUAL THE LAST OF THE PREVIOUS BASE CONSTANTS private static final int LAST_EMAIL_PROVIDER_DB_BASE = UI_BASE; @@ -422,6 +423,7 @@ public class EmailProvider extends ContentProvider { matcher.addURI(EmailContent.AUTHORITY, "uisettings/#", UI_SETTINGS); matcher.addURI(EmailContent.AUTHORITY, "uiattachments/#", UI_ATTACHMENTS); matcher.addURI(EmailContent.AUTHORITY, "uiattachment/#", UI_ATTACHMENT); + matcher.addURI(EmailContent.AUTHORITY, "uisearch/#", UI_SEARCH); } /** @@ -1141,6 +1143,8 @@ public class EmailProvider extends ContentProvider { try { switch (match) { // First, dispatch queries from UnfiedEmail + case UI_SEARCH: + return uiSearch(uri, projection); case UI_ACCTS: c = uiAccounts(projection); return c; @@ -1975,6 +1979,7 @@ outer: .add(UIProvider.AccountColumns.UNDO_URI, uriWithId("uiundo")) .add(UIProvider.AccountColumns.URI, uriWithId("uiaccount")) .add(UIProvider.AccountColumns.SETTINGS_QUERY_URI, uriWithId("uisettings")) + .add(UIProvider.AccountColumns.SEARCH_URI, uriWithId("uisearch")) // TODO: Is this used? .add(UIProvider.AccountColumns.PROVIDER_VERSION, "1") .add(UIProvider.AccountColumns.SYNC_STATUS, "0") @@ -2306,6 +2311,10 @@ outer: return sb.toString(); } + private Cursor uiSearch(Uri uri, String[] projection) { + return new MatrixCursor(projection, 0); + } + /** * Handle UnifiedEmail queries here (dispatched from query()) *