diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-09 11:52:14 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-09 11:52:14 -0700 |
commit | 648bf5fd9e099cd677f7609afde831ac446deef0 (patch) | |
tree | 75fcc484f84078b53a898215c524051982f272aa /src | |
parent | 86997beac8ccd3d9e1deedb4a7afe6ddeb3a0bd7 (diff) | |
download | packages_apps_Settings-648bf5fd9e099cd677f7609afde831ac446deef0.tar.gz packages_apps_Settings-648bf5fd9e099cd677f7609afde831ac446deef0.tar.bz2 packages_apps_Settings-648bf5fd9e099cd677f7609afde831ac446deef0.zip |
auto import from //branches/cupcake/...@137197
Diffstat (limited to 'src')
3 files changed, 22 insertions, 1 deletions
diff --git a/src/com/android/settings/SoundAndDisplaySettings.java b/src/com/android/settings/SoundAndDisplaySettings.java index 53912e348..2a4e133da 100644 --- a/src/com/android/settings/SoundAndDisplaySettings.java +++ b/src/com/android/settings/SoundAndDisplaySettings.java @@ -50,6 +50,7 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements private static final String KEY_DTMF_TONE = "dtmf_tone"; private static final String KEY_SOUND_EFFECTS = "sound_effects"; private static final String KEY_ANIMATIONS = "animations"; + private static final String KEY_ACCELEROMETER = "accelerometer"; private static final String KEY_PLAY_MEDIA_NOTIFICATION_SOUNDS = "play_media_notification_sounds"; private CheckBoxPreference mSilent; @@ -69,6 +70,7 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements private CheckBoxPreference mDtmfTone; private CheckBoxPreference mSoundEffects; private CheckBoxPreference mAnimations; + private CheckBoxPreference mAccelerometer; private float[] mAnimationScales; private AudioManager mAudioManager; @@ -108,6 +110,8 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements Settings.System.SOUND_EFFECTS_ENABLED, 0) != 0); mAnimations = (CheckBoxPreference) findPreference(KEY_ANIMATIONS); mAnimations.setPersistent(false); + mAccelerometer = (CheckBoxPreference) findPreference(KEY_ACCELEROMETER); + mAccelerometer.setPersistent(false); ListPreference screenTimeoutPreference = (ListPreference) findPreference(KEY_SCREEN_TIMEOUT); @@ -174,6 +178,9 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements if (animations != mAnimations.isChecked() || force) { mAnimations.setChecked(animations); } + mAccelerometer.setChecked(Settings.System.getInt( + getContentResolver(), + Settings.System.ACCELEROMETER_ROTATION, 0) != 0); } @Override @@ -224,6 +231,11 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements mWindowManager.setAnimationScales(mAnimationScales); } catch (RemoteException e) { } + + } else if (preference == mAccelerometer) { + Settings.System.putInt(getContentResolver(), + Settings.System.ACCELEROMETER_ROTATION, + mAccelerometer.isChecked() ? 1 : 0); } return true; } diff --git a/src/com/android/settings/bluetooth/BluetoothDiscoverableEnabler.java b/src/com/android/settings/bluetooth/BluetoothDiscoverableEnabler.java index a51f9b5ea..f1a2a1e40 100644 --- a/src/com/android/settings/bluetooth/BluetoothDiscoverableEnabler.java +++ b/src/com/android/settings/bluetooth/BluetoothDiscoverableEnabler.java @@ -127,7 +127,10 @@ public class BluetoothDiscoverableEnabler implements Preference.OnPreferenceChan int timeout = getDiscoverableTimeout(); manager.setDiscoverableTimeout(timeout); - + + mCheckBoxPreference.setSummaryOn( + mContext.getResources().getString(R.string.bluetooth_is_discoverable, timeout)); + long endTimestamp = System.currentTimeMillis() + timeout * 1000; persistDiscoverableEndTimestamp(endTimestamp); diff --git a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java index a1a2af60c..50edf86f4 100644 --- a/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java +++ b/src/com/android/settings/bluetooth/LocalBluetoothProfileManager.java @@ -132,6 +132,12 @@ public abstract class LocalBluetoothProfileManager { @Override public int connect(String address) { + List<String> sinks = mService.listConnectedSinks(); + if (sinks != null) { + for (String sinkAddress : sinks) { + mService.disconnectSink(sinkAddress); + } + } return mService.connectSink(address); } |