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:
@@ -32,8 +32,8 @@ import com.android.settings.Utils;
|
||||
import com.android.settings.core.PreferenceControllerMixin;
|
||||
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
|
||||
|
||||
public class ClearAdbKeysPreferenceController extends
|
||||
DeveloperOptionsPreferenceController implements PreferenceControllerMixin {
|
||||
public class ClearAdbKeysPreferenceController extends DeveloperOptionsPreferenceController
|
||||
implements PreferenceControllerMixin {
|
||||
|
||||
private static final String TAG = "ClearAdbPrefCtrl";
|
||||
private static final String CLEAR_ADB_KEYS = "clear_adb_keys";
|
||||
@@ -44,8 +44,6 @@ public class ClearAdbKeysPreferenceController extends
|
||||
private final IUsbManager mUsbManager;
|
||||
private final DevelopmentSettingsDashboardFragment mFragment;
|
||||
|
||||
private Preference mPreference;
|
||||
|
||||
public ClearAdbKeysPreferenceController(Context context,
|
||||
DevelopmentSettingsDashboardFragment fragment) {
|
||||
super(context);
|
||||
@@ -68,7 +66,6 @@ public class ClearAdbKeysPreferenceController extends
|
||||
public void displayPreference(PreferenceScreen screen) {
|
||||
super.displayPreference(screen);
|
||||
|
||||
mPreference = screen.findPreference(getPreferenceKey());
|
||||
if (mPreference != null && !isAdminUser()) {
|
||||
mPreference.setEnabled(false);
|
||||
}
|
||||
@@ -94,11 +91,6 @@ public class ClearAdbKeysPreferenceController extends
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDeveloperOptionsSwitchDisabled() {
|
||||
mPreference.setEnabled(false);
|
||||
}
|
||||
|
||||
public void onClearAdbKeysConfirmed() {
|
||||
try {
|
||||
mUsbManager.clearUsbDebuggingKeys();
|
||||
|
Reference in New Issue
Block a user