aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Ebinger <breadley@google.com>2018-03-13 20:53:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-03-13 20:53:53 +0000
commitd24b685891366f5e7e3f2f9b8bbfd32647af10c0 (patch)
treede06339976e992efea7b34a234450db46b2a8031
parentd1b1a3cb525ce13cf10e327c8de5878b73d7a5cd (diff)
parent0aed76da29d1ffbf4b515b2835567cff8dac465a (diff)
downloadims-d24b685891366f5e7e3f2f9b8bbfd32647af10c0.tar.gz
Merge "Dynamic Query for ImsService" into pi-dev
-rw-r--r--src/java/com/android/ims/ImsManager.java25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java
index 3a971cf4..2a35fd37 100644
--- a/src/java/com/android/ims/ImsManager.java
+++ b/src/java/com/android/ims/ImsManager.java
@@ -339,10 +339,19 @@ public class ImsManager {
private void notifyReady() throws ImsException {
ImsManager manager;
synchronized (mLock) {
- mRetryCount = 0;
manager = mImsManager;
}
- mListener.connectionReady(manager);
+ try {
+ mListener.connectionReady(manager);
+ }
+ catch (ImsException e) {
+ Log.w(TAG, "Connector: notifyReady exception: " + e.getMessage());
+ throw e;
+ }
+ // Only reset retry count if connectionReady does not generate an ImsException/
+ synchronized (mLock) {
+ mRetryCount = 0;
+ }
}
private void notifyNotReady() {
@@ -1421,10 +1430,18 @@ public class ImsManager {
}
/*
- * Returns a flag indicating whether the IMS service is available. If it is not available,
- * it will try to connect before reporting failure.
+ * Returns a flag indicating whether the IMS service is available. If it is not available or
+ * busy, it will try to connect before reporting failure.
*/
public boolean isServiceAvailable() {
+ // If we are busy resolving dynamic IMS bindings, we are not available yet.
+ TelephonyManager tm = (TelephonyManager)
+ mContext.getSystemService(Context.TELEPHONY_SERVICE);
+ if (tm.isResolvingImsBinding()) {
+ Log.d(TAG, "isServiceAvailable: resolving IMS binding, returning false");
+ return false;
+ }
+
connectIfServiceIsAvailable();
// mImsServiceProxy will always create an ImsServiceProxy.
return mMmTelFeatureConnection.isBinderAlive();