Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b827de0 authored by Brad Ebinger's avatar Brad Ebinger Committed by android-build-merger
Browse files

Merge "Fixes in responding call via sms"

am: 926347bf

Change-Id: I698c8a33567c4183ba3d0fa976135f8cedf00299
parents 2fafee3f 926347bf
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.TextUtils;
import android.widget.Toast;

import java.util.ArrayList;
@@ -137,7 +138,7 @@ public class RespondViaSmsManager extends CallsManagerListenerBase {
            int subId = mCallsManager.getPhoneAccountRegistrar().getSubscriptionIdForPhoneAccount(
                    call.getTargetPhoneAccount());
            rejectCallWithMessage(call.getContext(), call.getHandle().getSchemeSpecificPart(),
                    textMessage, subId);
                    textMessage, subId, call.getName());
        }
    }

@@ -176,8 +177,8 @@ public class RespondViaSmsManager extends CallsManagerListenerBase {
     * Reject the call with the specified message. If message is null this call is ignored.
     */
    private void rejectCallWithMessage(Context context, String phoneNumber, String textMessage,
            int subId) {
        if (textMessage != null) {
            int subId, String contactName) {
        if (!TextUtils.isEmpty(textMessage)) {
            final ComponentName component =
                    SmsApplication.getDefaultRespondViaMessageApplication(context,
                            true /*updateIfNeeded*/);
@@ -191,7 +192,7 @@ public class RespondViaSmsManager extends CallsManagerListenerBase {
                }

                SomeArgs args = SomeArgs.obtain();
                args.arg1 = phoneNumber;
                args.arg1 = !TextUtils.isEmpty(contactName) ? contactName : phoneNumber;
                args.arg2 = context;
                mHandler.obtainMessage(MSG_SHOW_SENT_TOAST, args).sendToTarget();
                intent.setComponent(component);