Loading apex/jobscheduler/framework/java/android/app/JobSchedulerImpl.java +4 −4 Original line number Diff line number Diff line Loading @@ -169,18 +169,18 @@ public class JobSchedulerImpl extends JobScheduler { } @Override public boolean canRunLongJobs() { public boolean canRunUserInitiatedJobs() { try { return mBinder.canRunLongJobs(mContext.getOpPackageName()); return mBinder.canRunUserInitiatedJobs(mContext.getOpPackageName()); } catch (RemoteException e) { return false; } } @Override public boolean hasRunLongJobsPermission(String packageName, int userId) { public boolean hasRunUserInitiatedJobsPermission(String packageName, int userId) { try { return mBinder.hasRunLongJobsPermission(packageName, userId); return mBinder.hasRunUserInitiatedJobsPermission(packageName, userId); } catch (RemoteException e) { return false; } Loading apex/jobscheduler/framework/java/android/app/job/IJobScheduler.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -39,8 +39,8 @@ interface IJobScheduler { ParceledListSlice<JobInfo> getAllPendingJobsInNamespace(String namespace); JobInfo getPendingJob(String namespace, int jobId); int getPendingJobReason(String namespace, int jobId); boolean canRunLongJobs(String packageName); boolean hasRunLongJobsPermission(String packageName, int userId); boolean canRunUserInitiatedJobs(String packageName); boolean hasRunUserInitiatedJobsPermission(String packageName, int userId); List<JobInfo> getStartedJobs(); ParceledListSlice getAllJobSnapshots(); @EnforcePermission(allOf={"MANAGE_ACTIVITY_TASKS", "INTERACT_ACROSS_USERS_FULL"}) Loading apex/jobscheduler/framework/java/android/app/job/JobInfo.java +3 −3 Original line number Diff line number Diff line Loading @@ -1904,8 +1904,8 @@ public class JobInfo implements Parcelable { * and allow for rescheduling. * * <p> * If the app doesn't hold the {@link android.Manifest.permission#RUN_LONG_JOBS} permission * when scheduling a user-initiated job, JobScheduler will throw a * If the app doesn't hold the {@link android.Manifest.permission#RUN_USER_INITIATED_JOBS} * permission when scheduling a user-initiated job, JobScheduler will throw a * {@link SecurityException}. * * <p> Loading @@ -1914,7 +1914,7 @@ public class JobInfo implements Parcelable { * * @see JobInfo#isUserInitiated() */ @RequiresPermission(android.Manifest.permission.RUN_LONG_JOBS) @RequiresPermission(android.Manifest.permission.RUN_USER_INITIATED_JOBS) @NonNull public Builder setUserInitiated(boolean userInitiated) { if (userInitiated) { Loading apex/jobscheduler/framework/java/android/app/job/JobParameters.java +1 −1 Original line number Diff line number Diff line Loading @@ -424,7 +424,7 @@ public class JobParameters implements Parcelable { * {@code true}. This will return {@code false} if the job wasn't requested to run as a * user-initiated job, or if it was requested to run as a user-initiated job but the app didn't * meet any of the requirements at the time of execution, such as having the * {@link android.Manifest.permission#RUN_LONG_JOBS} permission. * {@link android.Manifest.permission#RUN_USER_INITIATED_JOBS} permission. * * @see JobInfo.Builder#setUserInitiated(boolean) */ Loading apex/jobscheduler/framework/java/android/app/job/JobScheduler.java +7 −4 Original line number Diff line number Diff line Loading @@ -454,20 +454,23 @@ public abstract class JobScheduler { /** * Returns {@code true} if the calling app currently holds the * {@link android.Manifest.permission#RUN_LONG_JOBS} permission, allowing it to run long jobs. * {@link android.Manifest.permission#RUN_USER_INITIATED_JOBS} permission, allowing it to run * user-initiated jobs. */ public boolean canRunLongJobs() { public boolean canRunUserInitiatedJobs() { return false; } /** * Returns {@code true} if the app currently holds the * {@link android.Manifest.permission#RUN_LONG_JOBS} permission, allowing it to run long jobs. * {@link android.Manifest.permission#RUN_USER_INITIATED_JOBS} permission, allowing it to run * user-initiated jobs. * @hide * TODO(255371817): consider exposing this to apps who could call * {@link #scheduleAsPackage(JobInfo, String, int, String)} */ public boolean hasRunLongJobsPermission(@NonNull String packageName, @UserIdInt int userId) { public boolean hasRunUserInitiatedJobsPermission(@NonNull String packageName, @UserIdInt int userId) { return false; } Loading Loading
apex/jobscheduler/framework/java/android/app/JobSchedulerImpl.java +4 −4 Original line number Diff line number Diff line Loading @@ -169,18 +169,18 @@ public class JobSchedulerImpl extends JobScheduler { } @Override public boolean canRunLongJobs() { public boolean canRunUserInitiatedJobs() { try { return mBinder.canRunLongJobs(mContext.getOpPackageName()); return mBinder.canRunUserInitiatedJobs(mContext.getOpPackageName()); } catch (RemoteException e) { return false; } } @Override public boolean hasRunLongJobsPermission(String packageName, int userId) { public boolean hasRunUserInitiatedJobsPermission(String packageName, int userId) { try { return mBinder.hasRunLongJobsPermission(packageName, userId); return mBinder.hasRunUserInitiatedJobsPermission(packageName, userId); } catch (RemoteException e) { return false; } Loading
apex/jobscheduler/framework/java/android/app/job/IJobScheduler.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -39,8 +39,8 @@ interface IJobScheduler { ParceledListSlice<JobInfo> getAllPendingJobsInNamespace(String namespace); JobInfo getPendingJob(String namespace, int jobId); int getPendingJobReason(String namespace, int jobId); boolean canRunLongJobs(String packageName); boolean hasRunLongJobsPermission(String packageName, int userId); boolean canRunUserInitiatedJobs(String packageName); boolean hasRunUserInitiatedJobsPermission(String packageName, int userId); List<JobInfo> getStartedJobs(); ParceledListSlice getAllJobSnapshots(); @EnforcePermission(allOf={"MANAGE_ACTIVITY_TASKS", "INTERACT_ACROSS_USERS_FULL"}) Loading
apex/jobscheduler/framework/java/android/app/job/JobInfo.java +3 −3 Original line number Diff line number Diff line Loading @@ -1904,8 +1904,8 @@ public class JobInfo implements Parcelable { * and allow for rescheduling. * * <p> * If the app doesn't hold the {@link android.Manifest.permission#RUN_LONG_JOBS} permission * when scheduling a user-initiated job, JobScheduler will throw a * If the app doesn't hold the {@link android.Manifest.permission#RUN_USER_INITIATED_JOBS} * permission when scheduling a user-initiated job, JobScheduler will throw a * {@link SecurityException}. * * <p> Loading @@ -1914,7 +1914,7 @@ public class JobInfo implements Parcelable { * * @see JobInfo#isUserInitiated() */ @RequiresPermission(android.Manifest.permission.RUN_LONG_JOBS) @RequiresPermission(android.Manifest.permission.RUN_USER_INITIATED_JOBS) @NonNull public Builder setUserInitiated(boolean userInitiated) { if (userInitiated) { Loading
apex/jobscheduler/framework/java/android/app/job/JobParameters.java +1 −1 Original line number Diff line number Diff line Loading @@ -424,7 +424,7 @@ public class JobParameters implements Parcelable { * {@code true}. This will return {@code false} if the job wasn't requested to run as a * user-initiated job, or if it was requested to run as a user-initiated job but the app didn't * meet any of the requirements at the time of execution, such as having the * {@link android.Manifest.permission#RUN_LONG_JOBS} permission. * {@link android.Manifest.permission#RUN_USER_INITIATED_JOBS} permission. * * @see JobInfo.Builder#setUserInitiated(boolean) */ Loading
apex/jobscheduler/framework/java/android/app/job/JobScheduler.java +7 −4 Original line number Diff line number Diff line Loading @@ -454,20 +454,23 @@ public abstract class JobScheduler { /** * Returns {@code true} if the calling app currently holds the * {@link android.Manifest.permission#RUN_LONG_JOBS} permission, allowing it to run long jobs. * {@link android.Manifest.permission#RUN_USER_INITIATED_JOBS} permission, allowing it to run * user-initiated jobs. */ public boolean canRunLongJobs() { public boolean canRunUserInitiatedJobs() { return false; } /** * Returns {@code true} if the app currently holds the * {@link android.Manifest.permission#RUN_LONG_JOBS} permission, allowing it to run long jobs. * {@link android.Manifest.permission#RUN_USER_INITIATED_JOBS} permission, allowing it to run * user-initiated jobs. * @hide * TODO(255371817): consider exposing this to apps who could call * {@link #scheduleAsPackage(JobInfo, String, int, String)} */ public boolean hasRunLongJobsPermission(@NonNull String packageName, @UserIdInt int userId) { public boolean hasRunUserInitiatedJobsPermission(@NonNull String packageName, @UserIdInt int userId) { return false; } Loading