diff options
author | Sam Mortimer <sam@mortimer.me.uk> | 2015-11-19 15:12:52 -0800 |
---|---|---|
committer | Sam Mortimer <sam@mortimer.me.uk> | 2015-11-19 18:56:47 -0800 |
commit | bd3fe676619443b9060ffaa85abfe8e632e4340c (patch) | |
tree | a7645f57fd96c0f381d58a1774bf9e1a76e7e1f4 /src | |
parent | 82dfdc415041cdd832b968890edd0461a47ce9ac (diff) | |
download | packages_apps_Settings-bd3fe676619443b9060ffaa85abfe8e632e4340c.zip packages_apps_Settings-bd3fe676619443b9060ffaa85abfe8e632e4340c.tar.gz packages_apps_Settings-bd3fe676619443b9060ffaa85abfe8e632e4340c.tar.bz2 |
Add isSupported() method to VibratorIntensity class
Change-Id: I801af80f7b1e15954c50f6f9c5eca4f31f949575
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/hardware/VibratorIntensity.java | 5 | ||||
-rw-r--r-- | src/com/android/settings/notification/OtherSoundSettings.java | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/settings/hardware/VibratorIntensity.java b/src/com/android/settings/hardware/VibratorIntensity.java index 009f35f..8bb39ca 100644 --- a/src/com/android/settings/hardware/VibratorIntensity.java +++ b/src/com/android/settings/hardware/VibratorIntensity.java @@ -69,6 +69,11 @@ public class VibratorIntensity extends DialogPreference implements setDialogLayoutResource(R.layout.vibrator_intensity); } + public static boolean isSupported(Context context) { + CMHardwareManager hardware = CMHardwareManager.getInstance(context); + return hardware.isSupported(CMHardwareManager.FEATURE_VIBRATOR); + } + @Override protected void onPrepareDialogBuilder(AlertDialog.Builder builder) { builder.setNeutralButton(R.string.settings_reset_button, diff --git a/src/com/android/settings/notification/OtherSoundSettings.java b/src/com/android/settings/notification/OtherSoundSettings.java index 9e24c34..d49420c 100644 --- a/src/com/android/settings/notification/OtherSoundSettings.java +++ b/src/com/android/settings/notification/OtherSoundSettings.java @@ -149,7 +149,7 @@ public class OtherSoundSettings extends SettingsPreferenceFragment implements In TYPE_SYSTEM, KEY_VIBRATION_INTENSITY, System.HAPTIC_FEEDBACK_ENABLED, DEFAULT_ON) { @Override public boolean isApplicable(Context context) { - return false; //VibratorIntensity.isSupported(); + return VibratorIntensity.isSupported(context); } }; |