diff options
author | yingying <yingying@codeaurora.org> | 2014-01-08 15:53:54 +0800 |
---|---|---|
committer | Adnan <adnan@cyngn.com> | 2014-09-03 15:41:22 -0700 |
commit | dae8c5ed80cc3f2ee243fb9cf22b25cd20a3a4f1 (patch) | |
tree | 6a60120391092c2cf25540f16d66c0d10f8bddd8 | |
parent | 6a21a9a61394681dcb03878aaa8aacf67a9660ad (diff) | |
download | android_packages_apps_UnifiedEmail-dae8c5ed80cc3f2ee243fb9cf22b25cd20a3a4f1.tar.gz android_packages_apps_UnifiedEmail-dae8c5ed80cc3f2ee243fb9cf22b25cd20a3a4f1.tar.bz2 android_packages_apps_UnifiedEmail-dae8c5ed80cc3f2ee243fb9cf22b25cd20a3a4f1.zip |
UnifiedEmail: Display the confirm dialog before forward.
- Display the confirm dialog before forward one mail if the user enable
"Confirm before forward" function.
- The user could choose "send after loaded" or "drop the attachments".
- If the account support smart forward, it will not show this dialog.
Change-Id: I4af283e05214e691fcb16a9351480126aee93bba
-rw-r--r-- | res/values-zh-rCN/cm_strings.xml | 3 | ||||
-rw-r--r-- | res/values-zh-rHK/cm_strings.xml | 22 | ||||
-rw-r--r-- | res/values-zh-rTW/cm_strings.xml | 22 | ||||
-rw-r--r-- | res/values/cm_strings.xml | 4 | ||||
-rw-r--r-- | src/com/android/mail/browse/MessageHeaderView.java | 55 | ||||
-rw-r--r-- | src/com/android/mail/compose/ComposeActivity.java | 58 | ||||
-rw-r--r-- | src/com/android/mail/compose/QuotedTextView.java | 3 | ||||
-rw-r--r-- | src/com/android/mail/providers/Attachment.java | 4 | ||||
-rw-r--r-- | src/com/android/mail/providers/Settings.java | 15 | ||||
-rw-r--r-- | src/com/android/mail/providers/UIProvider.java | 12 | ||||
-rw-r--r-- | src/com/android/mail/providers/protos/mock/MockUiProvider.java | 4 |
11 files changed, 182 insertions, 20 deletions
diff --git a/res/values-zh-rCN/cm_strings.xml b/res/values-zh-rCN/cm_strings.xml index 67fde0485..3e1a4f2a3 100644 --- a/res/values-zh-rCN/cm_strings.xml +++ b/res/values-zh-rCN/cm_strings.xml @@ -16,4 +16,7 @@ limitations under the License. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="confirm_forward_message">"若该邮件含有未下载的附件,如何转发该邮件?"</string> + <string name="confirm_forward_normal">"下载完成后发送"</string> + <string name="confirm_forward_drop_unloaded">"舍弃未完成的附件"</string> </resources> diff --git a/res/values-zh-rHK/cm_strings.xml b/res/values-zh-rHK/cm_strings.xml new file mode 100644 index 000000000..1b1f10940 --- /dev/null +++ b/res/values-zh-rHK/cm_strings.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!--Generated by crowdin.net--> +<!-- + Copyright (C) 2014 The CyanogenMod Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="confirm_forward_message">"若該訊息含有未下載的附件,如何轉寄該訊息?"</string> + <string name="confirm_forward_normal">"下載完成后發送"</string> + <string name="confirm_forward_drop_unloaded">"捨弃未完成的附件"</string> +</resources> diff --git a/res/values-zh-rTW/cm_strings.xml b/res/values-zh-rTW/cm_strings.xml new file mode 100644 index 000000000..1b1f10940 --- /dev/null +++ b/res/values-zh-rTW/cm_strings.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!--Generated by crowdin.net--> +<!-- + Copyright (C) 2014 The CyanogenMod Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <string name="confirm_forward_message">"若該訊息含有未下載的附件,如何轉寄該訊息?"</string> + <string name="confirm_forward_normal">"下載完成后發送"</string> + <string name="confirm_forward_drop_unloaded">"捨弃未完成的附件"</string> +</resources> diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index ea414c7a4..346511888 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -15,4 +15,8 @@ limitations under the License. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- Confirm forward message --> + <string name="confirm_forward_message">Message has unloaded attachment(s), select action</string> + <string name="confirm_forward_normal">Send after loaded</string> + <string name="confirm_forward_drop_unloaded">Drop unloaded</string> </resources> diff --git a/src/com/android/mail/browse/MessageHeaderView.java b/src/com/android/mail/browse/MessageHeaderView.java index f5b02f51b..bc929e90d 100644 --- a/src/com/android/mail/browse/MessageHeaderView.java +++ b/src/com/android/mail/browse/MessageHeaderView.java @@ -16,15 +16,19 @@ package com.android.mail.browse; +import android.app.AlertDialog; +import android.app.Dialog; import android.app.DialogFragment; import android.app.FragmentManager; import android.content.AsyncQueryHandler; import android.content.Context; +import android.content.DialogInterface; import android.content.res.Resources; import android.database.DataSetObserver; import android.graphics.Bitmap; import android.graphics.Typeface; import android.os.Build; +import android.os.Bundle; import android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.Spanned; @@ -61,6 +65,7 @@ import com.android.mail.providers.Folder; import com.android.mail.providers.Message; import com.android.mail.providers.UIProvider; import com.android.mail.providers.UIProvider.MessageFlagLoaded; +import com.android.mail.providers.UIProvider.AccountCapabilities; import com.android.mail.ui.ImageCanvas; import com.android.mail.utils.LogTag; import com.android.mail.utils.LogUtils; @@ -895,7 +900,17 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, } else if (id == R.id.reply_all) { ComposeActivity.replyAll(getContext(), getAccount(), mMessage); } else if (id == R.id.forward) { - ComposeActivity.forward(getContext(), getAccount(), mMessage); + if (mMessage.hasAttachments && getAccount().settings.confirmForward + && (getAccount().capabilities & AccountCapabilities.SMART_FORWARD) == 0) { + // Enabled the confirm before forward and do not support smart forward + // Prompt the confirm dialog first, then forward the message according + // to the user's selection. + ConfirmForwardDialogFragment dialog = ConfirmForwardDialogFragment.newInstance( + getAccount(), mMessage); + dialog.displayDialog(mCallbacks.getFragmentManager()); + } else { + ComposeActivity.forward(getContext(), getAccount(), mMessage); + } } else if (id == R.id.report_rendering_problem) { final String text = getContext().getString(R.string.report_rendering_problem_desc); ComposeActivity.reportRenderingFeedback(getContext(), getAccount(), mMessage, @@ -1543,4 +1558,42 @@ public class MessageHeaderView extends LinearLayout implements OnClickListener, t.pause(MEASURE_TAG); } } + + public static class ConfirmForwardDialogFragment extends ConfirmDialogFragment { + private static final String ACCOUNT = "account"; + private static final String MESSAGE = "source-message"; + + public static ConfirmForwardDialogFragment newInstance(Account account, Message message) { + final ConfirmForwardDialogFragment f = new ConfirmForwardDialogFragment(); + final Bundle args = new Bundle(); + args.putParcelable(ACCOUNT, account); + args.putParcelable(MESSAGE, message); + f.setArguments(args); + return f; + } + + @Override + public Dialog onCreateDialog(Bundle savedState) { + final Account account = getArguments().getParcelable(ACCOUNT); + final Message message = getArguments().getParcelable(MESSAGE); + + final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + builder.setMessage(R.string.confirm_forward_message) + .setPositiveButton(R.string.confirm_forward_normal, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + ComposeActivity.forward(getActivity(), account, message); + } + }) + .setNeutralButton(R.string.confirm_forward_drop_unloaded, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + ComposeActivity.forwardDropUnloadedAtts(getActivity(), account, message); + } + }); + return builder.create(); + } + } } diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java index d15eacf8c..443481197 100644 --- a/src/com/android/mail/compose/ComposeActivity.java +++ b/src/com/android/mail/compose/ComposeActivity.java @@ -132,7 +132,8 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi public static final int REPLY = 0; public static final int REPLY_ALL = 1; public static final int FORWARD = 2; - public static final int EDIT_DRAFT = 3; + public static final int FORWARD_DROP_UNLOADED_ATTS = 3; + public static final int EDIT_DRAFT = 4; // Integer extra holding one of the above compose action protected static final String EXTRA_ACTION = "action"; @@ -407,6 +408,14 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi launch(launcher, account, message, FORWARD, null, null, null, null, null /* extraValues */); } + /** + * Can be called from a non-UI thread. + */ + public static void forwardDropUnloadedAtts(Context launcher, Account account, Message message) { + launch(launcher, account, message, FORWARD_DROP_UNLOADED_ATTS, + null, null, null, null, null /* extraValues */); + } + public static void reportRenderingFeedback(Context launcher, Account account, Message message, String body) { launch(launcher, account, message, FORWARD, @@ -576,7 +585,10 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi getLoaderManager().initLoader(REFERENCE_MESSAGE_LOADER, null, this); return; } - } else if ((action == REPLY || action == REPLY_ALL || action == FORWARD)) { + } else if ((action == REPLY + || action == REPLY_ALL + || action == FORWARD + || action == FORWARD_DROP_UNLOADED_ATTS)) { if (mRefMessage != null) { initFromRefMessage(action); mShowQuotedText = true; @@ -587,7 +599,8 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi } } - mComposeMode = action; + // As the action maybe drop unloaded attachments, so adjust the compose mode. + mComposeMode = action == FORWARD_DROP_UNLOADED_ATTS ? FORWARD : action; finishSetup(action, intent, savedState); } @@ -728,6 +741,7 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi switch (action) { case FORWARD: case COMPOSE: + case FORWARD_DROP_UNLOADED_ATTS: if (TextUtils.isEmpty(mTo.getText())) { mTo.requestFocus(); break; @@ -1259,6 +1273,7 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi actionBar.setSelectedNavigationItem(1); break; case ComposeActivity.FORWARD: + case ComposeActivity.FORWARD_DROP_UNLOADED_ATTS: actionBar.setSelectedNavigationItem(2); break; } @@ -1301,13 +1316,15 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi private void setFieldsFromRefMessage(int action) { setSubject(mRefMessage, action); // Setup recipients - if (action == FORWARD) { + if (action == FORWARD || action == FORWARD_DROP_UNLOADED_ATTS) { mForward = true; } initRecipientsFromRefMessage(mRefMessage, action); initQuotedTextFromRefMessage(mRefMessage, action); - if (action == ComposeActivity.FORWARD || mAttachmentsChanged) { - initAttachments(mRefMessage); + if (action == ComposeActivity.FORWARD + || action == ComposeActivity.FORWARD_DROP_UNLOADED_ATTS + || mAttachmentsChanged) { + initAttachments(mRefMessage, action == ComposeActivity.FORWARD_DROP_UNLOADED_ATTS); } } @@ -1547,15 +1564,18 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi } @VisibleForTesting - protected void initAttachments(Message refMessage) { - addAttachments(refMessage.getAttachments()); + protected void initAttachments(Message refMessage, boolean dropUnloaded) { + addAttachments(refMessage.getAttachments(), dropUnloaded); } - public long addAttachments(List<Attachment> attachments) { + public long addAttachments(List<Attachment> attachments, boolean dropUnloaded) { long size = 0; AttachmentFailureException error = null; for (Attachment a : attachments) { try { + if (dropUnloaded && !a.isDownloadFinished()) { + continue; + } size += mAttachmentsView.addAttachment(mAccount, a); } catch (AttachmentFailureException e) { error = e; @@ -1641,7 +1661,7 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi (R.string.generic_attachment_problem, maxSize)); } } - totalSize += addAttachments(attachments); + totalSize += addAttachments(attachments, false); } else { final Uri uri = (Uri) extras.getParcelable(Intent.EXTRA_STREAM); long size = 0; @@ -1676,8 +1696,13 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi } private void initQuotedTextFromRefMessage(Message refMessage, int action) { - if (mRefMessage != null && (action == REPLY || action == REPLY_ALL || action == FORWARD)) { - mQuotedTextView.setQuotedText(action, refMessage, action != FORWARD); + if (mRefMessage != null + && (action == REPLY + || action == REPLY_ALL + || action == FORWARD + || action == FORWARD_DROP_UNLOADED_ATTS)) { + mQuotedTextView.setQuotedText(action, refMessage, + action != FORWARD || action != FORWARD_DROP_UNLOADED_ATTS); } } @@ -1756,7 +1781,8 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi void initRecipientsFromRefMessage(Message refMessage, int action) { // Don't populate the address if this is a forward. - if (action == ComposeActivity.FORWARD) { + if (action == ComposeActivity.FORWARD + || action == ComposeActivity.FORWARD_DROP_UNLOADED_ATTS) { return; } initReplyRecipients(refMessage, action); @@ -1956,7 +1982,8 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi String prefix; if (action == ComposeActivity.COMPOSE) { prefix = ""; - } else if (action == ComposeActivity.FORWARD) { + } else if (action == ComposeActivity.FORWARD + || action == ComposeActivity.FORWARD_DROP_UNLOADED_ATTS) { prefix = res.getString(R.string.forward_subject_label); } else { prefix = res.getString(R.string.reply_subject_label); @@ -3065,6 +3092,9 @@ public class ComposeActivity extends Activity implements OnClickListener, OnNavi case FORWARD: msgType = "forward"; break; + case FORWARD_DROP_UNLOADED_ATTS: + msgType = "forward_drop_unloaded_atts"; + break; default: msgType = "unknown"; break; diff --git a/src/com/android/mail/compose/QuotedTextView.java b/src/com/android/mail/compose/QuotedTextView.java index 8ebac6f25..ad80c7a2e 100644 --- a/src/com/android/mail/compose/QuotedTextView.java +++ b/src/com/android/mail/compose/QuotedTextView.java @@ -265,7 +265,8 @@ class QuotedTextView extends LinearLayout implements OnClickListener { quotedText.append(htmlText); quotedText.append(BLOCKQUOTE_END); quotedText.append(QUOTE_END); - } else if (action == ComposeActivity.FORWARD) { + } else if (action == ComposeActivity.FORWARD + || action == ComposeActivity.FORWARD_DROP_UNLOADED_ATTS) { quotedText.append(sQuoteBegin); quotedText .append(String.format(resources.getString(R.string.forward_attribution), Utils diff --git a/src/com/android/mail/providers/Attachment.java b/src/com/android/mail/providers/Attachment.java index 7ba839990..369ca4bf0 100644 --- a/src/com/android/mail/providers/Attachment.java +++ b/src/com/android/mail/providers/Attachment.java @@ -440,6 +440,10 @@ public class Attachment implements Parcelable { return state == AttachmentState.FAILED; } + public boolean isDownloadFinished() { + return state == AttachmentState.SAVED; + } + public boolean isDownloadFinishedOrFailed() { return state == AttachmentState.FAILED || state == AttachmentState.SAVED; } diff --git a/src/com/android/mail/providers/Settings.java b/src/com/android/mail/providers/Settings.java index e2c99e19e..9a1396aff 100644 --- a/src/com/android/mail/providers/Settings.java +++ b/src/com/android/mail/providers/Settings.java @@ -74,6 +74,7 @@ public class Settings implements Parcelable { public final boolean confirmDelete; public final boolean confirmArchive; public final boolean confirmSend; + public final boolean confirmForward; public final boolean addAttachment; public final boolean selectRecipients; public final int conversationViewMode; @@ -118,6 +119,7 @@ public class Settings implements Parcelable { confirmDelete = false; confirmArchive = false; confirmSend = false; + confirmForward = false; addAttachment = true; selectRecipients = true; defaultInbox = Uri.EMPTY; @@ -143,6 +145,7 @@ public class Settings implements Parcelable { confirmDelete = inParcel.readInt() != 0; confirmArchive = inParcel.readInt() != 0; confirmSend = inParcel.readInt() != 0; + confirmForward = inParcel.readInt() != 0; addAttachment = inParcel.readInt() != 0; selectRecipients = inParcel.readInt() != 0; defaultInbox = Utils.getValidUri(inParcel.readString()); @@ -169,6 +172,7 @@ public class Settings implements Parcelable { confirmDelete = cursor.getInt(cursor.getColumnIndex(SettingsColumns.CONFIRM_DELETE)) != 0; confirmArchive = cursor.getInt(cursor.getColumnIndex(SettingsColumns.CONFIRM_ARCHIVE)) != 0; confirmSend = cursor.getInt(cursor.getColumnIndex(SettingsColumns.CONFIRM_SEND)) != 0; + confirmForward = cursor.getInt(cursor.getColumnIndex(SettingsColumns.CONFIRM_FORWARD)) != 0; addAttachment = cursor.getInt(cursor.getColumnIndex(SettingsColumns.ADD_ATTACHMENT)) != 0; selectRecipients = cursor.getInt( cursor.getColumnIndex(SettingsColumns.SELECT_RECIPIENTS)) != 0; @@ -205,6 +209,7 @@ public class Settings implements Parcelable { confirmDelete = json.optBoolean(SettingsColumns.CONFIRM_DELETE, sDefault.confirmDelete); confirmArchive = json.optBoolean(SettingsColumns.CONFIRM_ARCHIVE, sDefault.confirmArchive); confirmSend = json.optBoolean(SettingsColumns.CONFIRM_SEND, sDefault.confirmSend); + confirmForward = json.optBoolean(SettingsColumns.CONFIRM_FORWARD, sDefault.confirmForward); addAttachment = json.optBoolean(SettingsColumns.ADD_ATTACHMENT, sDefault.addAttachment); selectRecipients = json.optBoolean(SettingsColumns.SELECT_RECIPIENTS, sDefault.selectRecipients); @@ -255,6 +260,7 @@ public class Settings implements Parcelable { json.put(SettingsColumns.CONFIRM_DELETE, confirmDelete); json.put(SettingsColumns.CONFIRM_ARCHIVE, confirmArchive); json.put(SettingsColumns.CONFIRM_SEND, confirmSend); + json.put(SettingsColumns.CONFIRM_FORWARD, confirmForward); json.put(SettingsColumns.ADD_ATTACHMENT, addAttachment); json.put(SettingsColumns.SELECT_RECIPIENTS, selectRecipients); json.put(SettingsColumns.DEFAULT_INBOX, @@ -297,6 +303,7 @@ public class Settings implements Parcelable { map.put(UIProvider.AccountColumns.SettingsColumns.CONFIRM_DELETE, confirmDelete ? 1 : 0); map.put(UIProvider.AccountColumns.SettingsColumns.CONFIRM_ARCHIVE, confirmArchive ? 1 : 0); map.put(UIProvider.AccountColumns.SettingsColumns.CONFIRM_SEND, confirmSend ? 1 : 0); + map.put(UIProvider.AccountColumns.SettingsColumns.CONFIRM_FORWARD, confirmForward ? 1 : 0); map.put(UIProvider.AccountColumns.SettingsColumns.ADD_ATTACHMENT, addAttachment ? 1 : 0); map.put(UIProvider.AccountColumns.SettingsColumns.SELECT_RECIPIENTS, selectRecipients ? 1 : 0); @@ -350,6 +357,7 @@ public class Settings implements Parcelable { dest.writeInt(confirmDelete ? 1 : 0); dest.writeInt(confirmArchive ? 1 : 0); dest.writeInt(confirmSend ? 1 : 0); + dest.writeInt(confirmForward ? 1 : 0); dest.writeInt(addAttachment ? 1 : 0); dest.writeInt(selectRecipients ? 1 : 0); dest.writeString(getNonNull(defaultInbox, sDefault.defaultInbox).toString()); @@ -461,6 +469,7 @@ public class Settings implements Parcelable { && confirmDelete == that.confirmDelete && confirmArchive == that.confirmArchive && confirmSend == that.confirmSend + && confirmForward == that.confirmForward && addAttachment == that.addAttachment && selectRecipients == that.selectRecipients && Objects.equal(defaultInbox, that.defaultInbox) @@ -482,9 +491,9 @@ public class Settings implements Parcelable { ^ Objects.hashCode(signature, mAutoAdvance, mTransientAutoAdvance, messageTextSize, snapHeaders, replyBehavior, convListIcon, convListAttachmentPreviews, confirmDelete, confirmArchive, confirmSend, - addAttachment, selectRecipients, defaultInbox, forceReplyFromDefault, - maxAttachmentSize, swipe, priorityArrowsEnabled, setupIntentUri, - conversationViewMode, veiledAddressPattern, moveToInbox); + confirmForward, addAttachment, selectRecipients, defaultInbox, + forceReplyFromDefault, maxAttachmentSize, swipe, priorityArrowsEnabled, + setupIntentUri, conversationViewMode, veiledAddressPattern, moveToInbox); } return mHashCode; } diff --git a/src/com/android/mail/providers/UIProvider.java b/src/com/android/mail/providers/UIProvider.java index 16e2fbc16..71c27518f 100644 --- a/src/com/android/mail/providers/UIProvider.java +++ b/src/com/android/mail/providers/UIProvider.java @@ -167,6 +167,7 @@ public class UIProvider { .put(AccountColumns.SettingsColumns.CONFIRM_DELETE, Integer.class) .put(AccountColumns.SettingsColumns.CONFIRM_ARCHIVE, Integer.class) .put(AccountColumns.SettingsColumns.CONFIRM_SEND, Integer.class) + .put(AccountColumns.SettingsColumns.CONFIRM_FORWARD, Integer.class) .put(AccountColumns.SettingsColumns.ADD_ATTACHMENT, Integer.class) .put(AccountColumns.SettingsColumns.SELECT_RECIPIENTS, Integer.class) .put(AccountColumns.SettingsColumns.DEFAULT_INBOX, String.class) @@ -313,6 +314,10 @@ public class UIProvider { * Whether the account supports nested folders */ public static final int NESTED_FOLDERS = 0x800000; + /** + * Whether the account supports smart forward + */ + public static final int SMART_FORWARD = 0x1000000; } public static final class AccountColumns implements BaseColumns { @@ -568,6 +573,13 @@ public class UIProvider { public static final String CONFIRM_SEND = "confirm_send"; /** + * Integer column containing the user's specified confirm forward preference value. + * A non zero value indicates that the user has indicated that a confirmation should + * be shown when a forward action is performed. + */ + public static final String CONFIRM_FORWARD = "confirm_forward"; + + /** * Integer column containing the user's specified add attachment preference value. * A non zero value indicates that the user could add any file as the attachment, * and shown the menu to attach the file. diff --git a/src/com/android/mail/providers/protos/mock/MockUiProvider.java b/src/com/android/mail/providers/protos/mock/MockUiProvider.java index 70731b981..af8889d69 100644 --- a/src/com/android/mail/providers/protos/mock/MockUiProvider.java +++ b/src/com/android/mail/providers/protos/mock/MockUiProvider.java @@ -327,7 +327,8 @@ public final class MockUiProvider extends ContentProvider { AccountCapabilities.SMART_REPLY | AccountCapabilities.LOCAL_SEARCH | AccountCapabilities.THREADED_CONVERSATIONS | - AccountCapabilities.MULTIPLE_FOLDERS_PER_CONV)); + AccountCapabilities.MULTIPLE_FOLDERS_PER_CONV | + AccountCapabilities.SMART_FORWARD)); JSONArray replyFroms = new JSONArray(); ArrayList<ReplyFromAccount> list = new ArrayList<ReplyFromAccount>(); list.add(new ReplyFromAccount(null, Uri.parse(accountUri), "customAddress1@custom.com", @@ -375,6 +376,7 @@ public final class MockUiProvider extends ContentProvider { accountMap.put(SettingsColumns.CONFIRM_DELETE, 1); accountMap.put(SettingsColumns.CONFIRM_ARCHIVE, 1); accountMap.put(SettingsColumns.CONFIRM_SEND, 1); + accountMap.put(SettingsColumns.CONFIRM_FORWARD, 1); accountMap.put(SettingsColumns.ADD_ATTACHMENT, 1); accountMap.put(SettingsColumns.SELECT_RECIPIENTS, 1); accountMap.put(SettingsColumns.DEFAULT_INBOX, defaultInbox); |