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 --- .../android/dialer/settings/DialerSettingsActivity.java | 16 ++++++++++++---- .../android/dialer/settings/GeneralSettingsFragment.java | 6 ------ 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'src/com') 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