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

Commit 4d9fc4d4 authored by Brad Ebinger's avatar Brad Ebinger Committed by android-build-merger
Browse files

Merge "Fixes in responding call via sms" am: 926347bf

am: 0b827de0

Change-Id: Ifa9b1053988a664d6a272238f5c43a5fc7c1badb
parents f199dc70 0b827de0
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -38,6 +38,7 @@ import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.TelephonyManager;
import android.text.Spannable;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableString;
import android.text.TextUtils;
import android.widget.Toast;
import android.widget.Toast;


import java.util.ArrayList;
import java.util.ArrayList;
@@ -137,7 +138,7 @@ public class RespondViaSmsManager extends CallsManagerListenerBase {
            int subId = mCallsManager.getPhoneAccountRegistrar().getSubscriptionIdForPhoneAccount(
            int subId = mCallsManager.getPhoneAccountRegistrar().getSubscriptionIdForPhoneAccount(
                    call.getTargetPhoneAccount());
                    call.getTargetPhoneAccount());
            rejectCallWithMessage(call.getContext(), call.getHandle().getSchemeSpecificPart(),
            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.
     * Reject the call with the specified message. If message is null this call is ignored.
     */
     */
    private void rejectCallWithMessage(Context context, String phoneNumber, String textMessage,
    private void rejectCallWithMessage(Context context, String phoneNumber, String textMessage,
            int subId) {
            int subId, String contactName) {
        if (textMessage != null) {
        if (!TextUtils.isEmpty(textMessage)) {
            final ComponentName component =
            final ComponentName component =
                    SmsApplication.getDefaultRespondViaMessageApplication(context,
                    SmsApplication.getDefaultRespondViaMessageApplication(context,
                            true /*updateIfNeeded*/);
                            true /*updateIfNeeded*/);
@@ -191,7 +192,7 @@ public class RespondViaSmsManager extends CallsManagerListenerBase {
                }
                }


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