am 04d70252: am 36f06f4c: Merge "DB migration to eliminate some null fields in old...
Steve Howard [Thu, 23 Sep 2010 20:10:54 +0000 (13:10 -0700)]
Merge commit '04d7025262d7f6c5c372ec699d78b18d05b0400b'

* commit '04d7025262d7f6c5c372ec699d78b18d05b0400b':
  DB migration to eliminate some null fields in old downloads

docs/index.html
src/com/android/providers/downloads/DownloadProvider.java

index 9bd6a51..0004b72 100644 (file)
@@ -1,4 +1,5 @@
 <html>
+
 <head>
   <title>Download Provider</title>
 </head>
index 2cbf7fb..44d755d 100644 (file)
@@ -695,10 +695,6 @@ public final class DownloadProvider extends ContentProvider {
                               null, null, sort);
 
         if (ret != null) {
-           ret = new ReadOnlyCursorWrapper(ret);
-        }
-
-        if (ret != null) {
             ret.setNotificationUri(getContext().getContentResolver(), uri);
             if (Constants.LOGVV) {
                 Log.v(Constants.TAG,
@@ -789,9 +785,8 @@ public final class DownloadProvider extends ContentProvider {
                        + getDownloadIdFromUri(uri);
         String[] projection = new String[] {Downloads.Impl.RequestHeaders.COLUMN_HEADER,
                                             Downloads.Impl.RequestHeaders.COLUMN_VALUE};
-        Cursor cursor = db.query(Downloads.Impl.RequestHeaders.HEADERS_DB_TABLE, projection, where,
-                                 null, null, null, null);
-        return new ReadOnlyCursorWrapper(cursor);
+        return db.query(Downloads.Impl.RequestHeaders.HEADERS_DB_TABLE, projection, where,
+                        null, null, null, null);
     }
 
     /**
@@ -1088,34 +1083,4 @@ public final class DownloadProvider extends ContentProvider {
             to.put(key, defaultValue);
         }
     }
-
-    private class ReadOnlyCursorWrapper extends CursorWrapper implements CrossProcessCursor {
-        public ReadOnlyCursorWrapper(Cursor cursor) {
-            super(cursor);
-            mCursor = (CrossProcessCursor) cursor;
-        }
-
-        public boolean deleteRow() {
-            throw new SecurityException("Download manager cursors are read-only");
-        }
-
-        public boolean commitUpdates() {
-            throw new SecurityException("Download manager cursors are read-only");
-        }
-
-        public void fillWindow(int pos, CursorWindow window) {
-            mCursor.fillWindow(pos, window);
-        }
-
-        public CursorWindow getWindow() {
-            return mCursor.getWindow();
-        }
-
-        public boolean onMove(int oldPosition, int newPosition) {
-            return mCursor.onMove(oldPosition, newPosition);
-        }
-
-        private CrossProcessCursor mCursor;
-    }
-
 }