Clean-up after com.android.settings.flags.revamp_toggles rollout

Flag: EXEMPT refactoring / flag clean-up
Test: refactoring CL. Existing unit tests still pass.
Bug: 296835792

Change-Id: Ib57ee270c8b5d540cb19997fe1863dd6d782cbe4
This commit is contained in:
Geoffrey Boullanger
2024-11-21 11:54:47 +00:00
parent efcb4dfddf
commit 842a337291
12 changed files with 21 additions and 439 deletions

View File

@@ -32,7 +32,6 @@ import androidx.preference.Preference;
import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.core.TogglePreferenceController;
import com.android.settings.flags.Flags;
public class AutoTimeZonePreferenceController extends TogglePreferenceController {
@@ -107,19 +106,17 @@ public class AutoTimeZonePreferenceController extends TogglePreferenceController
TimeZoneConfiguration.Builder configuration = new TimeZoneConfiguration.Builder()
.setAutoDetectionEnabled(isChecked);
if (Flags.revampToggles()) {
// "Use location for time zone" is only used if "Automatic time zone" is enabled. If
// the user toggles off automatic time zone, set the toggle off and disable the toggle.
int geoDetectionCapability = mTimeManager
.getTimeZoneCapabilitiesAndConfig()
.getCapabilities()
.getConfigureGeoDetectionEnabledCapability();
// "Use location for time zone" is only used if "Automatic time zone" is enabled. If
// the user toggles off automatic time zone, set the toggle off and disable the toggle.
int geoDetectionCapability = mTimeManager
.getTimeZoneCapabilitiesAndConfig()
.getCapabilities()
.getConfigureGeoDetectionEnabledCapability();
if (!isChecked
&& (geoDetectionCapability == CAPABILITY_NOT_APPLICABLE
|| geoDetectionCapability == CAPABILITY_POSSESSED)) {
configuration.setGeoDetectionEnabled(false);
}
if (!isChecked
&& (geoDetectionCapability == CAPABILITY_NOT_APPLICABLE
|| geoDetectionCapability == CAPABILITY_POSSESSED)) {
configuration.setGeoDetectionEnabled(false);
}
boolean result = mTimeManager.updateTimeZoneConfiguration(configuration.build());