From d9201da55bd57032651ba84207cf95c938d2123d Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Tue, 28 Feb 2012 10:01:30 -0800 Subject: [PATCH] Setup composeUri for accounts in EmailProvider * Add intent filter in manifest Change-Id: Ifbacfcb6109d76d48dabb87eb45ea28ec4278ad8 --- AndroidManifest.xml | 10 ++++++++++ src/com/android/email/provider/EmailProvider.java | 12 +++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index b26a06777..d8fcb27a1 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -264,6 +264,16 @@ + + + + + diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 36f9535cb..d03aa82fc 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -2107,11 +2107,11 @@ outer: AccountCapabilities.SMART_REPLY | AccountCapabilities.UNDO; - private static final Uri BASE_SETTINGS_URI = - Uri.parse("content://ui.email.android.com/settings"); + private static final Uri BASE_EXTERNAL_URI = Uri.parse("content://ui.email.android.com"); - private static Uri getAccountSettingUri(String account) { - return BASE_SETTINGS_URI.buildUpon().appendQueryParameter("account", account).build(); + private static String getExternalUriString(String segment, String account) { + return BASE_EXTERNAL_URI.buildUpon().appendPath(segment) + .appendQueryParameter("account", account).build().toString(); } /** @@ -2147,8 +2147,10 @@ outer: } } values.put(UIProvider.AccountColumns.SETTINGS_INTENT_URI, - getAccountSettingUri(id).toString()); + getExternalUriString("settings", id)); StringBuilder sb = genSelect(sAccountListMap, uiProjection, values); + values.put(UIProvider.AccountColumns.COMPOSE_URI, + getExternalUriString("compose", id)); sb.append(" FROM " + Account.TABLE_NAME + " WHERE " + AccountColumns.ID + "=?"); return sb.toString(); }