Add auto restriction for excessive background

If it is excessive bg anomaly and auto restriction is on, then
restrict the anomaly in receiver and store it in database.

Also in this cl we move the anomaly logic to a JobService, so all
works are done in a background thread and won't interfere the main
thread.

Bug: 72385333
Test: RunSettingsRoboTests &&
Will add auto restriction test once robo framework is updated(b/73172999)
Change-Id: Id0ec5fb449ce26bf19a292bcbe63838d621cfd8e
This commit is contained in:
jackqdyulei
2018-02-20 15:07:26 -08:00
parent 42614c6787
commit 3ee28c810d
9 changed files with 304 additions and 46 deletions

View File

@@ -19,6 +19,7 @@
<resources>
<item type="id" name="preference_highlighted" />
<item type="id" name="job_anomaly_clean_up" />
<item type="id" name="job_anomaly_detection" />
<item type="id" name="lock_none" />
<item type="id" name="lock_pin" />