Merge bac7cebe705bdc1f7a639be15ab0979eda03d2d4 on remote branch

Change-Id: I4f54150048bf4da4c58d35b42af6900949a8d753
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/CrsCrbtControllerBase.java b/ims/ims-ext-common/src/org/codeaurora/ims/CrsCrbtControllerBase.java
new file mode 100644
index 0000000..ab75505
--- /dev/null
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/CrsCrbtControllerBase.java
@@ -0,0 +1,93 @@
+/* Copyright (c) 2021 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.codeaurora.ims;
+
+import android.content.Context;
+import android.os.RemoteException;
+import org.codeaurora.ims.internal.ICrsCrbtListener;
+import org.codeaurora.ims.internal.ICrsCrbtController;
+
+public abstract class CrsCrbtControllerBase {
+    public final class CrsCrbtBinder extends ICrsCrbtController.Stub {
+
+        @Override
+        public void setCrsCrbtListener(ICrsCrbtListener listener)
+            throws RemoteException{
+            CrsCrbtControllerBase.this.onSetCrsCrbtListener(listener);
+        }
+
+        @Override
+        public void removeCrsCrbtListener(ICrsCrbtListener listener)
+            throws RemoteException{
+            CrsCrbtControllerBase.this.onRemoveCrsCrbtListener(listener);
+        }
+
+        @Override
+        public boolean isPreparatorySession(String callId)
+            throws RemoteException {
+            return CrsCrbtControllerBase.this.onIsPreparatorySession(callId);
+        }
+
+        @Override
+        public void sendSipDtmf(String requestCode)
+            throws RemoteException {
+            CrsCrbtControllerBase.this.onSendSipDtmf(requestCode);
+        }
+    }
+
+    private ICrsCrbtController mBinder;
+
+    public ICrsCrbtController getBinder() {
+        if (mBinder == null) {
+            mBinder = new CrsCrbtBinder();
+        }
+        return mBinder;
+    }
+
+    protected void onSetCrsCrbtListener(ICrsCrbtListener listener)
+        throws RemoteException {
+        //no-op
+    }
+
+    protected void onRemoveCrsCrbtListener(ICrsCrbtListener listener)
+        throws RemoteException {
+        //no-op
+    }
+
+    protected boolean onIsPreparatorySession(String callId)
+        throws RemoteException {
+        //no-op
+        return false;
+    }
+
+    protected void onSendSipDtmf(String requestCode)
+        throws RemoteException {
+        //no-op
+    }
+}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/CrsCrbtListenerBase.java b/ims/ims-ext-common/src/org/codeaurora/ims/CrsCrbtListenerBase.java
new file mode 100644
index 0000000..7cb3381
--- /dev/null
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/CrsCrbtListenerBase.java
@@ -0,0 +1,65 @@
+/* Copyright (c) 2021 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.codeaurora.ims;
+
+import org.codeaurora.ims.internal.ICrsCrbtListener;
+
+public abstract class CrsCrbtListenerBase {
+
+    private final class CrsCrbtListener extends ICrsCrbtListener.Stub {
+
+        public void onCrsDataUpdated(int phoneId, int crsType,
+                boolean isPreparatory) {
+            CrsCrbtListenerBase.this.onCrsDataUpdated(phoneId, crsType,
+                    isPreparatory);
+        }
+
+        public void onSipDtmfReceived(int phoneId, String configCode) {
+            CrsCrbtListenerBase.this.onSipDtmfReceived(phoneId, configCode);
+        }
+    }
+
+    private CrsCrbtListener mListener;
+
+    public ICrsCrbtListener getBinder() {
+        if (mListener == null) {
+            mListener = new CrsCrbtListener();
+        }
+        return mListener;
+    }
+
+    protected void onCrsDataUpdated(int phoneId, int crsType,
+            boolean isPreparatory) {
+        // no-op
+    }
+
+    protected void onSipDtmfReceived(int phoneId, String configCode) {
+        // no-op
+    }
+}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/CrsCrbtManager.java b/ims/ims-ext-common/src/org/codeaurora/ims/CrsCrbtManager.java
new file mode 100644
index 0000000..d1c3296
--- /dev/null
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/CrsCrbtManager.java
@@ -0,0 +1,133 @@
+/* Copyright (c) 2021 The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.codeaurora.ims;
+
+import android.os.RemoteException;
+import org.codeaurora.ims.internal.ICrsCrbtController;
+import org.codeaurora.ims.internal.ICrsCrbtListener;
+import android.util.Log;
+
+public class CrsCrbtManager {
+    private static final String LOG_TAG = "CrsCrbtManager";
+
+    private QtiImsExtManager mQtiImsExtMgr;
+    private volatile ICrsCrbtController mInterface;
+    private int mPhoneId;
+
+    CrsCrbtManager(int phoneId, QtiImsExtManager imsExtMgr) {
+        mPhoneId = phoneId;
+        mQtiImsExtMgr = imsExtMgr;
+        mQtiImsExtMgr.addCleanupListener(()->{mInterface = null;});
+    }
+
+    private ICrsCrbtController getBinder() throws QtiImsException{
+        ICrsCrbtController intf = mInterface;
+        if (intf != null) {
+            return intf;
+        }
+        mQtiImsExtMgr.validateInvariants(mPhoneId);
+        intf = mQtiImsExtMgr.getCrsCrbtController(mPhoneId);
+        if (intf == null) {
+            Log.e(LOG_TAG, "mInterface is NULL");
+            throw new QtiImsException("Remote Interface is NULL");
+        }
+        mInterface = intf;
+        return intf;
+    }
+
+    /**
+     * Used by client to register call back listener with vendor for CRS
+     * type/silencUi/SipDtmf state
+     *
+     * @param phoneId indicates the phone instance which triggered the request
+     * @param listener, to get notified for CRS type or silenceUi or SipDtmf change.
+     * @return void
+     *
+     */
+    public void setCrsCrbtListener(CrsCrbtListenerBase listener)
+        throws QtiImsException {
+      mQtiImsExtMgr.validateInvariants(mPhoneId);
+      try {
+          getBinder().setCrsCrbtListener(listener == null ? null : listener.getBinder());
+      } catch(RemoteException e) {
+          throw new QtiImsException("Remote ImsService setCrsCrbtListener: " + e);
+      }
+    }
+
+    /**
+     * Used by client to unregister call back listener with vendor for CRS
+     * type/silencUi/SipDtmf state
+     *
+     * @param phoneId indicates the phone instance which triggered the request
+     * @param listener, to unregister.
+     * @return void
+     *
+     */
+    public void removeCrsCrbtListener(CrsCrbtListenerBase listener)
+        throws QtiImsException {
+      mQtiImsExtMgr.validateInvariants(mPhoneId);
+      try {
+          getBinder().removeCrsCrbtListener(listener == null ? null : listener.getBinder());
+      } catch(RemoteException e) {
+          throw new QtiImsException("Remote ImsService removeCrsCrbtListener: " + e);
+      }
+    }
+
+    /**
+     * isPreparatorySession
+     * whether show Video CRS Ui
+     *
+     * @param callId
+     * @return boolean
+     */
+    public boolean isPreparatorySession(String callId)
+        throws QtiImsException{
+        mQtiImsExtMgr.validateInvariants(mPhoneId);
+        try {
+            return getBinder().isPreparatorySession(callId);
+        }
+        catch (RemoteException e) {
+            throw new QtiImsException("Remote ImsService isPreparatorySession : " + e);
+        }
+    }
+
+    /**
+     * Used by client to send dtmf string to RIL
+     */
+    public void sendSipDtmf(String requestCode)
+        throws QtiImsException {
+        mQtiImsExtMgr.validateInvariants(mPhoneId);
+        try {
+            getBinder().sendSipDtmf(requestCode);
+        }
+        catch (RemoteException e) {
+            throw new QtiImsException("Remote ImsService sendSipDtmf : " + e);
+        }
+    }
+}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/QtiCallConstants.java b/ims/ims-ext-common/src/org/codeaurora/ims/QtiCallConstants.java
index 80e119a..0e7e853 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/QtiCallConstants.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/QtiCallConstants.java
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015, 2019-2020 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015, 2019-2021 The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -402,5 +402,30 @@
     public static final int REG_ERROR_GEO_LOCATION_STATUS_ENGINE_LOCK = 2002;
     // This is success case, received when all the GPS errors are resolved.
     public static final int REG_ERROR_GEO_LOCATION_STATUS_RESOLVED = 2003;
