diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-05 15:23:13 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-05 15:23:13 +0000 |
commit | 300a8683b9c28424fb0f0c571a0abe128c461f69 (patch) | |
tree | 3a325b0effac02fbd228b8ddf2f96589e5df72cd /java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java | |
parent | d67f1627521b174f12e0c247f154c7c93c5e408e (diff) | |
parent | 10b34a5ebf12e97ecba0caf3c8e30b476b038a96 (diff) |
Update Dialer to V10 RC16
am: 10b34a5ebf
Change-Id: Iea3e96ccdeaf1fa796ceca702cace82ca20f298c
Diffstat (limited to 'java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java')
-rw-r--r-- | java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java | 50 |
1 files changed, 9 insertions, 41 deletions
diff --git a/java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java b/java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java index 423fd11b4..ac5f3cac9 100644 --- a/java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java +++ b/java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java @@ -17,7 +17,6 @@ import android.annotation.TargetApi; import android.content.Intent; import android.os.Build.VERSION_CODES; import android.os.Bundle; -import android.preference.CheckBoxPreference; import android.preference.Preference; import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceFragment; @@ -29,6 +28,8 @@ import android.telephony.TelephonyManager; import com.android.dialer.common.Assert; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; +import com.android.dialer.notification.NotificationChannelManager; +import com.android.dialer.notification.NotificationChannelManager.Channel; import com.android.voicemail.VoicemailClient; import com.android.voicemail.VoicemailComponent; import com.android.voicemail.impl.OmtpVvmCarrierConfigHelper; @@ -43,7 +44,6 @@ import com.android.voicemail.impl.sync.VvmAccountManager; @TargetApi(VERSION_CODES.O) public class VoicemailSettingsFragment extends PreferenceFragment implements Preference.OnPreferenceChangeListener, - VoicemailRingtonePreference.VoicemailRingtoneNameChangeListener, VvmAccountManager.Listener { private static final String TAG = "VmSettingsActivity"; @@ -51,17 +51,12 @@ public class VoicemailSettingsFragment extends PreferenceFragment @Nullable private PhoneAccountHandle phoneAccountHandle; private OmtpVvmCarrierConfigHelper omtpVvmCarrierConfigHelper; - private VoicemailRingtonePreference voicemailRingtonePreference; - private CheckBoxPreference voicemailVibration; + private Preference voicemailNotificationPreference; private SwitchPreference voicemailVisualVoicemail; private SwitchPreference autoArchiveSwitchPreference; private Preference voicemailChangePinPreference; private PreferenceScreen advancedSettings; - // The ringtone name is retrieved with an async call. Cache the old name so there will be no jank - // during transition. - private CharSequence oldRingtoneName = ""; - @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); @@ -86,12 +81,12 @@ public class VoicemailSettingsFragment extends PreferenceFragment PreferenceScreen prefSet = getPreferenceScreen(); - voicemailRingtonePreference = - (VoicemailRingtonePreference) - findPreference(getString(R.string.voicemail_notification_ringtone_key)); - voicemailRingtonePreference.setVoicemailRingtoneNameChangeListener(this); - voicemailRingtonePreference.init(phoneAccountHandle, oldRingtoneName); - voicemailRingtonePreference.setOnPreferenceClickListener( + voicemailNotificationPreference = + findPreference(getString(R.string.voicemail_notifications_key)); + voicemailNotificationPreference.setIntent( + NotificationChannelManager.getInstance() + .getSettingsIntentForChannel(getContext(), Channel.VOICEMAIL, phoneAccountHandle)); + voicemailNotificationPreference.setOnPreferenceClickListener( new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { @@ -102,24 +97,6 @@ public class VoicemailSettingsFragment extends PreferenceFragment } }); - voicemailVibration = - (CheckBoxPreference) findPreference(getString(R.string.voicemail_notification_vibrate_key)); - voicemailVibration.setOnPreferenceChangeListener(this); - voicemailVibration.setChecked( - getContext() - .getSystemService(TelephonyManager.class) - .isVoicemailVibrationEnabled(phoneAccountHandle)); - voicemailVibration.setOnPreferenceClickListener( - new OnPreferenceClickListener() { - @Override - public boolean onPreferenceClick(Preference preference) { - Logger.get(getContext()) - .logImpression(DialerImpression.Type.VVM_CHANGE_VIBRATION_CLICKED); - // Let the preference handle the click. - return false; - } - }); - voicemailVisualVoicemail = (SwitchPreference) findPreference(getString(R.string.voicemail_visual_voicemail_key)); @@ -219,10 +196,6 @@ public class VoicemailSettingsFragment extends PreferenceFragment logArchiveToggle((boolean) objValue); VisualVoicemailSettingsUtil.setArchiveEnabled( getContext(), phoneAccountHandle, (boolean) objValue); - } else if (preference.getKey().equals(voicemailVibration.getKey())) { - getContext() - .getSystemService(TelephonyManager.class) - .setVoicemailVibrationEnabled(phoneAccountHandle, (boolean) objValue); } // Always let the preference setting proceed. @@ -255,11 +228,6 @@ public class VoicemailSettingsFragment extends PreferenceFragment } @Override - public void onVoicemailRingtoneNameChanged(CharSequence name) { - oldRingtoneName = name; - } - - @Override public void onActivationStateChanged(PhoneAccountHandle phoneAccountHandle, boolean isActivated) { if (this.phoneAccountHandle.equals(phoneAccountHandle)) { updateChangePin(); |