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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user