diff options
author | Hunsuk Choi <forestchoi@google.com> | 2022-02-08 06:11:13 +0000 |
---|---|---|
committer | Hunsuk Choi <forestchoi@google.com> | 2022-10-31 16:24:09 +0000 |
commit | 31437bdf4224bb14d9cbafadfe0df5c06b669360 (patch) | |
tree | eb54427ebd5fb647833e0b3142e8826c7b878b10 /src | |
parent | 1a81eb96c61f2a9a33e02a86aa7986e974822587 (diff) | |
download | ims-31437bdf4224bb14d9cbafadfe0df5c06b669360.tar.gz |
Implement apis to support SRVCC
Bug: 217654931
Test: atest
Change-Id: I078f7ceee35a31d198f6b881d3fe2e090b33fdea
(cherry picked from commit 0cc9bbcbe1ef7bf42fb3e749a3c4ab9c1558a879)
Diffstat (limited to 'src')
-rw-r--r-- | src/java/com/android/ims/ImsManager.java | 56 | ||||
-rw-r--r-- | src/java/com/android/ims/MmTelFeatureConnection.java | 30 |
2 files changed, 86 insertions, 0 deletions
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java index 18bbd3e1..f016ff63 100644 --- a/src/java/com/android/ims/ImsManager.java +++ b/src/java/com/android/ims/ImsManager.java @@ -52,6 +52,7 @@ import android.telephony.ims.ImsService; import android.telephony.ims.ProvisioningManager; import android.telephony.ims.RegistrationManager; import android.telephony.ims.RtpHeaderExtensionType; +import android.telephony.ims.SrvccCall; import android.telephony.ims.aidl.IImsCapabilityCallback; import android.telephony.ims.aidl.IImsConfig; import android.telephony.ims.aidl.IImsConfigCallback; @@ -60,6 +61,7 @@ import android.telephony.ims.aidl.IImsRegistration; import android.telephony.ims.aidl.IImsRegistrationCallback; import android.telephony.ims.aidl.IImsSmsListener; import android.telephony.ims.aidl.ISipTransport; +import android.telephony.ims.aidl.ISrvccStartedCallback; import android.telephony.ims.feature.CapabilityChangeRequest; import android.telephony.ims.feature.ImsFeature; import android.telephony.ims.feature.MmTelFeature; @@ -2727,6 +2729,60 @@ public class ImsManager implements FeatureUpdates { } } + /** + * Notifies SRVCC started. + * @param cb The callback to receive the list of {@link SrvccCall}. + */ + public void notifySrvccStarted(ISrvccStartedCallback cb) + throws ImsException { + MmTelFeatureConnection c = getOrThrowExceptionIfServiceUnavailable(); + try { + c.notifySrvccStarted(cb); + } catch (RemoteException e) { + throw new ImsException("notifySrvccStarted", e, + ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN); + } + } + + /** + * Notifies SRVCC is completed, IMS service will hang up all calls. + */ + public void notifySrvccCompleted() throws ImsException { + MmTelFeatureConnection c = getOrThrowExceptionIfServiceUnavailable(); + try { + c.notifySrvccCompleted(); + } catch (RemoteException e) { + throw new ImsException("notifySrvccCompleted", e, + ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN); + } + } + + /** + * Notifies SRVCC failed. IMS service will recover and continue calls over IMS. + */ + public void notifySrvccFailed() throws ImsException { + MmTelFeatureConnection c = getOrThrowExceptionIfServiceUnavailable(); + try { + c.notifySrvccFailed(); + } catch (RemoteException e) { + throw new ImsException("notifySrvccFailed", e, + ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN); + } + } + + /** + * Notifies SRVCC is canceled. IMS service will recover and continue calls over IMS. + */ + public void notifySrvccCanceled() throws ImsException { + MmTelFeatureConnection c = getOrThrowExceptionIfServiceUnavailable(); + try { + c.notifySrvccCanceled(); + } catch (RemoteException e) { + throw new ImsException("notifySrvccCanceled", e, + ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN); + } + } + public int getImsServiceState() throws ImsException { MmTelFeatureConnection c = getOrThrowExceptionIfServiceUnavailable(); return c.getFeatureState(); diff --git a/src/java/com/android/ims/MmTelFeatureConnection.java b/src/java/com/android/ims/MmTelFeatureConnection.java index 5ea5e420..8bafc9db 100644 --- a/src/java/com/android/ims/MmTelFeatureConnection.java +++ b/src/java/com/android/ims/MmTelFeatureConnection.java @@ -33,6 +33,7 @@ import android.telephony.ims.aidl.IImsRegistration; import android.telephony.ims.aidl.IImsRegistrationCallback; import android.telephony.ims.aidl.IImsSmsListener; import android.telephony.ims.aidl.ISipTransport; +import android.telephony.ims.aidl.ISrvccStartedCallback; import android.telephony.ims.feature.CapabilityChangeRequest; import android.telephony.ims.feature.MmTelFeature; import android.telephony.ims.stub.ImsEcbmImplBase; @@ -541,6 +542,35 @@ public class MmTelFeatureConnection extends FeatureConnection { } } + public void notifySrvccStarted(ISrvccStartedCallback cb) + throws RemoteException { + synchronized (mLock) { + checkServiceIsReady(); + getServiceInterface(mBinder).notifySrvccStarted(cb); + } + } + + public void notifySrvccCompleted() throws RemoteException { + synchronized (mLock) { + checkServiceIsReady(); + getServiceInterface(mBinder).notifySrvccCompleted(); + } + } + + public void notifySrvccFailed() throws RemoteException { + synchronized (mLock) { + checkServiceIsReady(); + getServiceInterface(mBinder).notifySrvccFailed(); + } + } + + public void notifySrvccCanceled() throws RemoteException { + synchronized (mLock) { + checkServiceIsReady(); + getServiceInterface(mBinder).notifySrvccCanceled(); + } + } + public @MmTelFeature.ProcessCallResult int shouldProcessCall(boolean isEmergency, String[] numbers) throws RemoteException { if (isEmergency && !isEmergencyMmTelAvailable()) { |