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

Commit 27fc8424 authored by Hall Liu's avatar Hall Liu
Browse files

RTT bugfixes and logging

Add logging for RTT interface with IMS stack
Fix a few bugs relating to RTT requests and initialization
Add a method to set the RTT config value in the IMS stack

Bug: 63934808
Bug: 72156722
Test: manual
Change-Id: I44934ef53c9cc821582b381d82ee6834a9bdfe6a
Merged-In: I44934ef53c9cc821582b381d82ee6834a9bdfe6a
parent a7ba0fb2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1652,6 +1652,7 @@ public class ImsCall implements ICall {
            // Make a copy of the current ImsCallProfile and modify it to enable RTT
            Parcel p = Parcel.obtain();
            mCallProfile.writeToParcel(p, 0);
            p.setDataPosition(0);
            ImsCallProfile requestedProfile = new ImsCallProfile(p);
            requestedProfile.mMediaProfile.setRttMode(ImsStreamMediaProfile.RTT_MODE_FULL);

@@ -3101,6 +3102,7 @@ public class ImsCall implements ICall {
        public void callSessionRttModifyRequestReceived(ImsCallSession session,
                ImsCallProfile callProfile) {
            ImsCall.Listener listener;
            logi("callSessionRttModifyRequestReceived");

            synchronized(ImsCall.this) {
                listener = mListener;
@@ -3125,6 +3127,7 @@ public class ImsCall implements ICall {
        public void callSessionRttModifyResponseReceived(int status) {
            ImsCall.Listener listener;

            logi("callSessionRttModifyResponseReceived");
            synchronized(ImsCall.this) {
                listener = mListener;
            }
+22 −0
Original line number Diff line number Diff line
@@ -1635,6 +1635,28 @@ public class ImsManager {
        }
    }

    public void setRttEnabled(boolean enabled) {
        try {
            setAdvanced4GMode(enabled || isEnhanced4gLteModeSettingEnabledByUser());
            final int value = enabled ? ImsConfig.FeatureValueConstants.ON :
                    ImsConfig.FeatureValueConstants.OFF;
            Thread thread = new Thread(() -> {
                try {
                    Log.i(ImsManager.class.getSimpleName(), "Setting RTT enabled to " + enabled);
                    getConfigInterface().setProvisionedValue(
                            ImsConfig.ConfigConstants.RTT_SETTING_ENABLED, value);
                } catch (ImsException e) {
                    Log.e(ImsManager.class.getSimpleName(), "Unable to set RTT enabled to "
                            + enabled + ": " + e);
                }
            });
            thread.start();
        } catch (ImsException e) {
            Log.e(ImsManager.class.getSimpleName(), "Unable to set RTT enabled to " + enabled
                    + ": " + e);
        }
    }

    /**
     * Set the TTY mode. This is the actual tty mode (varies depending on peripheral status)
     */