diff options
Diffstat (limited to 'java/com/android/dialer/app/settings')
3 files changed, 19 insertions, 11 deletions
diff --git a/java/com/android/dialer/app/settings/AppCompatPreferenceActivity.java b/java/com/android/dialer/app/settings/AppCompatPreferenceActivity.java index e8e425626..2c464386b 100644 --- a/java/com/android/dialer/app/settings/AppCompatPreferenceActivity.java +++ b/java/com/android/dialer/app/settings/AppCompatPreferenceActivity.java @@ -18,6 +18,7 @@ package com.android.dialer.app.settings; import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceActivity; +import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatDelegate; import android.support.v7.widget.Toolbar; import android.view.MenuInflater; @@ -48,6 +49,10 @@ public class AppCompatPreferenceActivity extends PreferenceActivity { getDelegate().onPostCreate(savedInstanceState); } + public ActionBar getSupportActionBar() { + return getDelegate().getSupportActionBar(); + } + public void setSupportActionBar(Toolbar toolbar) { getDelegate().setSupportActionBar(toolbar); } diff --git a/java/com/android/dialer/app/settings/DialerSettingsActivity.java b/java/com/android/dialer/app/settings/DialerSettingsActivity.java index 6036c85ce..f1c270ca9 100644 --- a/java/com/android/dialer/app/settings/DialerSettingsActivity.java +++ b/java/com/android/dialer/app/settings/DialerSettingsActivity.java @@ -36,6 +36,7 @@ import com.android.dialer.about.AboutPhoneFragment; import com.android.dialer.app.R; import com.android.dialer.blocking.FilteredNumberCompat; import com.android.dialer.common.LogUtil; +import com.android.dialer.compat.CompatUtils; import com.android.dialer.proguard.UsedByReflection; import com.android.voicemail.VoicemailClient; import com.android.voicemail.VoicemailComponent; @@ -82,12 +83,14 @@ public class DialerSettingsActivity extends AppCompatPreferenceActivity { soundSettingsHeader.id = R.id.settings_header_sounds_and_vibration; target.add(soundSettingsHeader); - 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); + if (CompatUtils.isMarshmallowCompatible()) { + 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); + } TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); diff --git a/java/com/android/dialer/app/settings/SoundSettingsFragment.java b/java/com/android/dialer/app/settings/SoundSettingsFragment.java index dcfb7a595..83ce45398 100644 --- a/java/com/android/dialer/app/settings/SoundSettingsFragment.java +++ b/java/com/android/dialer/app/settings/SoundSettingsFragment.java @@ -23,11 +23,11 @@ import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.Vibrator; +import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.Preference; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; -import android.preference.SwitchPreference; import android.provider.Settings; import android.telephony.CarrierConfigManager; import android.telephony.TelephonyManager; @@ -68,8 +68,8 @@ public class SoundSettingsFragment extends PreferenceFragment updateRingtonePreferenceSummary(); } }; - private SwitchPreference mVibrateWhenRinging; - private SwitchPreference mPlayDtmfTone; + private CheckBoxPreference mVibrateWhenRinging; + private CheckBoxPreference mPlayDtmfTone; private ListPreference mDtmfToneLength; @Override @@ -87,9 +87,9 @@ public class SoundSettingsFragment extends PreferenceFragment mRingtonePreference = findPreference(context.getString(R.string.ringtone_preference_key)); mVibrateWhenRinging = - (SwitchPreference) findPreference(context.getString(R.string.vibrate_on_preference_key)); + (CheckBoxPreference) findPreference(context.getString(R.string.vibrate_on_preference_key)); mPlayDtmfTone = - (SwitchPreference) findPreference(context.getString(R.string.play_dtmf_preference_key)); + (CheckBoxPreference) findPreference(context.getString(R.string.play_dtmf_preference_key)); mDtmfToneLength = (ListPreference) findPreference(context.getString(R.string.dtmf_tone_length_preference_key)); |