diff options
Diffstat (limited to 'java/com/android/voicemail/impl/sms/OmtpMessageSender.java')
-rw-r--r-- | java/com/android/voicemail/impl/sms/OmtpMessageSender.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/java/com/android/voicemail/impl/sms/OmtpMessageSender.java b/java/com/android/voicemail/impl/sms/OmtpMessageSender.java index 76a258366..8b9e049d5 100644 --- a/java/com/android/voicemail/impl/sms/OmtpMessageSender.java +++ b/java/com/android/voicemail/impl/sms/OmtpMessageSender.java @@ -15,13 +15,15 @@ */ package com.android.voicemail.impl.sms; +import android.annotation.TargetApi; import android.app.PendingIntent; import android.content.Context; +import android.os.Build.VERSION_CODES; import android.support.annotation.Nullable; import android.telecom.PhoneAccountHandle; import android.telephony.SmsManager; +import android.telephony.TelephonyManager; import com.android.voicemail.impl.OmtpConstants; -import com.android.voicemail.impl.TelephonyMangerCompat; import com.android.voicemail.impl.VvmLog; /** @@ -33,6 +35,7 @@ import com.android.voicemail.impl.VvmLog; * * <p>Provides simple APIs to send different types of mobile originated OMTP SMS to the VVM server. */ +@TargetApi(VERSION_CODES.O) public abstract class OmtpMessageSender { protected static final String TAG = "OmtpMessageSender"; protected final Context context; @@ -80,8 +83,10 @@ public abstract class OmtpMessageSender { VvmLog.v( TAG, String.format("Sending sms '%s' to %s:%d", text, destinationNumber, applicationPort)); - TelephonyMangerCompat.sendVisualVoicemailSms( - context, phoneAccountHandle, destinationNumber, applicationPort, text, sentIntent); + context + .getSystemService(TelephonyManager.class) + .createForPhoneAccountHandle(phoneAccountHandle) + .sendVisualVoicemailSms(destinationNumber, applicationPort, text, sentIntent); } protected void appendField(StringBuilder sb, String field, Object value) { |