OSDN Git Service

Turn on wakeupAlarm anomaly detector
authorjackqdyulei <jackqdyulei@google.com>
Tue, 12 Sep 2017 22:59:52 +0000 (15:59 -0700)
committerjackqdyulei <jackqdyulei@google.com>
Tue, 12 Sep 2017 22:59:52 +0000 (15:59 -0700)
In ag/2642771, wakeup alarms is changed to based on screen-off
timebase. After that, all the wakeup alarms will be background
ones.

So it is safe to turn on the wakeupAlarm anomaly detector.

Bug: 65597330
Test: RunSettingsRoboTests
Change-Id: I653d4bbfa671c52890dc6c6b13870c666ba9b944

src/com/android/settings/fuelgauge/anomaly/AnomalyDetectionPolicy.java
tests/robotests/src/com/android/settings/fuelgauge/anomaly/AnomalyDetectionPolicyTest.java

index 0c401b5..4829ca0 100644 (file)
@@ -122,7 +122,7 @@ public class AnomalyDetectionPolicy {
         anomalyDetectionEnabled = mParserWrapper.getBoolean(KEY_ANOMALY_DETECTION_ENABLED, true);
         wakeLockDetectionEnabled = mParserWrapper.getBoolean(KEY_WAKELOCK_DETECTION_ENABLED, true);
         wakeupAlarmDetectionEnabled = mParserWrapper.getBoolean(KEY_WAKEUP_ALARM_DETECTION_ENABLED,
-                false);
+                true);
         bluetoothScanDetectionEnabled = mParserWrapper.getBoolean(
                 KEY_BLUETOOTH_SCAN_DETECTION_ENABLED, true);
         wakeLockThreshold = mParserWrapper.getLong(KEY_WAKELOCK_THRESHOLD,
index 914cc2f..169cba8 100644 (file)
@@ -84,7 +84,7 @@ public class AnomalyDetectionPolicyTest {
         assertThat(anomalyDetectionPolicy.anomalyDetectionEnabled).isTrue();
         assertThat(anomalyDetectionPolicy.wakeLockDetectionEnabled).isTrue();
         assertThat(anomalyDetectionPolicy.wakeLockThreshold).isEqualTo(DateUtils.HOUR_IN_MILLIS);
-        assertThat(anomalyDetectionPolicy.wakeupAlarmDetectionEnabled).isFalse();
+        assertThat(anomalyDetectionPolicy.wakeupAlarmDetectionEnabled).isTrue();
         assertThat(anomalyDetectionPolicy.wakeupAlarmThreshold).isEqualTo(60);
         assertThat(anomalyDetectionPolicy.bluetoothScanDetectionEnabled).isTrue();
         assertThat(anomalyDetectionPolicy.bluetoothScanThreshold).isEqualTo(
@@ -112,7 +112,7 @@ public class AnomalyDetectionPolicyTest {
         doReturn(false).when(mKeyValueListParserWrapper).getBoolean(
                 AnomalyDetectionPolicy.KEY_WAKELOCK_DETECTION_ENABLED, true);
         doReturn(true).when(mKeyValueListParserWrapper).getBoolean(
-                AnomalyDetectionPolicy.KEY_WAKEUP_ALARM_DETECTION_ENABLED, false);
+                AnomalyDetectionPolicy.KEY_WAKEUP_ALARM_DETECTION_ENABLED, true);
         doReturn(true).when(mKeyValueListParserWrapper).getBoolean(
                 AnomalyDetectionPolicy.KEY_BLUETOOTH_SCAN_DETECTION_ENABLED, true);