[Catalyst] Simplify KeyValueStore API calls

NO_IFTTT=Catalyst only

Bug: 325144964
Flag: com.android.settings.flags.catalyst
Test: atest
Change-Id: I518b9c861eac6d515dfc7f0ac2d028f9395e06a1
This commit is contained in:
Jacky Wang
2024-12-08 19:20:16 +08:00
parent 6c0260c0ec
commit dc1a52a2ee
8 changed files with 21 additions and 40 deletions

View File

@@ -75,18 +75,14 @@ class BatterySaverPreferenceTest {
@Test
fun storeSetOn_setPowerSaveMode() {
batterySaverPreference
.storage(context)
.setValue(batterySaverPreference.key, Boolean::class.javaObjectType, true)
batterySaverPreference.storage(context).setBoolean(batterySaverPreference.key, true)
verify(powerManager).setPowerSaveModeEnabled(true)
}
@Test
fun storeSetOff_unsetPowerSaveMode() {
batterySaverPreference
.storage(context)
.setValue(batterySaverPreference.key, Boolean::class.javaObjectType, false)
batterySaverPreference.storage(context).setBoolean(batterySaverPreference.key, false)
verify(powerManager).setPowerSaveModeEnabled(false)
}