Loading core/java/android/app/JobSchedulerImpl.java +2 −2 Original line number Diff line number Diff line Loading @@ -83,7 +83,7 @@ public class JobSchedulerImpl extends JobScheduler { @Override public List<JobInfo> getAllPendingJobs() { try { return mBinder.getAllPendingJobs(); return mBinder.getAllPendingJobs().getList(); } catch (RemoteException e) { return null; } Loading @@ -110,7 +110,7 @@ public class JobSchedulerImpl extends JobScheduler { @Override public List<JobSnapshot> getAllJobSnapshots() { try { return mBinder.getAllJobSnapshots(); return mBinder.getAllJobSnapshots().getList(); } catch (RemoteException e) { return null; } Loading core/java/android/app/job/IJobScheduler.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.app.job; import android.app.job.JobInfo; import android.app.job.JobSnapshot; import android.app.job.JobWorkItem; import android.content.pm.ParceledListSlice; /** * IPC interface that supports the app-facing {@link #JobScheduler} api. Loading @@ -30,8 +31,8 @@ interface IJobScheduler { int scheduleAsPackage(in JobInfo job, String packageName, int userId, String tag); void cancel(int jobId); void cancelAll(); List<JobInfo> getAllPendingJobs(); ParceledListSlice getAllPendingJobs(); JobInfo getPendingJob(int jobId); List<JobInfo> getStartedJobs(); List<JobSnapshot> getAllJobSnapshots(); ParceledListSlice getAllJobSnapshots(); } services/core/java/com/android/server/job/JobSchedulerService.java +5 −4 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManagerInternal; import android.content.pm.ParceledListSlice; import android.content.pm.ServiceInfo; import android.database.ContentObserver; import android.net.Uri; Loading Loading @@ -2764,12 +2765,12 @@ public class JobSchedulerService extends com.android.server.SystemService } @Override public List<JobInfo> getAllPendingJobs() throws RemoteException { public ParceledListSlice<JobInfo> getAllPendingJobs() throws RemoteException { final int uid = Binder.getCallingUid(); long ident = Binder.clearCallingIdentity(); try { return JobSchedulerService.this.getPendingJobs(uid); return new ParceledListSlice<>(JobSchedulerService.this.getPendingJobs(uid)); } finally { Binder.restoreCallingIdentity(ident); } Loading Loading @@ -2905,7 +2906,7 @@ public class JobSchedulerService extends com.android.server.SystemService * <p class="note">This is a slow operation, so it should be called sparingly. */ @Override public List<JobSnapshot> getAllJobSnapshots() { public ParceledListSlice<JobSnapshot> getAllJobSnapshots() { final int uid = Binder.getCallingUid(); if (uid != Process.SYSTEM_UID) { throw new SecurityException( Loading @@ -2916,7 +2917,7 @@ public class JobSchedulerService extends com.android.server.SystemService mJobs.forEachJob((job) -> snapshots.add( new JobSnapshot(job.getJob(), job.getSatisfiedConstraintFlags(), isReadyToBeExecutedLocked(job)))); return snapshots; return new ParceledListSlice<>(snapshots); } } }; Loading Loading
core/java/android/app/JobSchedulerImpl.java +2 −2 Original line number Diff line number Diff line Loading @@ -83,7 +83,7 @@ public class JobSchedulerImpl extends JobScheduler { @Override public List<JobInfo> getAllPendingJobs() { try { return mBinder.getAllPendingJobs(); return mBinder.getAllPendingJobs().getList(); } catch (RemoteException e) { return null; } Loading @@ -110,7 +110,7 @@ public class JobSchedulerImpl extends JobScheduler { @Override public List<JobSnapshot> getAllJobSnapshots() { try { return mBinder.getAllJobSnapshots(); return mBinder.getAllJobSnapshots().getList(); } catch (RemoteException e) { return null; } Loading
core/java/android/app/job/IJobScheduler.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.app.job; import android.app.job.JobInfo; import android.app.job.JobSnapshot; import android.app.job.JobWorkItem; import android.content.pm.ParceledListSlice; /** * IPC interface that supports the app-facing {@link #JobScheduler} api. Loading @@ -30,8 +31,8 @@ interface IJobScheduler { int scheduleAsPackage(in JobInfo job, String packageName, int userId, String tag); void cancel(int jobId); void cancelAll(); List<JobInfo> getAllPendingJobs(); ParceledListSlice getAllPendingJobs(); JobInfo getPendingJob(int jobId); List<JobInfo> getStartedJobs(); List<JobSnapshot> getAllJobSnapshots(); ParceledListSlice getAllJobSnapshots(); }
services/core/java/com/android/server/job/JobSchedulerService.java +5 −4 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManagerInternal; import android.content.pm.ParceledListSlice; import android.content.pm.ServiceInfo; import android.database.ContentObserver; import android.net.Uri; Loading Loading @@ -2764,12 +2765,12 @@ public class JobSchedulerService extends com.android.server.SystemService } @Override public List<JobInfo> getAllPendingJobs() throws RemoteException { public ParceledListSlice<JobInfo> getAllPendingJobs() throws RemoteException { final int uid = Binder.getCallingUid(); long ident = Binder.clearCallingIdentity(); try { return JobSchedulerService.this.getPendingJobs(uid); return new ParceledListSlice<>(JobSchedulerService.this.getPendingJobs(uid)); } finally { Binder.restoreCallingIdentity(ident); } Loading Loading @@ -2905,7 +2906,7 @@ public class JobSchedulerService extends com.android.server.SystemService * <p class="note">This is a slow operation, so it should be called sparingly. */ @Override public List<JobSnapshot> getAllJobSnapshots() { public ParceledListSlice<JobSnapshot> getAllJobSnapshots() { final int uid = Binder.getCallingUid(); if (uid != Process.SYSTEM_UID) { throw new SecurityException( Loading @@ -2916,7 +2917,7 @@ public class JobSchedulerService extends com.android.server.SystemService mJobs.forEachJob((job) -> snapshots.add( new JobSnapshot(job.getJob(), job.getSatisfiedConstraintFlags(), isReadyToBeExecutedLocked(job)))); return snapshots; return new ParceledListSlice<>(snapshots); } } }; Loading