Add wakelock anomaly detector
This cl detects whether apps hold wakelock for long time. For now we use the following attribute: 1. Longest total duration time among all the wakelocks for one app. Following cl will: 1. Get threshold from server side. 2. Add more attributes to make the detection more robust. Bug: 36925184 Test: RunSettingsRoboTests Change-Id: I1946faf69c363f6aa823d0005d6e03bc9082c085
This commit is contained in:
@@ -39,13 +39,16 @@ public class AnomalyLoader extends AsyncLoader<List<Anomaly>> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDiscardResult(List<Anomaly> result) {}
|
||||
protected void onDiscardResult(List<Anomaly> result) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Anomaly> loadInBackground() {
|
||||
final List<Anomaly> anomalies = new ArrayList<>();
|
||||
anomalies.addAll(new WakeLockAnomalyDetector().detectAnomalies(mBatteryStatsHelper));
|
||||
anomalies.addAll(new WakeLockAnomalyDetector(getContext())
|
||||
.detectAnomalies(mBatteryStatsHelper));
|
||||
|
||||
return anomalies;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user