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

Commit d69d7a59 authored by Hunsuk Choi's avatar Hunsuk Choi Committed by Cherrypicker Worker
Browse files

Add setTerminalBasedCallWaitingStatus to MmTelFeature

setTerminalBasedCallWaitingStatus notifies IMS service the change
of the user setting for the terminal-based call waiting.

Bug: 202463005
Test: atest FrameworksTelephonyTests:CallWaitingControllerTest
Change-Id: Ie1115772326bce29666eed4e0d4e3528689fc0c1
(cherry picked from commit cbb5ce832ff891faaef5c9a91488fb74c95f7ecc)
Merged-In: Ie1115772326bce29666eed4e0d4e3528689fc0c1
parent 25484fb4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -14650,6 +14650,7 @@ package android.telephony.ims {
    method public android.telephony.ims.stub.ImsFeatureConfiguration querySupportedImsFeatures();
    method public void readyForFeatureCreation();
    field public static final long CAPABILITY_SIP_DELEGATE_CREATION = 2L; // 0x2L
    field public static final long CAPABILITY_TERMINAL_BASED_CALL_WAITING = 4L; // 0x4L
  }
  public final class ImsSsData implements android.os.Parcelable {
@@ -15280,6 +15281,7 @@ package android.telephony.ims.feature {
    method public void onFeatureRemoved();
    method public boolean queryCapabilityConfiguration(int, int);
    method @NonNull public final android.telephony.ims.feature.MmTelFeature.MmTelCapabilities queryCapabilityStatus();
    method public void setTerminalBasedCallWaitingStatus(boolean);
    method public void setUiTtyMode(int, @Nullable android.os.Message);
    method public int shouldProcessCall(@NonNull String[]);
    field public static final String EXTRA_IS_UNKNOWN_CALL = "android.telephony.ims.feature.extra.IS_UNKNOWN_CALL";
+16 −2
Original line number Diff line number Diff line
@@ -139,13 +139,26 @@ public class ImsService extends Service {
     */
    public static final long CAPABILITY_SIP_DELEGATE_CREATION = 1 << 1;

    /**
     * This ImsService supports the terminal based call waiting service.
     * <p>
     * In order for the IMS service to support the service, IMS service shall
     * override {@link MmTelFeature#setTerminalBasedCallWaitingStatus}.
     * If ImsService has this capability, Android platform will handle the synchronization
     * between the network based call waiting service over circuit-switched networks and the
     * terminal based call waiting service of IMS service, and will handle the received
     * circuit-switched waiting calls. Otherwise, this functionality of Android platform shall
     * be disabled.
     */
    public static final long CAPABILITY_TERMINAL_BASED_CALL_WAITING = 1 << 2;

    /**
     * Used for internal correctness checks of capabilities set by the ImsService implementation and
     * tracks the index of the largest defined flag in the capabilities long.
     * @hide
     */
    public static final long CAPABILITY_MAX_INDEX =
            Long.numberOfTrailingZeros(CAPABILITY_SIP_DELEGATE_CREATION);
            Long.numberOfTrailingZeros(CAPABILITY_TERMINAL_BASED_CALL_WAITING);

    /**
     * @hide
@@ -156,7 +169,8 @@ public class ImsService extends Service {
                    // CAPABILITY_EMERGENCY_OVER_MMTEL is not included here because it is managed by
                    // whether or not ImsFeature.FEATURE_EMERGENCY_MMTEL feature is set and should
                    // not be set by users of ImsService.
                    CAPABILITY_SIP_DELEGATE_CREATION
                    CAPABILITY_SIP_DELEGATE_CREATION,
                    CAPABILITY_TERMINAL_BASED_CALL_WAITING
            })
    @Retention(RetentionPolicy.SOURCE)
    public @interface ImsServiceCapability {}
+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ interface IImsMmTelFeature {
    void setUiTtyMode(int uiTtyMode, in Message onCompleteMessage);
    IImsMultiEndpoint getMultiEndpointInterface();
    int queryCapabilityStatus();
    void setTerminalBasedCallWaitingStatus(boolean enabled);
    oneway void addCapabilityCallback(IImsCapabilityCallback c);
    oneway void removeCapabilityCallback(IImsCapabilityCallback c);
    oneway void changeCapabilitiesConfiguration(in CapabilityChangeRequest request,
+33 −0
Original line number Diff line number Diff line
@@ -23,9 +23,11 @@ import android.annotation.SystemApi;
import android.os.Bundle;
import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
import android.telecom.TelecomManager;
import android.telephony.ims.ImsCallProfile;
import android.telephony.ims.ImsCallSession;
import android.telephony.ims.ImsException;
import android.telephony.ims.ImsReasonInfo;
import android.telephony.ims.ImsService;
import android.telephony.ims.RtpHeaderExtensionType;
@@ -335,6 +337,19 @@ public class MmTelFeature extends ImsFeature {
                return null;
            }
        }

        @Override
        public void setTerminalBasedCallWaitingStatus(boolean enabled) throws RemoteException {
            synchronized (mLock) {
                try {
                    MmTelFeature.this.setTerminalBasedCallWaitingStatus(enabled);
                } catch (ServiceSpecificException se) {
                    throw new ServiceSpecificException(se.errorCode, se.getMessage());
                } catch (Exception e) {
                    throw new RemoteException(e.getMessage());
                }
            }
        }
    };

    /**
@@ -936,6 +951,24 @@ public class MmTelFeature extends ImsFeature {
        // Base Implementation - Should be overridden
    }

    /**
     * Notifies the MmTelFeature of the enablement status of terminal based call waiting
     *
     * If the terminal based call waiting is provisioned,
     * IMS controls the enablement of terminal based call waiting which is defined
     * in 3GPP TS 24.615.
     *
     * @param enabled user setting controlling whether or not call waiting is enabled.
     *
     * @hide
     */
    @SystemApi
    public void setTerminalBasedCallWaitingStatus(boolean enabled) {
        // Base Implementation - Should be overridden by IMS service
        throw new ServiceSpecificException(ImsException.CODE_ERROR_UNSUPPORTED_OPERATION,
                "Not implemented on device.");
    }

    private void setSmsListener(IImsSmsListener listener) {
        getSmsImplementation().registerSmsListener(listener);
    }