diff options
author | Hunsuk Choi <forestchoi@google.com> | 2021-12-15 09:19:52 +0000 |
---|---|---|
committer | Hunsuk Choi <forestchoi@google.com> | 2022-11-05 02:42:06 +0000 |
commit | e991e710acf71cc9b115b7269321b4745383ff06 (patch) | |
tree | acef711d52e2166df5a48c3bfcc66016b3b0377d /src | |
parent | 627929abe9d5d9e9ea78a13165127b3d3104b0d6 (diff) | |
download | ims-e991e710acf71cc9b115b7269321b4745383ff06.tar.gz |
Implement the API to notify that radio triggered IMS deregistration
Bug: 219242993
Test: atest
Change-Id: I536fe9fb94124d4f82b818557992aab6c4b60cba
Diffstat (limited to 'src')
-rw-r--r-- | src/java/com/android/ims/ImsManager.java | 15 | ||||
-rw-r--r-- | src/java/com/android/ims/MmTelFeatureConnection.java | 11 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java index f016ff63..a2829e0c 100644 --- a/src/java/com/android/ims/ImsManager.java +++ b/src/java/com/android/ims/ImsManager.java @@ -2783,6 +2783,21 @@ public class ImsManager implements FeatureUpdates { } } + /** + * Notifies that radio triggered IMS deregistration. + * @param reason the reason why the deregistration is triggered. + */ + public void triggerDeregistration(@ImsRegistrationImplBase.ImsDeregistrationReason int reason) + throws ImsException { + MmTelFeatureConnection c = getOrThrowExceptionIfServiceUnavailable(); + try { + c.triggerDeregistration(reason); + } catch (RemoteException e) { + throw new ImsException("triggerDeregistration", 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 8bafc9db..fefffa7d 100644 --- a/src/java/com/android/ims/MmTelFeatureConnection.java +++ b/src/java/com/android/ims/MmTelFeatureConnection.java @@ -37,6 +37,7 @@ import android.telephony.ims.aidl.ISrvccStartedCallback; import android.telephony.ims.feature.CapabilityChangeRequest; import android.telephony.ims.feature.MmTelFeature; import android.telephony.ims.stub.ImsEcbmImplBase; +import android.telephony.ims.stub.ImsRegistrationImplBase; import android.telephony.ims.stub.ImsSmsImplBase; import android.util.Log; @@ -571,6 +572,16 @@ public class MmTelFeatureConnection extends FeatureConnection { } } + public void triggerDeregistration(@ImsRegistrationImplBase.ImsDeregistrationReason int reason) + throws RemoteException { + IImsRegistration registration = getRegistration(); + if (registration != null) { + registration.triggerDeregistration(reason); + } else { + Log.e(TAG + " [" + mSlotId + "]", "triggerDeregistration IImsRegistration is null"); + } + } + public @MmTelFeature.ProcessCallResult int shouldProcessCall(boolean isEmergency, String[] numbers) throws RemoteException { if (isEmergency && !isEmergencyMmTelAvailable()) { |