Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59164fbc authored by Brad Ebinger's avatar Brad Ebinger Committed by android-build-merger
Browse files

Merge "Dynamic Query for ImsService"

am: 6e391e4b

Change-Id: I47d2ff919e43b5e09c437973fa7a29e60bb29043
parents d63d469e 6e391e4b
Loading
Loading
Loading
Loading
+21 −4
Original line number Original line Diff line number Diff line
@@ -340,11 +340,20 @@ public class ImsManager {
        private void notifyReady() throws ImsException {
        private void notifyReady() throws ImsException {
            ImsManager manager;
            ImsManager manager;
            synchronized (mLock) {
            synchronized (mLock) {
                mRetryCount = 0;
                manager = mImsManager;
                manager = mImsManager;
            }
            }
            try {
                mListener.connectionReady(manager);
                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() {
        private void notifyNotReady() {
            mListener.connectionUnavailable();
            mListener.connectionUnavailable();
@@ -1418,10 +1427,18 @@ public class ImsManager {
    }
    }


    /*
    /*
     * Returns a flag indicating whether the IMS service is available. If it is not available,
     * Returns a flag indicating whether the IMS service is available. If it is not available or
     * it will try to connect before reporting failure.
     * busy, it will try to connect before reporting failure.
     */
     */
    public boolean isServiceAvailable() {
    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();
        connectIfServiceIsAvailable();
        // mImsServiceProxy will always create an ImsServiceProxy.
        // mImsServiceProxy will always create an ImsServiceProxy.
        return mMmTelFeatureConnection.isBinderAlive();
        return mMmTelFeatureConnection.isBinderAlive();