Merge "Enable supression of combined account" into ub-mail-master
This commit is contained in:
commit
c24d5d4f19
@ -144,6 +144,11 @@ public abstract class EmailContent {
|
|||||||
public static String NOTIFIER_AUTHORITY;
|
public static String NOTIFIER_AUTHORITY;
|
||||||
public static Uri CONTENT_URI;
|
public static Uri CONTENT_URI;
|
||||||
public static final String PARAMETER_LIMIT = "limit";
|
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 CONTENT_NOTIFIER_URI;
|
||||||
public static Uri PICK_TRASH_FOLDER_URI;
|
public static Uri PICK_TRASH_FOLDER_URI;
|
||||||
public static Uri PICK_SENT_FOLDER_URI;
|
public static Uri PICK_SENT_FOLDER_URI;
|
||||||
|
@ -1289,7 +1289,11 @@ public class EmailProvider extends ContentProvider
|
|||||||
c = uiSearch(uri, projection);
|
c = uiSearch(uri, projection);
|
||||||
return c;
|
return c;
|
||||||
case UI_ACCTS:
|
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;
|
return c;
|
||||||
case UI_UNDO:
|
case UI_UNDO:
|
||||||
return uiUndo(projection);
|
return uiUndo(projection);
|
||||||
@ -3801,7 +3805,7 @@ public class EmailProvider extends ContentProvider
|
|||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Cursor uiAccounts(String[] uiProjection) {
|
private Cursor uiAccounts(String[] uiProjection, boolean suppressCombined) {
|
||||||
final Context context = getContext();
|
final Context context = getContext();
|
||||||
final SQLiteDatabase db = getDatabase(context);
|
final SQLiteDatabase db = getDatabase(context);
|
||||||
final Cursor accountIdCursor =
|
final Cursor accountIdCursor =
|
||||||
@ -3809,7 +3813,7 @@ public class EmailProvider extends ContentProvider
|
|||||||
final MatrixCursor mc;
|
final MatrixCursor mc;
|
||||||
try {
|
try {
|
||||||
boolean combinedAccount = false;
|
boolean combinedAccount = false;
|
||||||
if (accountIdCursor.getCount() > 1) {
|
if (!suppressCombined && accountIdCursor.getCount() > 1) {
|
||||||
combinedAccount = true;
|
combinedAccount = true;
|
||||||
}
|
}
|
||||||
final Bundle extras = new Bundle();
|
final Bundle extras = new Bundle();
|
||||||
|
Loading…
Reference in New Issue
Block a user