am 7d888863: Merge "b/9564335. Add support for a maxAttachmentSize column in the Account table and connect the data to the Settings object in the existing location (SettingsColumns.MAX_ATTACHMENT_SIZE)." into ub-mail-klp-mr2

* commit '7d888863c4cda08c080479126f6668ff6abe7bb8':
  b/9564335. Add support for a maxAttachmentSize column in the Account table and connect the data to the Settings object in the existing location (SettingsColumns.MAX_ATTACHMENT_SIZE).
This commit is contained in:
Anthony Lee 2014-03-20 22:16:46 +00:00 committed by Android Git Automerger
commit 44ca30e591
4 changed files with 23 additions and 2 deletions

View File

@ -166,6 +166,7 @@ public final class Account extends EmailContent implements AccountColumns, Parce
public static final int CONTENT_SIGNATURE_COLUMN = 15;
public static final int CONTENT_POLICY_KEY_COLUMN = 16;
public static final int CONTENT_PING_DURATION_COLUMN = 17;
public static final int CONTENT_MAX_ATTACHMENT_SIZE_COLUMN = 18;
public static final String[] CONTENT_PROJECTION = new String[] {
RECORD_ID, AccountColumns.DISPLAY_NAME,
@ -175,7 +176,8 @@ public final class Account extends EmailContent implements AccountColumns, Parce
AccountColumns.COMPATIBILITY_UUID, AccountColumns.SENDER_NAME,
AccountColumns.RINGTONE_URI, AccountColumns.PROTOCOL_VERSION,
AccountColumns.NEW_MESSAGE_COUNT, AccountColumns.SECURITY_SYNC_KEY,
AccountColumns.SIGNATURE, AccountColumns.POLICY_KEY, AccountColumns.PING_DURATION
AccountColumns.SIGNATURE, AccountColumns.POLICY_KEY, AccountColumns.PING_DURATION,
AccountColumns.MAX_ATTACHMENT_SIZE
};
public static final int CONTENT_MAILBOX_TYPE_COLUMN = 1;

View File

@ -1619,6 +1619,8 @@ public abstract class EmailContent {
public static final String SIGNATURE = "signature";
// A foreign key into the Policy table
public static final String POLICY_KEY = "policyKey";
// Max upload attachment size.
public static final String MAX_ATTACHMENT_SIZE = "maxAttachmentSize";
// Current duration of the Exchange ping
public static final String PING_DURATION = "pingDuration";
}

View File

@ -163,7 +163,8 @@ public final class DBHelper {
// Version 122: Need to update Message_Updates and Message_Deletes to match previous.
// Version 123: Changed the duplicateMesage deletion trigger to ignore accounts that aren't
// exchange accounts.
public static final int DATABASE_VERSION = 123;
// Version 124: Added MAX_ATTACHMENT_SIZE to the account table
public static final int DATABASE_VERSION = 124;
// Any changes to the database format *must* include update-in-place code.
// Original version: 2
@ -481,6 +482,7 @@ public final class DBHelper {
+ AccountColumns.SECURITY_SYNC_KEY + " text, "
+ AccountColumns.SIGNATURE + " text, "
+ AccountColumns.POLICY_KEY + " integer, "
+ AccountColumns.MAX_ATTACHMENT_SIZE + " integer, "
+ AccountColumns.PING_DURATION + " integer"
+ ");";
db.execSQL("create table " + Account.TABLE_NAME + s);
@ -1317,6 +1319,19 @@ public final class DBHelper {
}
createDeleteDuplicateMessagesTrigger(mContext, db);
}
if (oldVersion <= 123) {
try {
db.execSQL("alter table " + Account.TABLE_NAME
+ " add column " + AccountColumns.MAX_ATTACHMENT_SIZE +" integer" + ";");
final ContentValues cv = new ContentValues(1);
cv.put(AccountColumns.MAX_ATTACHMENT_SIZE, 0);
db.update(Account.TABLE_NAME, cv, null, null);
} catch (final SQLException e) {
// Shouldn't be needed unless we're debugging and interrupt the process
LogUtils.w(TAG, "Exception upgrading EmailProvider.db from v123 to v124", e);
}
}
}
@Override

View File

@ -2463,6 +2463,8 @@ public class EmailProvider extends ContentProvider {
.add(UIProvider.AccountColumns.SettingsColumns.CONFIRM_ARCHIVE, "0")
.add(UIProvider.AccountColumns.SettingsColumns.CONVERSATION_VIEW_MODE,
Integer.toString(UIProvider.ConversationViewMode.UNDEFINED))
.add(UIProvider.AccountColumns.SettingsColumns.MAX_ATTACHMENT_SIZE,
AccountColumns.MAX_ATTACHMENT_SIZE)
.add(UIProvider.AccountColumns.SettingsColumns.VEILED_ADDRESS_PATTERN, null);
final String feedbackUri = context.getString(R.string.email_feedback_uri);