Update power_anomaly_event proto fields
- add enum PowerAnomalyType/PowerAnomalyKey - update the func to get anomaly index Test: manual Bug: 291689623 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:356be9109080bc54232ff801b739ec10cab4fdfa) Change-Id: If4e6684c8169dfa3edd4e18a11d518737a3b2840
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
|
||||
package com.android.settings.fuelgauge.batteryusage;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.spy;
|
||||
import static org.mockito.Mockito.verify;
|
||||
@@ -68,21 +66,6 @@ public final class BatteryTipsControllerTest {
|
||||
mBatteryTipsController.mPowerUsageFeatureProvider = mPowerUsageFeatureProvider;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parsePowerAnomalyKey_preDefinedKeys_returnTrue() {
|
||||
final String[] keys = {"adaptive_brightness", "screen_timeout"};
|
||||
for (int index = 0; index < keys.length; index++) {
|
||||
assertThat(mBatteryTipsController.getPowerAnomalyEventIndex(keys[index]))
|
||||
.isEqualTo(index);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parsePowerAnomalyKey_unknownKey_returnTrue() {
|
||||
final String key = "unknown_key_for_test";
|
||||
assertThat(mBatteryTipsController.getPowerAnomalyEventIndex(key)).isEqualTo(-1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void handleBatteryTipsCardUpdated_null_hidePreference() {
|
||||
mBatteryTipsController.handleBatteryTipsCardUpdated(/* powerAnomalyEvents= */ null);
|
||||
|
||||
Reference in New Issue
Block a user