summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasu Nori <vnori@google.com>2010-12-01 18:23:09 -0800
committerVasu Nori <vnori@google.com>2010-12-02 11:10:48 -0800
commite49f651bdce9fc91c6bad97f5c1bb26bba82e41f (patch)
tree7b0a0fdb269d19db6ac0044923346588a949e371
parente1823c84698006aa26a8c5dcfa5c4034858dfbe3 (diff)
downloadandroid_packages_providers_DownloadProvider-e49f651bdce9fc91c6bad97f5c1bb26bba82e41f.zip
android_packages_providers_DownloadProvider-e49f651bdce9fc91c6bad97f5c1bb26bba82e41f.tar.gz
android_packages_providers_DownloadProvider-e49f651bdce9fc91c6bad97f5c1bb26bba82e41f.tar.bz2
(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
-rw-r--r--src/com/android/providers/downloads/DownloadThread.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java
index 2995bfb..d783fea 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,