Use super method for Vibration preferences

onDisplayPreferenceDialog is overriden to handle BT related preferences
but VibrationPreferences require the super method of
onDisplayPreferenceDialog. Therefore if VibrationPreferences wants to
display a dialog, use the super method instead of the overriden method.

Bug: 150661723
Change-Id: I3f8e86e1d1f32fa6eae2798d3bad3cb48402db7b
Merged-In: I3f8e86e1d1f32fa6eae2798d3bad3cb48402db7b
(cherry picked from commit eb27aefa32)
This commit is contained in:
Vince Leung
2020-03-10 14:00:02 -07:00
parent 71f088666a
commit 7d6c329746

View File

@@ -76,6 +76,7 @@ public class SoundSettings extends DashboardFragment implements OnActivityResult
private RingtonePreference mRequestPreference; private RingtonePreference mRequestPreference;
private UpdatableListPreferenceDialogFragment mDialogFragment; private UpdatableListPreferenceDialogFragment mDialogFragment;
private String mHfpOutputControllerKey; private String mHfpOutputControllerKey;
private String mVibrationPreferencesKey = "vibration_preference_screen";
@Override @Override
public int getMetricsCategory() { public int getMetricsCategory() {
@@ -127,6 +128,10 @@ public class SoundSettings extends DashboardFragment implements OnActivityResult
@Override @Override
public void onDisplayPreferenceDialog(Preference preference) { public void onDisplayPreferenceDialog(Preference preference) {
if (TextUtils.equals(mVibrationPreferencesKey, preference.getKey())) {
super.onDisplayPreferenceDialog(preference);
return;
}
final int metricsCategory; final int metricsCategory;
if (mHfpOutputControllerKey.equals(preference.getKey())) { if (mHfpOutputControllerKey.equals(preference.getKey())) {
metricsCategory = SettingsEnums.DIALOG_SWITCH_HFP_DEVICES; metricsCategory = SettingsEnums.DIALOG_SWITCH_HFP_DEVICES;
@@ -311,4 +316,4 @@ public class SoundSettings extends DashboardFragment implements OnActivityResult
mDialogFragment.onListPreferenceUpdated(preference); mDialogFragment.onListPreferenceUpdated(preference);
} }
} }
} }