Update dream complication settings to use boolean setting.

This simplifies the logic and prevents the boolean from toggling itself
when new complication types are added.

Bug: 241469874
Test: manually on device
Change-Id: I0b67f9f2ce75dcfc5e57a50f9b27e374ea9295b1
This commit is contained in:
Lucas Silva
2022-08-22 16:22:53 -04:00
parent 20dacec65b
commit 059154ebb2

View File

@@ -42,14 +42,12 @@ public class DreamComplicationPreferenceController extends TogglePreferenceContr
@Override
public boolean isChecked() {
return mBackend.getEnabledComplications().containsAll(mBackend.getSupportedComplications());
return mBackend.getComplicationsEnabled();
}
@Override
public boolean setChecked(boolean isChecked) {
for (int complication : mBackend.getSupportedComplications()) {
mBackend.setComplicationEnabled(complication, isChecked);
}
mBackend.setComplicationsEnabled(isChecked);
return true;
}