Adding checks for bad periodic job scheduling.
1. There are cases where a periodic job is scheduled in a past time
period. Without any other constraints, the job could be run much too
frequently and spam the system. Adding these checks makes sure the jobs
are scheduled with sane values.
2. Adding an upper limit on the job period to avoid overflow cases.
3. Changing int to long to avoid overflow.
Bug: 133654009
Test: atest com.android.server.job.JobSchedulerServiceTest
Test: atest com.android.server.job.controllers.QuotaControllerTest
Test: atest com.android.server.job.controllers.TimeControllerTest
Test: atest CtsJobSchedulerTestCases
Change-Id: I97616efb6c37b7201eb926d16c0d9be450bf2ba4
3 files changed