summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-11-27 16:11:07 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-11-27 16:11:07 -0800
commit8ec8bdebaefcecb8b3e6b9f724aba7b25406db21 (patch)
treeb25a6cdd7aebc7ebe63d0b698204aea3f60ecc2f
parentd912ebe9c815b88bbdf43b6a9a9605a370d18eaf (diff)
parentf818eecf1b60ddba2854314863243d6aa87707b0 (diff)
downloadandroid_packages_providers_DownloadProvider-8ec8bdebaefcecb8b3e6b9f724aba7b25406db21.tar.gz
android_packages_providers_DownloadProvider-8ec8bdebaefcecb8b3e6b9f724aba7b25406db21.tar.bz2
android_packages_providers_DownloadProvider-8ec8bdebaefcecb8b3e6b9f724aba7b25406db21.zip
Merge "Update extras for in-progress download." into jb-mr1.1-dev
-rw-r--r--src/com/android/providers/downloads/Constants.java2
-rw-r--r--src/com/android/providers/downloads/DownloadReceiver.java2
-rw-r--r--ui/src/com/android/providers/downloads/ui/DownloadList.java13
3 files changed, 8 insertions, 9 deletions
diff --git a/src/com/android/providers/downloads/Constants.java b/src/com/android/providers/downloads/Constants.java
index 8481435f..8d806182 100644
--- a/src/com/android/providers/downloads/Constants.java
+++ b/src/com/android/providers/downloads/Constants.java
@@ -75,6 +75,8 @@ public class Constants {
/** The default extension for binary files if we can't get one at the HTTP level */
public static final String DEFAULT_DL_BINARY_EXTENSION = ".bin";
+ public static final String PROVIDER_PACKAGE_NAME = "com.android.providers.downloads";
+
/**
* When a number has to be appended to the filename, this string is used to separate the
* base filename from the sequence number
diff --git a/src/com/android/providers/downloads/DownloadReceiver.java b/src/com/android/providers/downloads/DownloadReceiver.java
index cbc963ce..42f029a3 100644
--- a/src/com/android/providers/downloads/DownloadReceiver.java
+++ b/src/com/android/providers/downloads/DownloadReceiver.java
@@ -94,7 +94,7 @@ public class DownloadReceiver extends BroadcastReceiver {
handleNotificationBroadcast(context, intent);
} else {
sAsyncHandler.post(new Runnable() {
- @Override
+ @Override
public void run() {
handleNotificationBroadcast(context, intent);
result.finish();
diff --git a/ui/src/com/android/providers/downloads/ui/DownloadList.java b/ui/src/com/android/providers/downloads/ui/DownloadList.java
index 6ffa0691..ed369932 100644
--- a/ui/src/com/android/providers/downloads/ui/DownloadList.java
+++ b/ui/src/com/android/providers/downloads/ui/DownloadList.java
@@ -51,6 +51,7 @@ import android.widget.ExpandableListView.OnChildClickListener;
import android.widget.ListView;
import android.widget.Toast;
+import com.android.providers.downloads.Constants;
import com.android.providers.downloads.OpenHelper;
import java.io.FileNotFoundException;
@@ -624,15 +625,11 @@ public class DownloadList extends Activity {
.show();
}
- /**
- * TODO use constants/shared code?
- */
private void sendRunningDownloadClickedBroadcast(long id) {
- Intent intent = new Intent("android.intent.action.DOWNLOAD_LIST");
- intent.setClassName("com.android.providers.downloads",
- "com.android.providers.downloads.DownloadReceiver");
- intent.setData(ContentUris.withAppendedId(Downloads.Impl.ALL_DOWNLOADS_CONTENT_URI, id));
- intent.putExtra("multiple", false);
+ final Intent intent = new Intent(Constants.ACTION_LIST);
+ intent.setPackage(Constants.PROVIDER_PACKAGE_NAME);
+ intent.putExtra(DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS,
+ new long[] { id });
sendBroadcast(intent);
}