From f68494cf93de2a36a3696f4800d778cebc813484 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 13 Feb 2015 18:08:17 -0800 Subject: 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 --- res/values/strings.xml | 3 --- res/xml/general_settings.xml | 21 +-------------------- .../dialer/settings/DialerSettingsActivity.java | 16 ++++++++++++---- .../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 @@ Dialpad tones - - Other - Quick responses 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 @@ - - - - - - - - - - - \ No newline at end of file + 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
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; } -- cgit v1.2.3