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:
@@ -27,24 +27,20 @@ import android.content.pm.PackageManager;
|
||||
import android.provider.Settings;
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
|
||||
import com.android.settingslib.wrapper.PackageManagerWrapper;
|
||||
|
||||
public class SelectDebugAppPreferenceController extends
|
||||
DeveloperOptionsPreferenceController implements PreferenceControllerMixin,
|
||||
OnActivityResultListener {
|
||||
public class SelectDebugAppPreferenceController extends DeveloperOptionsPreferenceController
|
||||
implements PreferenceControllerMixin, OnActivityResultListener {
|
||||
|
||||
private static final String DEBUG_APP_KEY = "debug_app";
|
||||
|
||||
private final DevelopmentSettingsDashboardFragment mFragment;
|
||||
private final PackageManagerWrapper mPackageManager;
|
||||
|
||||
private Preference mPreference;
|
||||
|
||||
public SelectDebugAppPreferenceController(Context context,
|
||||
DevelopmentSettingsDashboardFragment fragment) {
|
||||
super(context);
|
||||
@@ -57,13 +53,6 @@ public class SelectDebugAppPreferenceController extends
|
||||
return DEBUG_APP_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayPreference(PreferenceScreen screen) {
|
||||
super.displayPreference(screen);
|
||||
|
||||
mPreference = screen.findPreference(getPreferenceKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handlePreferenceTreeClick(Preference preference) {
|
||||
if (DEBUG_APP_KEY.equals(preference.getKey())) {
|
||||
@@ -91,14 +80,9 @@ public class SelectDebugAppPreferenceController extends
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDeveloperOptionsSwitchEnabled() {
|
||||
mPreference.setEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDeveloperOptionsSwitchDisabled() {
|
||||
mPreference.setEnabled(false);
|
||||
super.onDeveloperOptionsSwitchDisabled();
|
||||
mPreference.setSummary(mContext.getResources().getString(R.string.debug_app_not_set));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user