summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudheer Shanka <sudheersai@google.com>2019-07-08 18:55:07 (GMT)
committerandroid-build-merger <android-build-merger@google.com>2019-07-08 18:55:07 (GMT)
commitbfec3085e848dbf3c08a33b5ca640a67f2625a0f (patch)
tree13c905582c7705bde7d74bffab25f886e01088f2
parent2071933e6a25d5dbaa3b85a6bf0c79211373be6b (diff)
parentbb4439869f5fbc943a9b8159eadfc717d133983a (diff)
downloadandroid_packages_providers_DownloadProvider-bfec3085e848dbf3c08a33b5ca640a67f2625a0f.zip
android_packages_providers_DownloadProvider-bfec3085e848dbf3c08a33b5ca640a67f2625a0f.tar.gz
android_packages_providers_DownloadProvider-bfec3085e848dbf3c08a33b5ca640a67f2625a0f.tar.bz2
Set FGS priority for download jobs with visible notifications.
am: bb4439869f Change-Id: I82e9cbed762f2e8917cbef6009d9d7653e88ae9a
-rw-r--r--src/com/android/providers/downloads/DownloadJobService.java1
-rw-r--r--src/com/android/providers/downloads/Helpers.java2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/providers/downloads/DownloadJobService.java b/src/com/android/providers/downloads/DownloadJobService.java
index d09738c..e1b2023 100644
--- a/src/com/android/providers/downloads/DownloadJobService.java
+++ b/src/com/android/providers/downloads/DownloadJobService.java
@@ -81,6 +81,7 @@ public class DownloadJobService extends JobService {
@Override
public boolean onStopJob(JobParameters params) {
final int id = params.getJobId();
+ Log.d(TAG, "onStopJob id=" + id + ", reason=" + params.getStopReason());
final DownloadThread thread;
synchronized (mActiveThreads) {
diff --git a/src/com/android/providers/downloads/Helpers.java b/src/com/android/providers/downloads/Helpers.java
index 7b4cb4e..565aa52 100644
--- a/src/com/android/providers/downloads/Helpers.java
+++ b/src/com/android/providers/downloads/Helpers.java
@@ -161,7 +161,7 @@ public class Helpers {
// When this download will show a notification, run with a higher
// priority, since it's effectively a foreground service
if (info.isVisible()) {
- builder.setPriority(JobInfo.PRIORITY_FOREGROUND_APP);
+ builder.setPriority(JobInfo.PRIORITY_FOREGROUND_SERVICE);
builder.setFlags(JobInfo.FLAG_WILL_BE_FOREGROUND);
}