diff options
author | Brad Ebinger <breadley@google.com> | 2018-03-12 22:53:47 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-03-12 22:53:47 +0000 |
commit | 6e391e4b2854df455eb2c9d9dd94f71216b6e554 (patch) | |
tree | 1aca4b46e52abf736301331e7559a5f7a3988ba9 | |
parent | 4cd18583f0cb88f6819e2daf10416cc54a3178eb (diff) | |
parent | fababe1aca80852c4e816d8cc1d20321d14b9a87 (diff) | |
download | ims-6e391e4b2854df455eb2c9d9dd94f71216b6e554.tar.gz |
Merge "Dynamic Query for ImsService"
-rw-r--r-- | src/java/com/android/ims/ImsManager.java | 25 |
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 24d92475..a5d4e485 100644 --- a/src/java/com/android/ims/ImsManager.java +++ b/src/java/com/android/ims/ImsManager.java @@ -340,10 +340,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() { @@ -1418,10 +1427,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(); |