diff options
author | twyen <twyen@google.com> | 2018-04-16 14:02:01 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-04-16 14:44:02 -0700 |
commit | e9df43a95bfe84c1e7533423daee4d374ae5f1be (patch) | |
tree | f7618be438ef02573611f6a6522d97ec68d8fdcd /java/com/android/voicemail/impl/sms | |
parent | 3865d300feeab8c7695762e86004804c052577ae (diff) |
Remove voicemail/impl/TelephonyMangerCompat
These reflection calls are used for the transition period when amending VVM APIs in O. The public version should be used now.
TEST=TAP
Bug: 77334965
Test: TAP
PiperOrigin-RevId: 193095281
Change-Id: Ifaf2e78f007a155221146b40369aaed66d4325c6
Diffstat (limited to 'java/com/android/voicemail/impl/sms')
-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) { |