Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix jank while Mms were downloading manually

The download button will be janked while several Mms
were downloading manually in a batch since message
list view will bind view before download state of Mms
were set in retrieve transaction.

Change-Id: Ibf9fbeee17150e2d7c3eba00ba34b56406ef96b5
Signed-off-by: Roger Chen <cxr514033970@gmail.com>
  • Loading branch information...
commit 9dd9f0f2049d48dea799b5f2fe8a54380ee5b748 1 parent 6807bda
@cxr514033970 cxr514033970 authored
View
4 src/com/android/mms/ui/MessageListItem.java
@@ -212,6 +212,7 @@ private void bindNotifInd() {
mDateView.setText(buildTimestampLine(msgSizeText + " " + mMessageItem.mTimestamp));
switch (mMessageItem.getMmsDownloadStatus()) {
+ case DownloadManager.STATE_PRE_DOWNLOADING:
case DownloadManager.STATE_DOWNLOADING:
showDownloadingAttachment();
break;
@@ -246,6 +247,9 @@ public void onClick(View v) {
intent.putExtra(TransactionBundle.TRANSACTION_TYPE,
Transaction.RETRIEVE_TRANSACTION);
mContext.startService(intent);
+
+ DownloadManager.getInstance().markState(
+ mMessageItem.mMessageUri, DownloadManager.STATE_PRE_DOWNLOADING);
}
});
break;
View
1  src/com/android/mms/util/DownloadManager.java
@@ -57,6 +57,7 @@
public static final int STATE_DOWNLOADING = 0x81;
public static final int STATE_TRANSIENT_FAILURE = 0x82;
public static final int STATE_PERMANENT_FAILURE = 0x87;
+ public static final int STATE_PRE_DOWNLOADING = 0x88;
private final Context mContext;
private final Handler mHandler;
Please sign in to comment.
Something went wrong with that request. Please try again.