Fix incorrect switch status when user stay in NightDisplaySettings page while scheduled night lights on

The main reason for this problem is that someone forgot to super's updateState() to update the ui, so the internal status was updated but ui status was not. For now since updateStateInternal() did nothing substantive, it is suggested to remove this override to fix.

Bug: b/241957450 b/255902043
Test: manually tap button according to bug report.
Change-Id: I80d1173986a9f22c4a77c8c13011292c08f8dc2e
This commit is contained in:
Shen Lin
2022-08-10 16:56:18 +08:00
parent fdbd2d1090
commit 18aa329d4a

View File

@@ -90,11 +90,6 @@ public class NightDisplayActivationPreferenceController extends
}
}
@Override
public final void updateState(Preference preference) {
updateStateInternal();
}
/** FOR SLICES */
@Override
@@ -112,14 +107,4 @@ public class NightDisplayActivationPreferenceController extends
return mTimeFormatter.getAutoModeSummary(mContext, mColorDisplayManager);
}
private void updateStateInternal() {
final boolean isActivated = mColorDisplayManager.isNightDisplayActivated();
final int autoMode = mColorDisplayManager.getNightDisplayAutoMode();
if (autoMode == ColorDisplayManager.AUTO_MODE_CUSTOM_TIME) {
mTimeFormatter.getFormattedTimeString(isActivated
? mColorDisplayManager.getNightDisplayCustomStartTime()
: mColorDisplayManager.getNightDisplayCustomEndTime());
}
}
}