diff options
author | Andrew Lee <anwlee@google.com> | 2015-02-13 18:08:17 -0800 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-02-19 12:07:52 -0800 |
commit | f68494cf93de2a36a3696f4800d778cebc813484 (patch) | |
tree | 4c17e0135f03e99244e774fcd7c82e465483e76a | |
parent | d40d3a2a3083b5b929bed29940dca46169f984e2 (diff) |
Move QuickResponseSettings to top-level.
+ Add "Quick responses" header to DialerSettingsActivity.
- Delete code in GeneralSettingsFragment related to quick responses.
- Delete the RespondViaSms PreferenceScreen from the general settings
layout.
- Remove unused "other" label string.
Bug: 19372734
Change-Id: I5067da19b1eab5aa370e687556b368c7bd010e2c
-rw-r--r-- | res/values/strings.xml | 3 | ||||
-rw-r--r-- | res/xml/general_settings.xml | 21 | ||||
-rw-r--r-- | src/com/android/dialer/settings/DialerSettingsActivity.java | 16 | ||||
-rw-r--r-- | src/com/android/dialer/settings/GeneralSettingsFragment.java | 6 |
4 files changed, 13 insertions, 33 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 5d0685227..baa774693 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -711,9 +711,6 @@ <!-- Setting option name to enable or disable DTMF tone sound [CHAR LIMIT=30] --> <string name="dtmf_tone_enable_title">Dialpad tones</string> - <!-- Label for section of general call settings where miscellaneous settings are listed. --> - <string name="other_settings_title">Other</string> - <!-- Title of settings screen for managing the "Respond via SMS" feature. [CHAR LIMIT=30] --> <string name="respond_via_sms_setting_title">Quick responses</string> diff --git a/res/xml/general_settings.xml b/res/xml/general_settings.xml index b1a78c1f2..29845ed8b 100644 --- a/res/xml/general_settings.xml +++ b/res/xml/general_settings.xml @@ -61,23 +61,4 @@ </PreferenceCategory> - <PreferenceCategory - android:key="dialer_general_other_settings_category_key" - android:title="@string/other_settings_title" - android:persistent="false" > - - <PreferenceScreen - android:key="button_respond_via_sms_key" - android:title="@string/respond_via_sms_setting_title" - android:persistent="false"> - - <intent - android:action="android.intent.action.MAIN" - android:targetPackage="com.android.server.telecom" - android:targetClass="com.android.server.telecom.RespondViaSmsSettings$Settings" /> - - </PreferenceScreen> - - </PreferenceCategory> - -</PreferenceScreen>
\ No newline at end of file +</PreferenceScreen> diff --git a/src/com/android/dialer/settings/DialerSettingsActivity.java b/src/com/android/dialer/settings/DialerSettingsActivity.java index de07128ca..d6e882684 100644 --- a/src/com/android/dialer/settings/DialerSettingsActivity.java +++ b/src/com/android/dialer/settings/DialerSettingsActivity.java @@ -2,6 +2,7 @@ package com.android.dialer.settings; import com.google.common.collect.Lists; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; @@ -42,18 +43,25 @@ public class DialerSettingsActivity extends PreferenceActivity { @Override public void onBuildHeaders(List<Header> target) { - final Header generalSettingsHeader = new Header(); + Header generalSettingsHeader = new Header(); generalSettingsHeader.titleRes = R.string.general_settings_label; generalSettingsHeader.fragment = GeneralSettingsFragment.class.getName(); target.add(generalSettingsHeader); + Header quickResponseSettingsHeader = new Header(); + Intent quickResponseSettingsIntent = + new Intent(TelecomManager.ACTION_SHOW_RESPOND_VIA_SMS_SETTINGS); + quickResponseSettingsHeader.titleRes = R.string.respond_via_sms_setting_title; + quickResponseSettingsHeader.intent = quickResponseSettingsIntent; + target.add(quickResponseSettingsHeader); + // Only show call setting menus if the current user is the primary/owner user. if (isPrimaryUser()) { - final TelephonyManager telephonyManager = + TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); // Show "Call Settings" if there is one SIM and "Phone Accounts" if there are more. if (telephonyManager.getPhoneCount() <= 1) { - final Header callSettingsHeader = new Header(); + Header callSettingsHeader = new Header(); Intent callSettingsIntent = new Intent(TelecomManager.ACTION_SHOW_CALL_SETTINGS); callSettingsIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); @@ -61,7 +69,7 @@ public class DialerSettingsActivity extends PreferenceActivity { callSettingsHeader.intent = callSettingsIntent; target.add(callSettingsHeader); } else { - final Header phoneAccountSettingsHeader = new Header(); + Header phoneAccountSettingsHeader = new Header(); Intent phoneAccountSettingsIntent = new Intent(TelecomManager.ACTION_CHANGE_PHONE_ACCOUNTS); phoneAccountSettingsIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); diff --git a/src/com/android/dialer/settings/GeneralSettingsFragment.java b/src/com/android/dialer/settings/GeneralSettingsFragment.java index cad55e90a..7d8228642 100644 --- a/src/com/android/dialer/settings/GeneralSettingsFragment.java +++ b/src/com/android/dialer/settings/GeneralSettingsFragment.java @@ -46,7 +46,6 @@ public class GeneralSettingsFragment extends PreferenceFragment 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"; - private static final String BUTTON_RESPOND_VIA_SMS_KEY = "button_respond_via_sms_key"; private static final int MSG_UPDATE_RINGTONE_SUMMARY = 1; @@ -55,7 +54,6 @@ public class GeneralSettingsFragment extends PreferenceFragment private Preference mRingtonePreference; private CheckBoxPreference mVibrateWhenRinging; private CheckBoxPreference mPlayDtmfTone; - private Preference mRespondViaSms; private Runnable mRingtoneLookupRunnable; private final Handler mRingtoneLookupComplete = new Handler() { @@ -80,7 +78,6 @@ public class GeneralSettingsFragment extends PreferenceFragment mRingtonePreference = findPreference(BUTTON_RINGTONE_KEY); mVibrateWhenRinging = (CheckBoxPreference) findPreference(BUTTON_VIBRATE_ON_RING); mPlayDtmfTone = (CheckBoxPreference) findPreference(BUTTON_PLAY_DTMF_TONE); - mRespondViaSms = findPreference(BUTTON_RESPOND_VIA_SMS_KEY); PreferenceCategory soundCategory = (PreferenceCategory) findPreference(CATEGORY_SOUNDS_KEY); if (mVibrateWhenRinging != null) { @@ -138,9 +135,6 @@ public class GeneralSettingsFragment extends PreferenceFragment if (preference == mPlayDtmfTone) { Settings.System.putInt(mContext.getContentResolver(), Settings.System.DTMF_TONE_WHEN_DIALING, mPlayDtmfTone.isChecked() ? 1 : 0); - } else if (preference == mRespondViaSms) { - // Needs to return false for the intent to launch. - return false; } return true; } |