summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Westbrook <pwestbro@google.com>2014-06-20 00:09:07 -0700
committerPaul Westbrook <pwestbro@google.com>2014-06-20 00:09:07 -0700
commit4038f464dee0a33f1e7a58102857c24edf7e0eb2 (patch)
treee7f217d79112cce433e2e3f0b66f4164e690675e
parentb63b39d03e2b1f5ea3998459d1ba96124316d907 (diff)
downloadandroid_packages_apps_Email-4038f464dee0a33f1e7a58102857c24edf7e0eb2.tar.gz
android_packages_apps_Email-4038f464dee0a33f1e7a58102857c24edf7e0eb2.tar.bz2
android_packages_apps_Email-4038f464dee0a33f1e7a58102857c24edf7e0eb2.zip
Enable supression of combined account
This enables the client of the provider to suppress the email combined account. Later, the UI can enable a combined account that spans all of the account types Change-Id: I77e201f751019240af2274a1f74e2124b9889aab
-rwxr-xr-xemailcommon/src/com/android/emailcommon/provider/EmailContent.java5
-rw-r--r--src/com/android/email/provider/EmailProvider.java10
2 files changed, 12 insertions, 3 deletions
diff --git a/emailcommon/src/com/android/emailcommon/provider/EmailContent.java b/emailcommon/src/com/android/emailcommon/provider/EmailContent.java
index a10e91db8..0ae908d7e 100755
--- a/emailcommon/src/com/android/emailcommon/provider/EmailContent.java
+++ b/emailcommon/src/com/android/emailcommon/provider/EmailContent.java
@@ -144,6 +144,11 @@ public abstract class EmailContent {
public static String NOTIFIER_AUTHORITY;
public static Uri CONTENT_URI;
public static final String PARAMETER_LIMIT = "limit";
+
+ /**
+ * Query parameter for the UI accounts query to enable suppression of the combined account.
+ */
+ public static final String SUPPRESS_COMBINED_ACCOUNT_PARAM = "suppress_combined";
public static Uri CONTENT_NOTIFIER_URI;
public static Uri PICK_TRASH_FOLDER_URI;
public static Uri PICK_SENT_FOLDER_URI;
diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java
index 479bba7a0..5779c6d53 100644
--- a/src/com/android/email/provider/EmailProvider.java
+++ b/src/com/android/email/provider/EmailProvider.java
@@ -1289,7 +1289,11 @@ public class EmailProvider extends ContentProvider
c = uiSearch(uri, projection);
return c;
case UI_ACCTS:
- c = uiAccounts(projection);
+ final String suppressParam =
+ uri.getQueryParameter(EmailContent.SUPPRESS_COMBINED_ACCOUNT_PARAM);
+ final boolean suppressCombined =
+ suppressParam != null && Boolean.parseBoolean(suppressParam);
+ c = uiAccounts(projection, suppressCombined);
return c;
case UI_UNDO:
return uiUndo(projection);
@@ -3801,7 +3805,7 @@ public class EmailProvider extends ContentProvider
return values;
}
- private Cursor uiAccounts(String[] uiProjection) {
+ private Cursor uiAccounts(String[] uiProjection, boolean suppressCombined) {
final Context context = getContext();
final SQLiteDatabase db = getDatabase(context);
final Cursor accountIdCursor =
@@ -3809,7 +3813,7 @@ public class EmailProvider extends ContentProvider
final MatrixCursor mc;
try {
boolean combinedAccount = false;
- if (accountIdCursor.getCount() > 1) {
+ if (!suppressCombined && accountIdCursor.getCount() > 1) {
combinedAccount = true;
}
final Bundle extras = new Bundle();