aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Ebinger <breadley@google.com>2018-02-28 04:59:58 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-02-28 04:59:58 +0000
commit5633ff0f559b3e7d437d8a29de949af9706776fa (patch)
tree8e262b19793abefe3d26b280de7ae9b70e163e44
parentd0dab5c78c96680ddbc8c89affdba304302abe95 (diff)
parent003f3376679fd6b4984e37bc742eb71ff0d5f027 (diff)
downloadims-5633ff0f559b3e7d437d8a29de949af9706776fa.tar.gz
Integrates shouldProcessCall into framework am: d449b2367a am: f55f9101ea
am: 003f337667 Change-Id: Ibb0022813126623d321b31c34130307d77c0975a
-rw-r--r--src/java/com/android/ims/ImsManager.java24
-rw-r--r--src/java/com/android/ims/MmTelFeatureConnection.java18
2 files changed, 41 insertions, 1 deletions
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java
index 1ae8606a..521b46ad 100644
--- a/src/java/com/android/ims/ImsManager.java
+++ b/src/java/com/android/ims/ImsManager.java
@@ -2208,7 +2208,7 @@ public class ImsManager {
}
}
- public void onSmsReady() throws ImsException{
+ public void onSmsReady() throws ImsException {
try {
mMmTelFeatureConnection.onSmsReady();
} catch (RemoteException e) {
@@ -2218,6 +2218,28 @@ public class ImsManager {
}
/**
+ * Determines whether or not a call with the specified numbers should be placed over IMS or over
+ * CSFB.
+ * @param isEmergency is at least one call an emergency number.
+ * @param numbers A {@link String} array containing the numbers in the call being placed. Can
+ * be multiple numbers in the case of dialing out a conference.
+ * @return The result of the query, one of the following values:
+ * - {@link MmTelFeature#PROCESS_CALL_IMS}
+ * - {@link MmTelFeature#PROCESS_CALL_CSFB}
+ * @throws ImsException if the ImsService is not available. In this case, we should fall back
+ * to CSFB anyway.
+ */
+ public @MmTelFeature.ProcessCallResult int shouldProcessCall(boolean isEmergency,
+ String[] numbers) throws ImsException {
+ try {
+ return mMmTelFeatureConnection.shouldProcessCall(isEmergency, numbers);
+ } catch (RemoteException e) {
+ throw new ImsException("shouldProcessCall()", e,
+ ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
+ }
+ }
+
+ /**
* Gets the Multi-Endpoint interface to subscribe to multi-enpoint notifications..
*
* @return the multi-endpoint interface instance
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}.