Remove duplicate preferences in Accessibility settings.

- addPreferencesFromResource() call has been added to
InstrumentedPreferenceFragment, and hence sub-class should not call it
again.

Change-Id: Ia016d9d407ac3f838c962d1ced585647382a051a
Fixes: 68820835
Test: make RunSettingsRoboTests
This commit is contained in:
Doris Ling
2017-11-02 16:44:50 -07:00
parent 910d452874
commit 024668a2c5
5 changed files with 120 additions and 10 deletions

View File

@@ -59,7 +59,9 @@ public class UnrestrictedDataAccess extends SettingsPreferenceFragment
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setAnimationAllowed(true);
addPreferencesFromResource(R.xml.unrestricted_data_access_settings);
if (!usePreferenceScreenTitle()) {
addPreferencesFromResource(R.xml.unrestricted_data_access_settings);
}
mApplicationsState = ApplicationsState.getInstance(
(Application) getContext().getApplicationContext());
mDataSaverBackend = new DataSaverBackend(getContext());
@@ -208,6 +210,11 @@ public class UnrestrictedDataAccess extends SettingsPreferenceFragment
return MetricsEvent.DATA_USAGE_UNRESTRICTED_ACCESS;
}
@Override
protected int getPreferenceScreenResId() {
return R.xml.unrestricted_data_access_settings;
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (preference instanceof AccessPreference) {