-}
 
+    /* CRS type extra key */
+    public static final String EXTRA_CRS_TYPE = "crsType";
+    /* Original call type extra key */
+    public static final String EXTRA_ORIGINAL_CALL_TYPE = "originalCallType";
+    /* Slience UI before CRS RTP come extra key */
+    public static final String EXTRA_IS_PREPARATORY = "isPreparatory";
+    //INVALID if CrsData is invalid, play local ring.
+    public static final int CRS_TYPE_INVALID = 0;
+    //AUDIO if only audio will be played.
+    public static final int CRS_TYPE_AUDIO = 1 << 0;
+    //VIDEO if only video will be played.
+    public static final int CRS_TYPE_VIDEO = 1 << 1;
+
+    //Call progress info constants.
+    public static final int CALL_PROGRESS_INFO_TYPE_INVALID = -1;
+    public static final int CALL_PROGRESS_INFO_TYPE_CALL_REJ_Q850 = 0;
+    public static final int CALL_PROGRESS_INFO_TYPE_CALL_WAITING = 1;
+    public static final int CALL_PROGRESS_INFO_TYPE_CALL_FORWARDING = 2;
+    public static final int CALL_PROGRESS_INFO_TYPE_REMOTE_AVAILABLE = 3;
+    //Call progress info call rejection code
+    public static final int CALL_REJECTION_CODE_INVALID = -1;
+    //Call progress info extras
+    public static final String EXTRAS_CALL_PROGRESS_INFO_TYPE = "CallProgInfoType";
+    public static final String EXTRAS_CALL_PROGRESS_REASON_CODE = "CallProgReasonCode";
+    public static final String EXTRAS_CALL_PROGRESS_REASON_TEXT = "CallProgReasonText";
+}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/QtiCarrierConfigs.java b/ims/ims-ext-common/src/org/codeaurora/ims/QtiCarrierConfigs.java
index 052ab9c..32a2a06 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/QtiCarrierConfigs.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/QtiCarrierConfigs.java
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016, 2020 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016, 2020-2021 The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -115,4 +115,22 @@
      */
     public static final String KEY_CARRIER_CALL_COMPOSER_SUPPORTED =
             "carrier_call_composer_supported_bool";
