From e49f651bdce9fc91c6bad97f5c1bb26bba82e41f Mon Sep 17 00:00:00 2001 From: Vasu Nori Date: Wed, 1 Dec 2010 18:23:09 -0800 Subject: (GB MR) bug:3144642 temporary small fix in GB MR and real fix in HC Real fix is in Change-Id: Ifea1544737023008eff44aef9acd976902a0c143 In the database, sometimes _data column in downloads is set to null and sometimes to empty string. this is inconsistent and causes bugs such as bug:3144642. This bug is caused by line# 793 in DownloadThread. state.mFileName is null sometimes and empty string sometimes - because the correspodning field is set inconsistentlt in downloads.db _data column. in GB MR, apply a bandaid because real fix could be too risky for GB. Change-Id: I115b3ba6cfe0262269dbbc4c336b9e1d63c618e4 --- src/com/android/providers/downloads/DownloadThread.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/com/android/providers/downloads/DownloadThread.java') diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java index 2995bfb6..d783fea8 100644 --- a/src/com/android/providers/downloads/DownloadThread.java +++ b/src/com/android/providers/downloads/DownloadThread.java @@ -26,6 +26,7 @@ import android.os.PowerManager; import android.os.Process; import android.provider.Downloads; import android.provider.DrmStore; +import android.text.TextUtils; import android.util.Log; import android.util.Pair; @@ -790,7 +791,7 @@ public class DownloadThread extends Thread { */ private void setupDestinationFile(State state, InnerState innerState) throws StopRequest { - if (state.mFilename != null) { // only true if we've already run a thread for this download + if (TextUtils.isEmpty(state.mFilename)) { // only true if we've already run a thread for this download if (!Helpers.isFilenameValid(state.mFilename)) { // this should never happen throw new StopRequest(Downloads.Impl.STATUS_FILE_ERROR, -- cgit v1.2.3