Remove unnecessary onDeveloperOptionsSwitchEnabled/Disabled override.
- default implementation has been added in the super class to handle enabling/disabling the preference when the master developer options switch it turned on/off. Removing all subclass that originally implemented the methods that only contains the default behavior. Bug: 73955632 Test: make RunSettingsRoboTests Change-Id: I13c372c2ab498a5786b40cdc1ad3b5f3424abb5a
This commit is contained in:
@@ -18,20 +18,16 @@ package com.android.settings.development;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.preference.ListPreference;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
import com.android.settingslib.development.AbstractLogpersistPreferenceController;
|
||||
|
||||
public class LogPersistPreferenceController extends
|
||||
AbstractLogpersistPreferenceController implements PreferenceControllerMixin {
|
||||
public class LogPersistPreferenceController extends AbstractLogpersistPreferenceController
|
||||
implements PreferenceControllerMixin {
|
||||
|
||||
private final DevelopmentSettingsDashboardFragment mFragment;
|
||||
private ListPreference mPreference;
|
||||
|
||||
|
||||
public LogPersistPreferenceController(Context context,
|
||||
DevelopmentSettingsDashboardFragment fragment, Lifecycle lifecycle) {
|
||||
@@ -55,27 +51,15 @@ public class LogPersistPreferenceController extends
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayPreference(PreferenceScreen screen) {
|
||||
super.displayPreference(screen);
|
||||
|
||||
mPreference = (ListPreference) screen.findPreference(getPreferenceKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
updateLogpersistValues();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDeveloperOptionsSwitchEnabled() {
|
||||
mPreference.setEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDeveloperOptionsSwitchDisabled() {
|
||||
super.onDeveloperOptionsSwitchDisabled();
|
||||
writeLogpersistOption(null /* new value */, true);
|
||||
mPreference.setEnabled(false);
|
||||
}
|
||||
|
||||
public void onDisableLogPersistDialogConfirmed() {
|
||||
|
Reference in New Issue
Block a user