diff options
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/dialer/settings/DialerSettingsActivity.java | 8 | ||||
-rw-r--r-- | src/com/android/dialer/settings/SoundSettingsFragment.java (renamed from src/com/android/dialer/settings/GeneralSettingsFragment.java) | 32 |
2 files changed, 19 insertions, 21 deletions
diff --git a/src/com/android/dialer/settings/DialerSettingsActivity.java b/src/com/android/dialer/settings/DialerSettingsActivity.java index 935b6c7fd..08beffd9b 100644 --- a/src/com/android/dialer/settings/DialerSettingsActivity.java +++ b/src/com/android/dialer/settings/DialerSettingsActivity.java @@ -41,10 +41,10 @@ public class DialerSettingsActivity extends PreferenceActivity { displayOptionsHeader.fragment = DisplayOptionsFragment.class.getName(); target.add(displayOptionsHeader); - Header generalSettingsHeader = new Header(); - generalSettingsHeader.titleRes = R.string.general_settings_label; - generalSettingsHeader.fragment = GeneralSettingsFragment.class.getName(); - target.add(generalSettingsHeader); + Header soundSettingsHeader = new Header(); + soundSettingsHeader.titleRes = R.string.sounds_and_vibration_title; + soundSettingsHeader.fragment = SoundSettingsFragment.class.getName(); + target.add(soundSettingsHeader); Header quickResponseSettingsHeader = new Header(); Intent quickResponseSettingsIntent = diff --git a/src/com/android/dialer/settings/GeneralSettingsFragment.java b/src/com/android/dialer/settings/SoundSettingsFragment.java index 7d8228642..6a9bc1e36 100644 --- a/src/com/android/dialer/settings/GeneralSettingsFragment.java +++ b/src/com/android/dialer/settings/SoundSettingsFragment.java @@ -24,7 +24,6 @@ import android.os.Message; import android.os.Vibrator; import android.preference.CheckBoxPreference; import android.preference.Preference; -import android.preference.PreferenceCategory; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; import android.provider.Settings; @@ -40,9 +39,8 @@ import java.lang.Runnable; import java.lang.String; import java.lang.Thread; -public class GeneralSettingsFragment extends PreferenceFragment +public class SoundSettingsFragment extends PreferenceFragment implements Preference.OnPreferenceChangeListener { - private static final String CATEGORY_SOUNDS_KEY = "dialer_general_sounds_category_key"; private static final String BUTTON_RINGTONE_KEY = "button_ringtone_key"; private static final String BUTTON_VIBRATE_ON_RING = "button_vibrate_on_ring"; private static final String BUTTON_PLAY_DTMF_TONE = "button_play_dtmf_tone"; @@ -73,19 +71,18 @@ public class GeneralSettingsFragment extends PreferenceFragment mContext = getActivity().getApplicationContext(); - addPreferencesFromResource(R.xml.general_settings); + addPreferencesFromResource(R.xml.sound_settings); mRingtonePreference = findPreference(BUTTON_RINGTONE_KEY); mVibrateWhenRinging = (CheckBoxPreference) findPreference(BUTTON_VIBRATE_ON_RING); mPlayDtmfTone = (CheckBoxPreference) findPreference(BUTTON_PLAY_DTMF_TONE); - PreferenceCategory soundCategory = (PreferenceCategory) findPreference(CATEGORY_SOUNDS_KEY); if (mVibrateWhenRinging != null) { Vibrator vibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE); if (vibrator != null && vibrator.hasVibrator()) { mVibrateWhenRinging.setOnPreferenceChangeListener(this); } else { - soundCategory.removePreference(mVibrateWhenRinging); + getPreferenceScreen().removePreference(mVibrateWhenRinging); mVibrateWhenRinging = null; } } @@ -111,6 +108,18 @@ public class GeneralSettingsFragment extends PreferenceFragment }; } + @Override + public void onResume() { + super.onResume(); + + if (mVibrateWhenRinging != null) { + mVibrateWhenRinging.setChecked(getVibrateWhenRingingSetting(mContext)); + } + + // Lookup the ringtone name asynchronously. + new Thread(mRingtoneLookupRunnable).start(); + } + /** * Supports onPreferenceChangeListener to look for preference changes. * @@ -139,17 +148,6 @@ public class GeneralSettingsFragment extends PreferenceFragment return true; } - @Override - public void onResume() { - super.onResume(); - - if (mVibrateWhenRinging != null) { - mVibrateWhenRinging.setChecked(getVibrateWhenRingingSetting(mContext)); - } - - // Lookup the ringtone name asynchronously. - new Thread(mRingtoneLookupRunnable).start(); - } /** * Obtain the setting for "vibrate when ringing" setting. |