Add messaging exception status for "attachment not found"

* Adding this enables 4409976 to be fixed in a user-friendly manner

Bug: 4409976
Change-Id: I4f5ce890b6957c27a0f59656467dbe23b480a7e3
This commit is contained in:
Marc Blank 2011-05-12 12:11:43 -07:00
parent ffeb7de284
commit b221cbc785
4 changed files with 10 additions and 1 deletions

View File

@ -60,6 +60,8 @@ public class MessagingException extends Exception {
public static final int AUTHENTICATION_FAILED_OR_SERVER_ERROR = 13;
/** The server refused access */
public static final int ACCESS_DENIED = 14;
/** The server refused access */
public static final int ATTACHMENT_NOT_FOUND = 15;
protected int mExceptionType;
// Exception type-specific data

View File

@ -415,6 +415,9 @@ save attachment.</string>
<string name="attachment_info_apk_install_disabled">
Applications can\'t be installed directly from Email. First save
this application and then install it using the Downloads application.</string>
<!-- Error banner when an attachment could not be downloaded due to a problem at the server
[CHAR LIMIT=100] -->
<string name="attachment_not_found">The attachment could not be downloaded.</string>
<!-- String used in place of a message that could not be properly decoded (e.g. bad base64
data was received.) [CHAR LIMIT=none] -->

View File

@ -1594,8 +1594,10 @@ public class Controller {
case EmailServiceStatus.ACCESS_DENIED:
return new MessagingException(MessagingException.ACCESS_DENIED);
case EmailServiceStatus.MESSAGE_NOT_FOUND:
case EmailServiceStatus.ATTACHMENT_NOT_FOUND:
return new MessagingException(MessagingException.ATTACHMENT_NOT_FOUND);
case EmailServiceStatus.MESSAGE_NOT_FOUND:
case EmailServiceStatus.FOLDER_NOT_DELETED:
case EmailServiceStatus.FOLDER_NOT_RENAMED:
case EmailServiceStatus.FOLDER_NOT_CREATED:

View File

@ -35,6 +35,8 @@ public class MessagingExceptionStrings {
switch (e.getExceptionType()) {
case MessagingException.IOERROR:
return R.string.account_setup_failed_ioerror;
case MessagingException.ATTACHMENT_NOT_FOUND:
return R.string.attachment_not_found;
case MessagingException.TLS_REQUIRED:
return R.string.account_setup_failed_tls_required;
case MessagingException.AUTH_REQUIRED: