public class JobStore extends Object
JobStore.WriteJobsMapToDiskRunnable
and JobStore.ReadJobMapFromDiskRunnable
lock on that
object.Modifier and Type | Class and Description |
---|---|
static interface |
JobStore.JobStatusFunctor |
Modifier and Type | Method and Description |
---|---|
boolean |
add(JobStatus jobStatus)
Add a job to the master list, persisting it if necessary.
|
void |
clear() |
int |
countJobsForUid(int uid) |
void |
forEachJob(int uid,
JobStore.JobStatusFunctor functor) |
void |
forEachJob(JobStore.JobStatusFunctor functor)
Iterate over the set of all jobs, invoking the supplied functor on each.
|
JobStatus |
getJobByUidAndJobId(int uid,
int jobId) |
List<JobStatus> |
getJobsByUid(int uid) |
List<JobStatus> |
getJobsByUser(int userHandle) |
static JobStore |
initAndGetForTesting(Context context,
File dataDir) |
void |
readJobMapFromDisk(com.android.server.job.JobStore.JobSet jobSet) |
boolean |
remove(JobStatus jobStatus,
boolean writeBack)
Remove the provided job.
|
int |
size() |
public static JobStore initAndGetForTesting(Context context, File dataDir)
public boolean add(JobStatus jobStatus)
jobStatus
- Job to add.public int size()
public int countJobsForUid(int uid)
public boolean remove(JobStatus jobStatus, boolean writeBack)
writeBack
- If true, the job will be deleted (if it was persisted) immediately.public void clear()
public List<JobStatus> getJobsByUser(int userHandle)
userHandle
- User for whom we are querying the list of jobs.public List<JobStatus> getJobsByUid(int uid)
uid
- Uid of the requesting app.public JobStatus getJobByUidAndJobId(int uid, int jobId)
uid
- Uid of the requesting app.jobId
- Job id, specified at schedule-time.public void forEachJob(JobStore.JobStatusFunctor functor)
public void forEachJob(int uid, JobStore.JobStatusFunctor functor)
public void readJobMapFromDisk(com.android.server.job.JobStore.JobSet jobSet)