+
+    /* Config to determine if Carrier supports video CRS
+     * true - if video CRS is support else false
+     */
+    public static final String KEY_CARRIER_VIDEO_CRS_SUPPORTED =
+            "carrier_video_crs_supported_bool";
+
+    /* Config to determine if Carrier supports video CRBT
+     * true - if video CRBT is support else false
+     */
+    public static final String KEY_CARRIER_VIDEO_CRBT_SUPPORTED =
+            "config_enable_video_crbt";
+
+    /* Config to determine if Carrier supports showing call progress notiication during alerting.
+     * true - if call progress notification is supported else false
+     */
+    public static final String KEY_CARRIER_CALL_PROGRESS_NOTIFICATION_SUPPORTED =
+            "carrier_call_progress_notification";
 }
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtBase.java b/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtBase.java
index 8192712..9cb5381 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtBase.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtBase.java
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016, 2017, 2019-2020 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016, 2017, 2019-2021 The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -30,6 +30,7 @@
 import android.os.Bundle;
 import android.telephony.ims.feature.ImsFeature;
 
+import org.codeaurora.ims.internal.ICrsCrbtController;
 import org.codeaurora.ims.internal.IQtiImsExt;
 import org.codeaurora.ims.internal.IQtiImsExtListener;
 import org.codeaurora.ims.internal.IImsMultiIdentityInterface;
@@ -156,6 +157,11 @@
         public boolean isCallComposerEnabled(int phoneId) {
             return onIsCallComposerEnabled(phoneId);
         }
+
+        @Override
+        public ICrsCrbtController getCrsCrbtController(int phoneId) {
+            return onGetCrsCrbtController(phoneId);
+        }
     };
 
     private QtiImsExtBinder mQtiImsExtBinder;
@@ -249,4 +255,8 @@
         // no-op
         return false;
     }
+    protected ICrsCrbtController onGetCrsCrbtController(int phoneId) {
+        //no-op
+        return null;
+    }
 }
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtManager.java b/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtManager.java
index 186e94e..4314eb9 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtManager.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/QtiImsExtManager.java
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -38,6 +38,7 @@
 
 import java.util.ArrayList;
 
+import org.codeaurora.ims.internal.ICrsCrbtController;
 import org.codeaurora.ims.internal.IQtiImsExt;
 import org.codeaurora.ims.internal.IQtiImsExtListener;
 import org.codeaurora.ims.internal.IImsMultiIdentityInterface;
@@ -363,4 +364,21 @@
         checkPhoneId(phoneId);
         checkFeatureStatus(phoneId);
     }
