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

Commit 401cfd3a authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Propagate verstat from extras if present.

This is used to work around a bug in the remote connection service API
where this property is not being passed through to Telecom.  We
stash the verstat in the connection extras in telephony and make sure to
set it on the Telecom call if a change is detected.

Test: Use connection manager carrier and verify that VERSTAT is now
propagated to Telecom.
Bug: 192608283

Change-Id: I1e0663b5a78ae369af417f32ffc3cdf4a13ba317
parent 8e75b865
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        void onBluetoothCallQualityReport(Call call, BluetoothCallQualityReport report);
        void onReceivedDeviceToDeviceMessage(Call call, int messageType, int messageValue);
        void onReceivedCallQualityReport(Call call, CallQuality callQuality);
        void onCallerNumberVerificationStatusChanged(Call call, int callerNumberVerificationStatus);
    }

    public abstract static class ListenerBase implements Listener {
@@ -258,6 +259,9 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
        public void onReceivedDeviceToDeviceMessage(Call call, int messageType, int messageValue) {}
        @Override
        public void onReceivedCallQualityReport(Call call, CallQuality callQuality) {}
        @Override
        public void onCallerNumberVerificationStatusChanged(Call call,
                int callerNumberVerificationStatus) {}
    }

    private final CallerInfoLookupHelper.OnQueryCompleteListener mCallerInfoQueryListener =
@@ -1323,6 +1327,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
    public void setCallerNumberVerificationStatus(
            @Connection.VerificationStatus int callerNumberVerificationStatus) {
        mCallerNumberVerificationStatus = callerNumberVerificationStatus;
        mListeners.forEach(l -> l.onCallerNumberVerificationStatusChanged(this,
                callerNumberVerificationStatus));
    }

    public @Connection.VerificationStatus int getCallerNumberVerificationStatus() {
@@ -2754,6 +2760,16 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
            setOriginalConnectionId(extras.getString(Connection.EXTRA_ORIGINAL_CONNECTION_ID));
        }

        if (extras.containsKey(Connection.EXTRA_CALLER_NUMBER_VERIFICATION_STATUS)
                && source == SOURCE_CONNECTION_SERVICE) {
            int callerNumberVerificationStatus =
                    extras.getInt(Connection.EXTRA_CALLER_NUMBER_VERIFICATION_STATUS);
            if (mCallerNumberVerificationStatus != callerNumberVerificationStatus) {
                Log.addEvent(this, LogUtils.Events.VERSTAT_CHANGED, callerNumberVerificationStatus);
                setCallerNumberVerificationStatus(callerNumberVerificationStatus);
            }
        }

        // The remote connection service API can track the phone account which was originally
        // requested to create a connection via the remote connection service API; we store that so
        // we have some visibility into how a call was actually placed.
+6 −0
Original line number Diff line number Diff line
@@ -893,6 +893,12 @@ public class InCallController extends CallsManagerListenerBase implements
        public void onRemoteRttRequest(Call call, int requestId) {
            notifyRemoteRttRequest(call, requestId);
        }

        @Override
        public void onCallerNumberVerificationStatusChanged(Call call,
                int callerNumberVerificationStatus) {
            updateCall(call);
        }
    };

    private BroadcastReceiver mPackageChangedReceiver = new BroadcastReceiver() {
+1 −0
Original line number Diff line number Diff line
@@ -201,6 +201,7 @@ public class LogUtils {
        public static final String OVERRIDE_DISCONNECT_MESSAGE = "OVERRIDE_DISCONNECT_MSG";
        public static final String CALL_DIAGNOSTIC_SERVICE_TIMEOUT =
                "CALL_DIAGNOSTIC_SERVICE_TIMEOUT";
        public static final String VERSTAT_CHANGED = "VERSTAT_CHANGED";

        public static class Timings {
            public static final String ACCEPT_TIMING = "accept";