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

Commit 4f10040f authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Check permission for FLAG_WILL_BE_FOREGROUND.

This flag is only designed to be used by platform internals, such as
DownloadManager, so require that callers hold a nice strong
permission.

Bug: 26571724
Change-Id: Ie5ec55399e2e3a64b2837ef2c0a7a8a79bd1e49f
parent 379d52be
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1339,6 +1339,11 @@ public final class JobSchedulerService extends com.android.server.SystemService
                        + " not permitted to schedule jobs for other apps");
            }

            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.scheduleAsPackage(job, callerUid,