<!-- Whether toggle_airplane is available or not. -->
<bool name="config_show_toggle_airplane">true</bool>
+ <!-- Whether private_dns_settings is available or not. -->
+ <bool name="config_show_private_dns_settings">true</bool>
+
<!-- Whether memory from app_info_settings is available or not. -->
<bool name="config_show_app_info_settings_memory">false</bool>
<bool name="config_additional_system_update_setting_enable">true</bool>
<bool name="config_show_wifi_settings">false</bool>
<bool name="config_show_toggle_airplane">false</bool>
+ <bool name="config_show_private_dns_settings">false</bool>
<bool name="config_show_app_info_settings_memory">true</bool>
<bool name="config_show_app_info_settings_battery">false</bool>
<bool name="config_show_high_power_apps">false</bool>
import static android.provider.Settings.Global.PRIVATE_DNS_SPECIFIER;
import static androidx.lifecycle.Lifecycle.Event.ON_START;
import static androidx.lifecycle.Lifecycle.Event.ON_STOP;
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Matchers.anyString;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import org.robolectric.annotation.Config;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.shadow.api.Shadow;
import org.robolectric.shadows.ShadowContentResolver;
}
@Test
+ public void getAvailibilityStatus_availableByDefault() {
+ assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+ }
+
+ @Test
+ @Config(qualifiers = "mcc999")
+ public void getAvailabilityStatus_unsupportedWhenSet() {
+ assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
+ }
+
+ @Test
public void goThroughLifecycle_shouldRegisterUnregisterSettingsObserver() {
mLifecycle.handleLifecycleEvent(ON_START);
verify(mContext, atLeastOnce()).getContentResolver();