use of com.android.voicemail.impl.OmtpVvmCarrierConfigHelper in project android_packages_apps_Dialer by LineageOS.
the class StatusSmsFetcher method onReceive.
@Override
@MainThread
public void onReceive(Context context, Intent intent) {
Assert.isMainThread();
if (ACTION_REQUEST_SENT_INTENT.equals(intent.getAction())) {
int resultCode = getResultCode();
if (resultCode == Activity.RESULT_OK) {
VvmLog.d(TAG, "Request SMS successfully sent");
return;
}
VvmLog.e(TAG, "Request SMS send failed: " + sentSmsResultToString(resultCode));
mFuture.cancel(true);
return;
}
VisualVoicemailSms sms = intent.getExtras().getParcelable(OmtpService.EXTRA_VOICEMAIL_SMS);
if (!mPhoneAccountHandle.equals(sms.getPhoneAccountHandle())) {
return;
}
String eventType = sms.getPrefix();
if (eventType.equals(OmtpConstants.STATUS_SMS_PREFIX)) {
mFuture.complete(sms.getFields());
return;
}
if (eventType.equals(OmtpConstants.SYNC_SMS_PREFIX)) {
return;
}
VvmLog.i(TAG, "VVM SMS with event " + eventType + " received, attempting to translate to STATUS SMS");
OmtpVvmCarrierConfigHelper helper = new OmtpVvmCarrierConfigHelper(context, mPhoneAccountHandle);
VisualVoicemailProtocol protocol = helper.getProtocol();
if (protocol == null) {
return;
}
Bundle translatedBundle = protocol.translateStatusSmsBundle(helper, eventType, sms.getFields());
if (translatedBundle != null) {
VvmLog.i(TAG, "Translated to STATUS SMS");
mFuture.complete(translatedBundle);
}
}
use of com.android.voicemail.impl.OmtpVvmCarrierConfigHelper in project android_packages_apps_Dialer by LineageOS.
the class VoicemailSettingsFragment method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
phoneAccountHandle = Assert.isNotNull(getArguments().getParcelable(VoicemailClient.PARAM_PHONE_ACCOUNT_HANDLE));
omtpVvmCarrierConfigHelper = new OmtpVvmCarrierConfigHelper(getContext(), phoneAccountHandle);
}
Aggregations