am 22e18689: packages/apps/Setting: Make vkey button haptics part of global haptic setting

Merge commit '22e186898e47cf35a49e73494bf11695c854d284' into eclair-plus-aosp

* commit '22e186898e47cf35a49e73494bf11695c854d284':
  packages/apps/Setting: Make vkey button haptics part of global haptic setting
This commit is contained in:
Dan Murphy
2009-09-25 14:18:56 -07:00
committed by Android Git Automerger
3 changed files with 24 additions and 0 deletions

View File

@@ -874,6 +874,12 @@
<!-- Sound settings screen, setting option summary text when check box is clear --> <!-- Sound settings screen, setting option summary text when check box is clear -->
<string name="sound_effects_enable_summary_off">Play sound when making screen selection</string> <string name="sound_effects_enable_summary_off">Play sound when making screen selection</string>
<!-- Sound settings screen, setting check box label --> <!-- Sound settings screen, setting check box label -->
<string name="haptic_feedback_enable_title">Haptic feedback</string>
<!-- Sound settings screen, setting option summary text when check box is selected -->
<string name="haptic_feedback_enable_summary_on">Vibrate when pressing soft keys and on certain UI interactions</string>
<!-- Sound settings screen, setting option summary text when check box is clear -->
<string name="haptic_feedback_enable_summary_off">Vibrate when pressing soft keys and on certain UI interactions</string>
<!-- Sound settings screen, setting check box label -->
<string name="play_media_notification_sounds_enable_title">SD card notifications</string> <string name="play_media_notification_sounds_enable_title">SD card notifications</string>
<!-- Sound settings screen, setting option summary text when check box is selected --> <!-- Sound settings screen, setting option summary text when check box is selected -->
<string name="play_media_notification_sounds_enable_summary_on">Play sound for SD card notifications</string> <string name="play_media_notification_sounds_enable_summary_on">Play sound for SD card notifications</string>

View File

@@ -84,6 +84,14 @@
android:dependency="silent" android:dependency="silent"
android:defaultValue="true" /> android:defaultValue="true" />
<CheckBoxPreference
android:key="haptic_feedback"
android:title="@string/haptic_feedback_enable_title"
android:summaryOn="@string/haptic_feedback_enable_summary_on"
android:summaryOff="@string/haptic_feedback_enable_summary_off"
android:dependency="silent"
android:defaultValue="true" />
<CheckBoxPreference <CheckBoxPreference
android:key="play_media_notification_sounds" android:key="play_media_notification_sounds"
android:title="@string/play_media_notification_sounds_enable_title" android:title="@string/play_media_notification_sounds_enable_title"

View File

@@ -52,6 +52,7 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements
private static final String KEY_SCREEN_TIMEOUT = "screen_timeout"; private static final String KEY_SCREEN_TIMEOUT = "screen_timeout";
private static final String KEY_DTMF_TONE = "dtmf_tone"; private static final String KEY_DTMF_TONE = "dtmf_tone";
private static final String KEY_SOUND_EFFECTS = "sound_effects"; private static final String KEY_SOUND_EFFECTS = "sound_effects";
private static final String KEY_HAPTIC_FEEDBACK = "haptic_feedback";
private static final String KEY_ANIMATIONS = "animations"; private static final String KEY_ANIMATIONS = "animations";
private static final String KEY_ACCELEROMETER = "accelerometer"; private static final String KEY_ACCELEROMETER = "accelerometer";
private static final String KEY_PLAY_MEDIA_NOTIFICATION_SOUNDS = "play_media_notification_sounds"; private static final String KEY_PLAY_MEDIA_NOTIFICATION_SOUNDS = "play_media_notification_sounds";
@@ -73,6 +74,7 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements
private CheckBoxPreference mVibrate; private CheckBoxPreference mVibrate;
private CheckBoxPreference mDtmfTone; private CheckBoxPreference mDtmfTone;
private CheckBoxPreference mSoundEffects; private CheckBoxPreference mSoundEffects;
private CheckBoxPreference mHapticFeedback;
private ListPreference mAnimations; private ListPreference mAnimations;
private CheckBoxPreference mAccelerometer; private CheckBoxPreference mAccelerometer;
private float[] mAnimationScales; private float[] mAnimationScales;
@@ -118,6 +120,10 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements
mSoundEffects.setPersistent(false); mSoundEffects.setPersistent(false);
mSoundEffects.setChecked(Settings.System.getInt(resolver, mSoundEffects.setChecked(Settings.System.getInt(resolver,
Settings.System.SOUND_EFFECTS_ENABLED, 0) != 0); Settings.System.SOUND_EFFECTS_ENABLED, 0) != 0);
mHapticFeedback = (CheckBoxPreference) findPreference(KEY_HAPTIC_FEEDBACK);
mHapticFeedback.setPersistent(false);
mHapticFeedback.setChecked(Settings.System.getInt(resolver,
Settings.System.HAPTIC_FEEDBACK_ENABLED, 0) != 0);
mAnimations = (ListPreference) findPreference(KEY_ANIMATIONS); mAnimations = (ListPreference) findPreference(KEY_ANIMATIONS);
mAnimations.setOnPreferenceChangeListener(this); mAnimations.setOnPreferenceChangeListener(this);
mAccelerometer = (CheckBoxPreference) findPreference(KEY_ACCELEROMETER); mAccelerometer = (CheckBoxPreference) findPreference(KEY_ACCELEROMETER);
@@ -264,6 +270,10 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements
} }
Settings.System.putInt(getContentResolver(), Settings.System.SOUND_EFFECTS_ENABLED, Settings.System.putInt(getContentResolver(), Settings.System.SOUND_EFFECTS_ENABLED,
mSoundEffects.isChecked() ? 1 : 0); mSoundEffects.isChecked() ? 1 : 0);
} else if (preference == mHapticFeedback) {
Settings.System.putInt(getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED,
mHapticFeedback.isChecked() ? 1 : 0);
} else if (preference == mAccelerometer) { } else if (preference == mAccelerometer) {
Settings.System.putInt(getContentResolver(), Settings.System.putInt(getContentResolver(),