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

@@ -40,17 +40,12 @@ import android.app.time.TimeZoneConfiguration;
import android.app.time.TimeZoneDetectorStatus;
import android.content.Context;
import android.os.UserHandle;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
import android.platform.test.flag.junit.SetFlagsRule;
import androidx.preference.Preference;
import com.android.settings.R;
import com.android.settings.flags.Flags;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -62,9 +57,6 @@ import org.robolectric.RuntimeEnvironment;
@RunWith(RobolectricTestRunner.class)
public class AutoTimeZonePreferenceControllerTest {
@Rule
public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
@Mock
private UpdateTimeAndDateCallback mCallback;
private Context mContext;
@@ -247,7 +239,6 @@ public class AutoTimeZonePreferenceControllerTest {
}
@Test
@EnableFlags({Flags.FLAG_REVAMP_TOGGLES})
public void toggleOff_revampFlagOn_shouldToggleOffUseLocation() {
TimeZoneCapabilitiesAndConfig capabilitiesAndConfig = createCapabilitiesAndConfig(
/* autoSupported= */ true,
@@ -266,25 +257,6 @@ public class AutoTimeZonePreferenceControllerTest {
verify(mTimeManager).updateTimeZoneConfiguration(configuration);
}
@Test
@DisableFlags({Flags.FLAG_REVAMP_TOGGLES})
public void toggleOff_revampFlagOff_shouldToggleOffUseLocation() {
TimeZoneCapabilitiesAndConfig capabilitiesAndConfig = createCapabilitiesAndConfig(
/* autoSupported= */ true,
/* autoEnabled= */ true,
/* telephonySupported= */ true,
/* locationSupported= */ true);
when(mTimeManager.getTimeZoneCapabilitiesAndConfig()).thenReturn(capabilitiesAndConfig);
mController.setChecked(false);
TimeZoneConfiguration configuration = new TimeZoneConfiguration.Builder()
.setAutoDetectionEnabled(false)
.build();
verify(mTimeManager).updateTimeZoneConfiguration(configuration);
}
private static TimeZoneCapabilitiesAndConfig createCapabilitiesAndConfig(
boolean autoSupported, boolean autoEnabled, boolean telephonySupported) {
return createCapabilitiesAndConfig(autoSupported, autoEnabled, telephonySupported, false);