Refactor anomaly detection

This cl refactor it so:
1. AnomayLoader could create its own BatteryStatsHelper if needed.
2. AnomalyDetector could detect the anomaly with a target package name
3. Remove FeatureProvider in AnomalyLoader and use
AnomalyDetectionPolicy instead

With this cl, we could add anomaly detection to battery usage page
more easily.

Bug: 36924669
Test: RunSettingsRoboTests
Change-Id: I1ee09701de8b5c8855f44e447813760285794c89
This commit is contained in:
jackqdyulei
2017-05-25 11:06:34 -07:00
parent f91dc2b064
commit e3e8bd6317
11 changed files with 254 additions and 37 deletions

View File

@@ -90,5 +90,6 @@ public interface PowerUsageFeatureProvider {
/**
* Check whether a specific anomaly detector is enabled
*/
//TODO(b/62096650): remove this method and use AnomalyDetectionPolicy instead
boolean isAnomalyDetectorEnabled(@Anomaly.AnomalyType int type);
}