Notify UI of message change when inline attachment saved

Bug: 6437156
Change-Id: Ieb31e833a92c4baa0411c6e6e88f219cc0dc6682
This commit is contained in:
Marc Blank 2012-06-01 09:11:35 -07:00
parent db1b26f5ea
commit 8410a296c5
1 changed files with 8 additions and 0 deletions

View File

@ -988,6 +988,8 @@ public class EmailProvider extends ContentProvider {
Uri.parse("content://" + UIProvider.AUTHORITY + "/uiattachments");
private static final Uri UIPROVIDER_ACCOUNTS_NOTIFIER =
Uri.parse("content://" + UIProvider.AUTHORITY + "/uiaccts");
private static final Uri UIPROVIDER_MESSAGE_NOTIFIER =
Uri.parse("content://" + UIProvider.AUTHORITY + "/uimessage");
@Override
public Uri insert(Uri uri, ContentValues values) {
@ -3394,6 +3396,12 @@ outer:
attachment.mFlags | Attachment.FLAG_DOWNLOAD_USER_REQUEST);
attachment.update(context, values);
return 1;
case UIProvider.AttachmentState.SAVED:
// If this is an inline attachment, notify message has changed
if (!TextUtils.isEmpty(attachment.mContentId)) {
notifyUI(UIPROVIDER_MESSAGE_NOTIFIER, attachment.mMessageKey);
}
return 1;
}
}
return 0;