sm8150-common: DeviceSettings: Remove vibrator preference when unsupported

guacamoleb (OnePlus7) doesn't have support for vibration intensity changing
and doesn't have the kernel node for it either, remove the pref for such devices.

Change-Id: I58010f032680c86c27db70e5c91dd99921b1a689
Signed-off-by: Anirudh Gupta <anirudhgupta109@aosip.dev>
This commit is contained in:
Anirudh Gupta 2020-03-08 21:01:42 +05:30
parent 332b826ee2
commit 9f3ffc06a7
1 changed files with 2 additions and 2 deletions

View File

@ -85,8 +85,8 @@ public class DeviceSettings extends PreferenceFragment
getActivity().getActionBar().setDisplayHomeAsUpEnabled(true);
mVibratorStrength = (VibratorStrengthPreference) findPreference(KEY_VIBSTRENGTH);
if (mVibratorStrength != null) {
mVibratorStrength.setEnabled(VibratorStrengthPreference.isSupported());
if (mVibratorStrength == null || !VibratorStrengthPreference.isSupported()) {
getPreferenceScreen().removePreference((Preference) findPreference("vibrator"));
}
mTopKeyPref = (ListPreference) findPreference(Constants.NOTIF_SLIDER_TOP_KEY);