OSDN Git Service

Merge korg/donut into korg/master
[android-x86/packages-providers-DownloadProvider.git] / src / com / android / providers / downloads / Helpers.java
index 72be60e..d8f262c 100644 (file)
@@ -38,18 +38,17 @@ import android.webkit.MimeTypeMap;
 import java.io.File; 
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
-import java.util.List;
 import java.util.Random;
+import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
-import java.util.Set;
 
 /**
  * Some helper functions for the download manager
  */
 public class Helpers {
 
-    public static Random rnd = new Random(SystemClock.uptimeMillis());
+    public static Random sRandom = new Random(SystemClock.uptimeMillis());
 
     /** Regex used to parse content-disposition headers */
     private static final Pattern CONTENT_DISPOSITION_PATTERN =
@@ -411,7 +410,7 @@ public class Helpers {
                 if (Constants.LOGVV) {
                     Log.v(Constants.TAG, "file with sequence number " + sequence + " exists");
                 }
-                sequence += rnd.nextInt(magnitude) + 1;
+                sequence += sRandom.nextInt(magnitude) + 1;
             }
         }
         return null;
@@ -427,11 +426,11 @@ public class Helpers {
                 Downloads.CONTENT_URI,
                 null,
                 "( " +
-                Downloads.STATUS + " = '" + Downloads.STATUS_SUCCESS + "' AND " +
-                Downloads.DESTINATION + " = '" + Downloads.DESTINATION_CACHE_PARTITION_PURGEABLE
-                + "' )",
+                Downloads.COLUMN_STATUS + " = '" + Downloads.STATUS_SUCCESS + "' AND " +
+                Downloads.COLUMN_DESTINATION +
+                        " = '" + Downloads.DESTINATION_CACHE_PARTITION_PURGEABLE + "' )",
                 null,
-                Downloads.LAST_MODIFICATION);
+                Downloads.COLUMN_LAST_MODIFICATION);
         if (cursor == null) {
             return false;
         }
@@ -755,7 +754,7 @@ public class Helpers {
             // quoted strings
             if (chars[mOffset] == '\'') {
                 ++mOffset;
-                while(mOffset < chars.length) {
+                while (mOffset < chars.length) {
                     if (chars[mOffset] == '\'') {
                         if (mOffset + 1 < chars.length && chars[mOffset + 1] == '\'') {
                             ++mOffset;