summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/mipmap-hdpi/ic_launcher_download.pngbin10593 -> 9282 bytes
-rw-r--r--res/mipmap-mdpi/ic_launcher_download.pngbin23509 -> 5420 bytes
-rw-r--r--res/mipmap-xhdpi/ic_launcher_download.pngbin32416 -> 13962 bytes
-rw-r--r--res/mipmap-xxhdpi/ic_launcher_download.pngbin21228 -> 40279 bytes
-rw-r--r--res/mipmap-xxxhdpi/ic_launcher_download.pngbin0 -> 35468 bytes
-rw-r--r--src/com/android/providers/downloads/DownloadProvider.java13
-rw-r--r--src/com/android/providers/downloads/DownloadStorageProvider.java13
-rw-r--r--ui/res/mipmap-hdpi/ic_launcher_download.pngbin10593 -> 9282 bytes
-rw-r--r--ui/res/mipmap-mdpi/ic_launcher_download.pngbin23509 -> 5420 bytes
-rw-r--r--ui/res/mipmap-xhdpi/ic_launcher_download.pngbin32416 -> 13962 bytes
-rw-r--r--ui/res/mipmap-xxhdpi/ic_launcher_download.pngbin21228 -> 40279 bytes
-rw-r--r--ui/res/mipmap-xxxhdpi/ic_launcher_download.pngbin0 -> 35468 bytes
12 files changed, 22 insertions, 4 deletions
diff --git a/res/mipmap-hdpi/ic_launcher_download.png b/res/mipmap-hdpi/ic_launcher_download.png
index 3f092d39..2450cfbb 100644
--- a/res/mipmap-hdpi/ic_launcher_download.png
+++ b/res/mipmap-hdpi/ic_launcher_download.png
Binary files differ
diff --git a/res/mipmap-mdpi/ic_launcher_download.png b/res/mipmap-mdpi/ic_launcher_download.png
index 76652fb9..7b56ada3 100644
--- a/res/mipmap-mdpi/ic_launcher_download.png
+++ b/res/mipmap-mdpi/ic_launcher_download.png
Binary files differ
diff --git a/res/mipmap-xhdpi/ic_launcher_download.png b/res/mipmap-xhdpi/ic_launcher_download.png
index 7d7b1b11..775004f2 100644
--- a/res/mipmap-xhdpi/ic_launcher_download.png
+++ b/res/mipmap-xhdpi/ic_launcher_download.png
Binary files differ
diff --git a/res/mipmap-xxhdpi/ic_launcher_download.png b/res/mipmap-xxhdpi/ic_launcher_download.png
index 0921c124..ed8c7827 100644
--- a/res/mipmap-xxhdpi/ic_launcher_download.png
+++ b/res/mipmap-xxhdpi/ic_launcher_download.png
Binary files differ
diff --git a/res/mipmap-xxxhdpi/ic_launcher_download.png b/res/mipmap-xxxhdpi/ic_launcher_download.png
new file mode 100644
index 00000000..2dbe0f2d
--- /dev/null
+++ b/res/mipmap-xxxhdpi/ic_launcher_download.png
Binary files differ
diff --git a/src/com/android/providers/downloads/DownloadProvider.java b/src/com/android/providers/downloads/DownloadProvider.java
index 999134f0..cb3dc18b 100644
--- a/src/com/android/providers/downloads/DownloadProvider.java
+++ b/src/com/android/providers/downloads/DownloadProvider.java
@@ -1162,6 +1162,19 @@ public final class DownloadProvider extends ContentProvider {
case ALL_DOWNLOADS_ID:
SqlSelection selection = getWhereClause(uri, where, whereArgs, match);
deleteRequestHeaders(db, selection.getSelection(), selection.getParameters());
+
+ final Cursor cursor = db.query(DB_TABLE, new String[] {
+ Downloads.Impl._ID }, selection.getSelection(), selection.getParameters(),
+ null, null, null);
+ try {
+ while (cursor.moveToNext()) {
+ final long id = cursor.getLong(0);
+ DownloadStorageProvider.onDownloadProviderDelete(getContext(), id);
+ }
+ } finally {
+ IoUtils.closeQuietly(cursor);
+ }
+
count = db.delete(DB_TABLE, selection.getSelection(), selection.getParameters());
break;
diff --git a/src/com/android/providers/downloads/DownloadStorageProvider.java b/src/com/android/providers/downloads/DownloadStorageProvider.java
index d982f2a1..622633a8 100644
--- a/src/com/android/providers/downloads/DownloadStorageProvider.java
+++ b/src/com/android/providers/downloads/DownloadStorageProvider.java
@@ -25,6 +25,7 @@ import android.database.Cursor;
import android.database.MatrixCursor;
import android.database.MatrixCursor.RowBuilder;
import android.graphics.Point;
+import android.net.Uri;
import android.os.Binder;
import android.os.CancellationSignal;
import android.os.Environment;
@@ -47,12 +48,12 @@ import java.io.IOException;
* contents.
*/
public class DownloadStorageProvider extends DocumentsProvider {
+ private static final String AUTHORITY = Constants.STORAGE_AUTHORITY;
private static final String DOC_ID_ROOT = Constants.STORAGE_ROOT_ID;
private static final String[] DEFAULT_ROOT_PROJECTION = new String[] {
- Root.COLUMN_ROOT_ID, Root.COLUMN_ROOT_TYPE, Root.COLUMN_FLAGS, Root.COLUMN_ICON,
- Root.COLUMN_TITLE, Root.COLUMN_SUMMARY, Root.COLUMN_DOCUMENT_ID,
- Root.COLUMN_AVAILABLE_BYTES,
+ Root.COLUMN_ROOT_ID, Root.COLUMN_FLAGS, Root.COLUMN_ICON,
+ Root.COLUMN_TITLE, Root.COLUMN_DOCUMENT_ID,
};
private static final String[] DEFAULT_DOCUMENT_PROJECTION = new String[] {
@@ -82,12 +83,16 @@ public class DownloadStorageProvider extends DocumentsProvider {
result.setNotificationUri(getContext().getContentResolver(), cursor.getNotificationUri());
}
+ static void onDownloadProviderDelete(Context context, long id) {
+ final Uri uri = DocumentsContract.buildDocumentUri(AUTHORITY, Long.toString(id));
+ context.revokeUriPermission(uri, ~0);
+ }
+
@Override
public Cursor queryRoots(String[] projection) throws FileNotFoundException {
final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection));
final RowBuilder row = result.newRow();
row.add(Root.COLUMN_ROOT_ID, DOC_ID_ROOT);
- row.add(Root.COLUMN_ROOT_TYPE, Root.ROOT_TYPE_SHORTCUT);
row.add(Root.COLUMN_FLAGS,
Root.FLAG_LOCAL_ONLY | Root.FLAG_SUPPORTS_RECENTS | Root.FLAG_SUPPORTS_CREATE);
row.add(Root.COLUMN_ICON, R.mipmap.ic_launcher_download);
diff --git a/ui/res/mipmap-hdpi/ic_launcher_download.png b/ui/res/mipmap-hdpi/ic_launcher_download.png
index 3f092d39..2450cfbb 100644
--- a/ui/res/mipmap-hdpi/ic_launcher_download.png
+++ b/ui/res/mipmap-hdpi/ic_launcher_download.png
Binary files differ
diff --git a/ui/res/mipmap-mdpi/ic_launcher_download.png b/ui/res/mipmap-mdpi/ic_launcher_download.png
index 76652fb9..7b56ada3 100644
--- a/ui/res/mipmap-mdpi/ic_launcher_download.png
+++ b/ui/res/mipmap-mdpi/ic_launcher_download.png
Binary files differ
diff --git a/ui/res/mipmap-xhdpi/ic_launcher_download.png b/ui/res/mipmap-xhdpi/ic_launcher_download.png
index 7d7b1b11..775004f2 100644
--- a/ui/res/mipmap-xhdpi/ic_launcher_download.png
+++ b/ui/res/mipmap-xhdpi/ic_launcher_download.png
Binary files differ
diff --git a/ui/res/mipmap-xxhdpi/ic_launcher_download.png b/ui/res/mipmap-xxhdpi/ic_launcher_download.png
index 0921c124..ed8c7827 100644
--- a/ui/res/mipmap-xxhdpi/ic_launcher_download.png
+++ b/ui/res/mipmap-xxhdpi/ic_launcher_download.png
Binary files differ
diff --git a/ui/res/mipmap-xxxhdpi/ic_launcher_download.png b/ui/res/mipmap-xxxhdpi/ic_launcher_download.png
new file mode 100644
index 00000000..2dbe0f2d
--- /dev/null
+++ b/ui/res/mipmap-xxxhdpi/ic_launcher_download.png
Binary files differ