Merge "Add FUELGAUGE_BATTERY_SAVER_SCHEDULE for saver schedule page metric"

This commit is contained in:
TreeHugger Robot
2022-11-23 04:42:06 +00:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
package com.android.settings.fuelgauge.batterysaver;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
@@ -82,6 +83,12 @@ public final class BatterySaverScheduleSettingsTest {
verifySchedule("key_battery_saver_percentage", expectedPercentage);
}
@Test
public void getMetricsCategory_returnExpectedResult() {
assertThat(mBatterySaverScheduleSettings.getMetricsCategory())
.isEqualTo(SettingsEnums.FUELGAUGE_BATTERY_SAVER_SCHEDULE);
}
private void setSchedule(int scheduleType, int schedulePercentage) {
Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.AUTOMATIC_POWER_SAVE_MODE, scheduleType);