Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96347802 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge \\"Require permission for FLAG_WILL_BE_FOREGROUND.\\" into nyc-mr1-dev am: 97639a13

am: aa8ae41a

Change-Id: Icfe17015febaa13823bf9c6d35c33a09d39e7462
parents e76abe85 aa8ae41a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -166,6 +166,9 @@ public class JobInfo implements Parcelable {
     * network restrictions for the requesting app. Note that this flag alone
     * doesn't actually place your {@link JobService} in the foreground; you
     * still need to post the notification yourself.
     * <p>
     * To use this flag, the caller must hold the
     * {@link android.Manifest.permission#CONNECTIVITY_INTERNAL} permission.
     *
     * @hide
     */
+5 −0
Original line number Diff line number Diff line
@@ -1556,6 +1556,11 @@ public final class JobSchedulerService extends com.android.server.SystemService
                }
            }

            if ((job.getFlags() & JobInfo.FLAG_WILL_BE_FOREGROUND) != 0) {
                getContext().enforceCallingOrSelfPermission(
                        android.Manifest.permission.CONNECTIVITY_INTERNAL, TAG);
            }

            long ident = Binder.clearCallingIdentity();
            try {
                return JobSchedulerService.this.schedule(job, uid);