diff options
author | Daniel Sandler <dsandler@google.com> | 2010-03-02 20:24:49 -0500 |
---|---|---|
committer | Daniel Sandler <dsandler@google.com> | 2010-03-04 14:06:06 -0500 |
commit | fc01d062c13218e86127ddbfa018ac9c69d68c35 (patch) | |
tree | d52d606c17c5f8e54fd16d5cf6127d1a1c6e3760 /src | |
parent | 4f94e0bee65105d2cb351001babdbd09ae4c84ff (diff) | |
download | packages_apps_Settings-fc01d062c13218e86127ddbfa018ac9c69d68c35.tar.gz packages_apps_Settings-fc01d062c13218e86127ddbfa018ac9c69d68c35.tar.bz2 packages_apps_Settings-fc01d062c13218e86127ddbfa018ac9c69d68c35.zip |
Add a checkbox to the Dock settings to control insertion/removal sound effects.
The sounds are present in the build but are turned off by
default (and there isn't currently a UI to turn them on).
(Mentioned in http://b/2469862)
Change-Id: I9ded1d67cc19204113047aeb8fc8b0123cea1427
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/DockSettings.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/settings/DockSettings.java b/src/com/android/settings/DockSettings.java index fe9aeb7a8..795fb3c64 100644 --- a/src/com/android/settings/DockSettings.java +++ b/src/com/android/settings/DockSettings.java @@ -24,9 +24,11 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; +import android.preference.CheckBoxPreference; import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.PreferenceScreen; +import android.provider.Settings; import com.android.settings.bluetooth.DockEventReceiver; @@ -34,7 +36,9 @@ public class DockSettings extends PreferenceActivity { private static final int DIALOG_NOT_DOCKED = 1; private static final String KEY_AUDIO_SETTINGS = "dock_audio"; + private static final String KEY_DOCK_SOUNDS = "dock_sounds"; private Preference mAudioSettings; + private CheckBoxPreference mDockSounds; private Intent mDockIntent; private BroadcastReceiver mReceiver = new BroadcastReceiver() { @@ -71,10 +75,17 @@ public class DockSettings extends PreferenceActivity { } private void initDockSettings() { + ContentResolver resolver = getContentResolver(); + mAudioSettings = findPreference(KEY_AUDIO_SETTINGS); if (mAudioSettings != null) { mAudioSettings.setSummary(R.string.dock_audio_summary_none); } + + mDockSounds = (CheckBoxPreference) findPreference(KEY_DOCK_SOUNDS); + mDockSounds.setPersistent(false); + mDockSounds.setChecked(Settings.System.getInt(resolver, + Settings.System.DOCK_SOUNDS_ENABLED, 0) != 0); } private void handleDockChange(Intent intent) { @@ -118,6 +129,9 @@ public class DockSettings extends PreferenceActivity { i.setClass(this, DockEventReceiver.class); sendBroadcast(i); } + } else if (preference == mDockSounds) { + Settings.System.putInt(getContentResolver(), Settings.System.DOCK_SOUNDS_ENABLED, + mDockSounds.isChecked() ? 1 : 0); } return true; |