diff options
Diffstat (limited to 'java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java')
-rw-r--r-- | java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java b/java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java index ac5f3cac9..4860649b3 100644 --- a/java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java +++ b/java/com/android/voicemail/impl/settings/VoicemailSettingsFragment.java @@ -22,6 +22,7 @@ import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; import android.preference.SwitchPreference; +import android.provider.Settings; import android.support.annotation.Nullable; import android.telecom.PhoneAccountHandle; import android.telephony.TelephonyManager; @@ -29,7 +30,6 @@ 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,8 +43,7 @@ import com.android.voicemail.impl.sync.VvmAccountManager; */ @TargetApi(VERSION_CODES.O) public class VoicemailSettingsFragment extends PreferenceFragment - implements Preference.OnPreferenceChangeListener, - VvmAccountManager.Listener { + implements Preference.OnPreferenceChangeListener, VvmAccountManager.Listener { private static final String TAG = "VmSettingsActivity"; @@ -83,9 +82,8 @@ public class VoicemailSettingsFragment extends PreferenceFragment voicemailNotificationPreference = findPreference(getString(R.string.voicemail_notifications_key)); - voicemailNotificationPreference.setIntent( - NotificationChannelManager.getInstance() - .getSettingsIntentForChannel(getContext(), Channel.VOICEMAIL, phoneAccountHandle)); + voicemailNotificationPreference.setIntent(getNotificationSettingsIntent()); + voicemailNotificationPreference.setOnPreferenceClickListener( new OnPreferenceClickListener() { @Override @@ -233,4 +231,12 @@ public class VoicemailSettingsFragment extends PreferenceFragment updateChangePin(); } } + + private Intent getNotificationSettingsIntent() { + String channelId = + NotificationChannelManager.getVoicemailChannelId(getContext(), phoneAccountHandle); + return new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS) + .putExtra(Settings.EXTRA_CHANNEL_ID, channelId) + .putExtra(Settings.EXTRA_APP_PACKAGE, getContext().getPackageName()); + } } |