aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/android/ims/MmTelFeatureConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/android/ims/MmTelFeatureConnection.java')
-rw-r--r--src/java/com/android/ims/MmTelFeatureConnection.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/java/com/android/ims/MmTelFeatureConnection.java b/src/java/com/android/ims/MmTelFeatureConnection.java
index 571670d5..2d11ae60 100644
--- a/src/java/com/android/ims/MmTelFeatureConnection.java
+++ b/src/java/com/android/ims/MmTelFeatureConnection.java
@@ -351,6 +351,11 @@ public class MmTelFeatureConnection {
return tm != null ? tm.getImsConfig(mSlotId, ImsFeature.FEATURE_MMTEL) : null;
}
+ public boolean isEmergencyMmTelAvailable() {
+ TelephonyManager tm = getTelephonyManager(mContext);
+ return tm != null ? tm.isEmergencyMmTelAvailable(mSlotId) : false;
+ }
+
public IImsServiceFeatureCallback getListener() {
return mListenerBinder;
}
@@ -540,6 +545,19 @@ public class MmTelFeatureConnection {
}
}
+ public @MmTelFeature.ProcessCallResult int shouldProcessCall(boolean isEmergency,
+ String[] numbers) throws RemoteException {
+ if (isEmergency && !isEmergencyMmTelAvailable()) {
+ // Don't query the ImsService if emergency calling is not available on the ImsService.
+ Log.i(TAG, "MmTel does not support emergency over IMS, fallback to CS.");
+ return MmTelFeature.PROCESS_CALL_CSFB;
+ }
+ synchronized (mLock) {
+ checkServiceIsReady();
+ return getServiceInterface(mBinder).shouldProcessCall(numbers);
+ }
+ }
+
/**
* @return an integer describing the current Feature Status, defined in
* {@link ImsFeature.ImsState}.