+
+    public CrsCrbtManager createCrsCrbtManager(int phoneId)
+            throws QtiImsException {
+        validateInvariants(phoneId);
+        return new CrsCrbtManager(phoneId, this);
+    }
+
+    /*package private*/
+    ICrsCrbtController getCrsCrbtController(int phoneId)
+            throws QtiImsException {
+        validateInvariants(phoneId);
+        try {
+            return mQtiImsExt.getCrsCrbtController(phoneId);
+        } catch(RemoteException e) {
+            throw new QtiImsException("Failed to retrieve CrsCrbtInterface : " + e);
+        }
+    }
 }
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/internal/ICrsCrbtController.aidl b/ims/ims-ext-common/src/org/codeaurora/ims/internal/ICrsCrbtController.aidl
new file mode 100644
index 0000000..4f2deac
--- /dev/null
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/internal/ICrsCrbtController.aidl
@@ -0,0 +1,71 @@
+/* Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.codeaurora.ims.internal;
+
+import org.codeaurora.ims.internal.ICrsCrbtListener;
+
+/**
+ * Used by client application to communicate with vendor code
+ * {@hide}
+ */
+interface ICrsCrbtController {
+    /**
+     * Used by client to register call back listener with vendor for CRS
+     * type/silencUi state
+     *
+     * @param listener, to get notified for CRS type or silenceUi change.
+     * @return void
+     *
+     */
+    oneway void setCrsCrbtListener(ICrsCrbtListener listener);
+
+    /**
+     * Used by client to unregister call back listener with vendor for CRS
+     * type/silencUi state
+     *
+     * @param listener, to be unregister.
+     * @return void
+     *
+     */
+    oneway void removeCrsCrbtListener(ICrsCrbtListener listener);
+
+    /**
+     * isPreparatorySession
+     * whether show Video CRS Ui
+     *
+     * @param callId indicates the phone instance which triggered the request
+     * @return boolean
+     */
+    boolean isPreparatorySession(String callId);
+
+    /**
+     * Used by client for sending sip dtmf for video CRS/CRBT
+     */
+    oneway void sendSipDtmf(String requestCode);
+}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/internal/ICrsCrbtListener.aidl b/ims/ims-ext-common/src/org/codeaurora/ims/internal/ICrsCrbtListener.aidl
new file mode 100644
index 0000000..3ed02c5
--- /dev/null
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/internal/ICrsCrbtListener.aidl
@@ -0,0 +1,58 @@
+/* Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package org.codeaurora.ims.internal;
+
+
+/**
+ * Used by client application to get the result from lower layer by
+ * communicating with vendor.
+ * {@hide}
+ */
+oneway interface ICrsCrbtListener {
+
+   /**
+    * Notifies client when crsType/hideInCallUi is changed from vendor.
+    *
+    * @param  phoneId indicates the phone instance which triggered the request
+    * @param  crsType/isPreparatory – update crs type and silenceUi from vendor.
+    *
+    * @return void.
+    */
+   void onCrsDataUpdated(int phoneId, int crsType, boolean isPreparatory);
+
+    /**
+     * Notifies client when SIP DTMF config string is received
+     *
+     * @param  phoneId indicates the phone instance which triggered the request
+     * @param  configCode - SIP DTMP config string that be parsed from xml by modem.
+     *
+     * @return void.
+     */
+    void onSipDtmfReceived(int phoneId, String configCode);
+}
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/internal/IQtiImsExt.aidl b/ims/ims-ext-common/src/org/codeaurora/ims/internal/IQtiImsExt.aidl
index c138583..abda8cf 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/internal/IQtiImsExt.aidl
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/internal/IQtiImsExt.aidl
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2017, 2019-2020 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2017, 2019-2021 The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -29,6 +29,7 @@
 package org.codeaurora.ims.internal;
 
 import android.os.Bundle;
+import org.codeaurora.ims.internal.ICrsCrbtController;
 import org.codeaurora.ims.internal.IQtiImsExtListener;
 import org.codeaurora.ims.internal.IImsMultiIdentityInterface;
 import org.codeaurora.ims.internal.IImsScreenShareController;
@@ -282,4 +283,9 @@
      *@throws RemoteException if calling the IMS service results in an error.
      */
     boolean isCallComposerEnabled(int phoneId);
+
+   /**
+    * Returns the ICrsCrbtnterface IBinder
+    */
+    ICrsCrbtController getCrsCrbtController(int phoneId);
 }
diff --git a/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiImsExtUtils.java b/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiImsExtUtils.java
index 65c8dd4..03ba272 100644
--- a/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiImsExtUtils.java
+++ b/ims/ims-ext-common/src/org/codeaurora/ims/utils/QtiImsExtUtils.java
@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2015-2017, 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2017, 2020-2021 The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -636,4 +636,22 @@
                 QtiCallConstants.IMS_CALL_COMPOSER + phoneId,
                 QtiCallConstants.CALL_COMPOSER_DISABLED);
     }
+
+    // Returns true if Carrier supports video CRS
+    public static boolean isVideoCrsSupported(int phoneId, Context context) {
+        return isCarrierConfigEnabled(phoneId, context,
+                QtiCarrierConfigs.KEY_CARRIER_VIDEO_CRS_SUPPORTED);
+    }
+
+    // Returns true if Carrier supports video CRBT
+    public static boolean isVideoCrbtSupported(int phoneId, Context context) {
+        return isCarrierConfigEnabled(phoneId, context,
+                QtiCarrierConfigs.KEY_CARRIER_VIDEO_CRBT_SUPPORTED);
+    }
+
+    // Returns true if carrier supports call progress notification.
+    public static boolean isCallProgressNotificationSupported(int phoneId, Context context) {
+        return isCarrierConfigEnabled(phoneId, context,
+                QtiCarrierConfigs.KEY_CARRIER_CALL_PROGRESS_NOTIFICATION_SUPPORTED);
+    }
 }