Merge "Enhanced Connectivity Enabled Default" into rvc-dev am: 75f0bdb400
am: d19b162a1b
Change-Id: Ib4156289d781519d825cdb08d7894fd4197db8da
This commit is contained in:
@@ -37,7 +37,7 @@ public class EnhancedConnectivityPreferenceController extends
|
|||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static final int ENHANCED_CONNECTIVITY_ON = 1;
|
static final int ENHANCED_CONNECTIVITY_ON = 1;
|
||||||
// default is enhanced connectivity disabled.
|
// default is enhanced connectivity enabled.
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
static final int ENHANCED_CONNECTIVITY_OFF = 0;
|
static final int ENHANCED_CONNECTIVITY_OFF = 0;
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ public class EnhancedConnectivityPreferenceController extends
|
|||||||
public void updateState(Preference preference) {
|
public void updateState(Preference preference) {
|
||||||
final int enhancedConnectivityEnabled = Settings.Global.getInt(
|
final int enhancedConnectivityEnabled = Settings.Global.getInt(
|
||||||
mContext.getContentResolver(), Settings.Global.ENHANCED_CONNECTIVITY_ENABLED,
|
mContext.getContentResolver(), Settings.Global.ENHANCED_CONNECTIVITY_ENABLED,
|
||||||
ENHANCED_CONNECTIVITY_OFF);
|
ENHANCED_CONNECTIVITY_ON);
|
||||||
((SwitchPreference) mPreference).setChecked(
|
((SwitchPreference) mPreference).setChecked(
|
||||||
enhancedConnectivityEnabled == ENHANCED_CONNECTIVITY_ON);
|
enhancedConnectivityEnabled == ENHANCED_CONNECTIVITY_ON);
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ public class EnhancedConnectivityPreferenceController extends
|
|||||||
super.onDeveloperOptionsSwitchDisabled();
|
super.onDeveloperOptionsSwitchDisabled();
|
||||||
Settings.Global.putInt(mContext.getContentResolver(),
|
Settings.Global.putInt(mContext.getContentResolver(),
|
||||||
Settings.Global.ENHANCED_CONNECTIVITY_ENABLED,
|
Settings.Global.ENHANCED_CONNECTIVITY_ENABLED,
|
||||||
ENHANCED_CONNECTIVITY_OFF);
|
ENHANCED_CONNECTIVITY_ON);
|
||||||
((SwitchPreference) mPreference).setChecked(false);
|
((SwitchPreference) mPreference).setChecked(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -88,20 +88,20 @@ public class EnhancedConnectivityPreferenceControllerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onDeveloperOptionsDisabled_shouldDisablePreference() {
|
public void onDeveloperOptionsDisabled_shouldEnablePreference() {
|
||||||
mController.onDeveloperOptionsDisabled();
|
mController.onDeveloperOptionsSwitchDisabled();
|
||||||
|
|
||||||
verify(mPreference).setEnabled(false);
|
verify(mPreference).setEnabled(false);
|
||||||
verify(mPreference).setChecked(false);
|
verify(mPreference).setChecked(true);
|
||||||
|
|
||||||
assertThat(isSettingEnabled()).isFalse();
|
assertThat(isSettingEnabled()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSettingEnabled() {
|
private boolean isSettingEnabled() {
|
||||||
return Settings.Global.getInt(mContext.getContentResolver(),
|
return Settings.Global.getInt(mContext.getContentResolver(),
|
||||||
Settings.Global.ENHANCED_CONNECTIVITY_ENABLED,
|
Settings.Global.ENHANCED_CONNECTIVITY_ENABLED,
|
||||||
EnhancedConnectivityPreferenceController.ENHANCED_CONNECTIVITY_OFF
|
EnhancedConnectivityPreferenceController.ENHANCED_CONNECTIVITY_ON
|
||||||
/* default off */)
|
/* default on */)
|
||||||
== EnhancedConnectivityPreferenceController.ENHANCED_CONNECTIVITY_ON;
|
== EnhancedConnectivityPreferenceController.ENHANCED_CONNECTIVITY_ON;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user