Remove MainSwitchPreference.updateStatus

NO_IFTTT=Update API

Bug: 391092187
Flag: EXEMPT library
Test: atest&manual
Change-Id: I6e31857d8ca7084c737fd69f63b33f6a58cf3022
This commit is contained in:
Jacky Wang
2025-01-20 21:19:46 +08:00
parent 1d28b612fe
commit 041bc113eb
14 changed files with 21 additions and 27 deletions

View File

@@ -22,7 +22,6 @@ import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.Context;
import android.os.PowerManager;
@@ -72,18 +71,14 @@ public class BatterySaverButtonPreferenceControllerTest {
@Test
public void updateState_lowPowerOn_preferenceIsChecked() {
when(mPowerManager.isPowerSaveMode()).thenReturn(true);
mPreference.updateStatus(mPowerManager.isPowerSaveMode());
mPreference.setChecked(true);
assertThat(mPreference.isChecked()).isTrue();
}
@Test
public void testUpdateState_lowPowerOff_preferenceIsUnchecked() {
when(mPowerManager.isPowerSaveMode()).thenReturn(false);
mPreference.updateStatus(mPowerManager.isPowerSaveMode());
mPreference.setChecked(false);
assertThat(mPreference.isChecked()).isFalse();
}