diff options
author | Matthew Williams <mjwilliams@google.com> | 2014-08-22 14:15:28 -0700 |
---|---|---|
committer | Matthew Williams <mjwilliams@google.com> | 2014-08-22 16:08:45 -0700 |
commit | d1c06753d045ad10e00e7aba53ee2adba0712ccc (patch) | |
tree | 6a1103dfcc0b6db0dfc030aba6cdb4961e2a91c2 /services/tests/servicestests | |
parent | acb570cd84b4e3503e7e96138ea0d9d236ca9b9e (diff) | |
download | frameworks_base-d1c06753d045ad10e00e7aba53ee2adba0712ccc.zip frameworks_base-d1c06753d045ad10e00e7aba53ee2adba0712ccc.tar.gz frameworks_base-d1c06753d045ad10e00e7aba53ee2adba0712ccc.tar.bz2 |
Implement API review feedback for JobScheduler
BUG: 17005336
Took the opportunity to clean up some back-off logic
Change-Id: Ibc8ae34d1d44dd064ba071e4cbad17872f7e38cf
Diffstat (limited to 'services/tests/servicestests')
-rw-r--r-- | services/tests/servicestests/src/com/android/server/job/JobStoreTest.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java b/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java index 2b693a3..402f0dd 100644 --- a/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java +++ b/services/tests/servicestests/src/com/android/server/job/JobStoreTest.java @@ -51,11 +51,11 @@ public class JobStoreTest extends AndroidTestCase { final JobInfo task = new Builder(taskId, mComponent) .setRequiresCharging(true) - .setRequiredNetworkCapabilities(JobInfo.NetworkType.ANY) - .setBackoffCriteria(initialBackoff, JobInfo.BackoffPolicy.EXPONENTIAL) + .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY) + .setBackoffCriteria(initialBackoff, JobInfo.BACKOFF_POLICY_EXPONENTIAL) .setOverrideDeadline(runByMillis) .setMinimumLatency(runFromMillis) - .setIsPersisted(true) + .setPersisted(true) .build(); final JobStatus ts = new JobStatus(task, SOME_UID); mTaskStoreUnderTest.add(ts); @@ -80,14 +80,14 @@ public class JobStoreTest extends AndroidTestCase { .setRequiresDeviceIdle(true) .setPeriodic(10000L) .setRequiresCharging(true) - .setIsPersisted(true) + .setPersisted(true) .build(); final JobInfo task2 = new Builder(12, mComponent) .setMinimumLatency(5000L) - .setBackoffCriteria(15000L, JobInfo.BackoffPolicy.LINEAR) + .setBackoffCriteria(15000L, JobInfo.BACKOFF_POLICY_LINEAR) .setOverrideDeadline(30000L) - .setRequiredNetworkCapabilities(JobInfo.NetworkType.UNMETERED) - .setIsPersisted(true) + .setRequiredNetworkType(JobInfo.NETWORK_TYPE_UNMETERED) + .setPersisted(true) .build(); final JobStatus taskStatus1 = new JobStatus(task1, SOME_UID); final JobStatus taskStatus2 = new JobStatus(task2, SOME_UID); @@ -121,7 +121,7 @@ public class JobStoreTest extends AndroidTestCase { .setRequiresDeviceIdle(true) .setPeriodic(10000L) .setRequiresCharging(true) - .setIsPersisted(true); + .setPersisted(true); PersistableBundle extras = new PersistableBundle(); extras.putDouble("hello", 3.2); @@ -159,11 +159,11 @@ public class JobStoreTest extends AndroidTestCase { assertEquals("Invalid idle constraint.", first.isRequireDeviceIdle(), second.isRequireDeviceIdle()); assertEquals("Invalid unmetered constraint.", - first.getNetworkCapabilities() == JobInfo.NetworkType.UNMETERED, - second.getNetworkCapabilities() == JobInfo.NetworkType.UNMETERED); + first.getNetworkType() == JobInfo.NETWORK_TYPE_UNMETERED, + second.getNetworkType() == JobInfo.NETWORK_TYPE_UNMETERED); assertEquals("Invalid connectivity constraint.", - first.getNetworkCapabilities() == JobInfo.NetworkType.ANY, - second.getNetworkCapabilities() == JobInfo.NetworkType.ANY); + first.getNetworkType() == JobInfo.NETWORK_TYPE_ANY, + second.getNetworkType() == JobInfo.NETWORK_TYPE_ANY); assertEquals("Invalid deadline constraint.", first.hasLateConstraint(), second.hasLateConstraint()); |