Setup composeUri for accounts in EmailProvider

* Add intent filter in manifest

Change-Id: Ifbacfcb6109d76d48dabb87eb45ea28ec4278ad8
This commit is contained in:
Marc Blank 2012-02-28 10:01:30 -08:00
parent 8c4b6e40cf
commit d9201da55b
2 changed files with 17 additions and 5 deletions

View File

@ -264,6 +264,16 @@
<action
android:name="com.android.email.intent.action.REPLY" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category
android:name="android.intent.category.DEFAULT" />
<data
android:scheme="content"
android:host="ui.email.android.com"
android:pathPrefix="/compose"
/>
</intent-filter>
</activity>
<!-- Only used to support pre-HC shortcuts -->

View File

@ -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();
}