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

Commit ecaaeac2 authored by Santos Cordon's avatar Santos Cordon
Browse files

Don't show quick response messages for private numbers.

The respond-to-sms code was seeing "tel:" as the uri address, so I
updated the code so that restricted, unknown, and the above example all
get translated to a null address. This forces everything to work as
intended.

Bug: 18092431
Change-Id: Ibad1b510afd523268a9a37e2f48d0d62a7a7ebe4
parent 64883a94
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -680,7 +680,7 @@ public final class BluetoothPhoneService extends Service {

        String ringingAddress = null;
        int ringingAddressType = 128;
        if (ringingCall != null) {
        if (ringingCall != null && ringingCall.getHandle() != null) {
            ringingAddress = ringingCall.getHandle().getSchemeSpecificPart();
            if (ringingAddress != null) {
                ringingAddressType = PhoneNumberUtils.toaFromString(ringingAddress);
+11 −1
Original line number Diff line number Diff line
@@ -417,8 +417,18 @@ final class Call implements CreateConnectionResponse {

    void setHandle(Uri handle, int presentation) {
        if (!Objects.equals(handle, mHandle) || presentation != mHandlePresentation) {
            mHandle = handle;
            mHandlePresentation = presentation;
            if (mHandlePresentation == TelecomManager.PRESENTATION_RESTRICTED ||
                    mHandlePresentation == TelecomManager.PRESENTATION_UNKNOWN) {
                mHandle = null;
            } else {
                mHandle = handle;
                if (mHandle != null && TextUtils.isEmpty(mHandle.getSchemeSpecificPart())) {
                    // If the number is actually empty, set it to null.
                    mHandle = null;
                }
            }

            mIsEmergencyCall = mHandle != null && PhoneNumberUtils.isLocalEmergencyNumber(mContext,
                    mHandle.getSchemeSpecificPart());
            startCallerInfoLookup();
+1 −2
Original line number Diff line number Diff line
@@ -139,8 +139,7 @@ public class RespondViaSmsManager extends CallsManagerListenerBase {

    @Override
    public void onIncomingCallRejected(Call call, boolean rejectWithMessage, String textMessage) {
        if (rejectWithMessage) {

        if (rejectWithMessage && call.getHandle() != null) {
            rejectCallWithMessage(call.getContext(), call.getHandle().getSchemeSpecificPart(),
                    textMessage);
        }