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:
Doris Ling
2018-03-01 10:33:14 -08:00
parent 46d6ecc2b1
commit 4fbf04cd10
131 changed files with 489 additions and 1699 deletions

View File

@@ -27,7 +27,6 @@ import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceScreen;
import android.text.TextUtils;
import com.android.settings.R;
@@ -37,9 +36,8 @@ import com.android.settingslib.wrapper.PackageManagerWrapper;
import java.util.List;
public class MockLocationAppPreferenceController extends
DeveloperOptionsPreferenceController implements PreferenceControllerMixin,
OnActivityResultListener {
public class MockLocationAppPreferenceController extends DeveloperOptionsPreferenceController
implements PreferenceControllerMixin, OnActivityResultListener {
private static final String MOCK_LOCATION_APP_KEY = "mock_location_app";
private static final int[] MOCK_LOCATION_APP_OPS = new int[]{AppOpsManager.OP_MOCK_LOCATION};
@@ -47,7 +45,6 @@ public class MockLocationAppPreferenceController extends
private final DevelopmentSettingsDashboardFragment mFragment;
private final AppOpsManager mAppsOpsManager;
private final PackageManagerWrapper mPackageManager;
private Preference mPreference;
public MockLocationAppPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment) {
@@ -63,13 +60,6 @@ public class MockLocationAppPreferenceController extends
return MOCK_LOCATION_APP_KEY;
}
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
mPreference = screen.findPreference(getPreferenceKey());
}
@Override
public boolean handlePreferenceTreeClick(Preference preference) {
if (!TextUtils.equals(preference.getKey(), getPreferenceKey())) {
@@ -97,16 +87,6 @@ public class MockLocationAppPreferenceController extends
return true;
}
@Override
protected void onDeveloperOptionsSwitchEnabled() {
mPreference.setEnabled(true);
}
@Override
protected void onDeveloperOptionsSwitchDisabled() {
mPreference.setEnabled(false);
}
private void updateMockLocation() {
final String mockLocationApp = getCurrentMockLocationApp();