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

Commit 21174cff authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Reset IMS Capabilities when IMS disconnects

When IMS deregisters, reset the IMS capabilities
to false so we do not accidently return the wrong
result for TelephonyManager.isVolteAvailable()
if the ImsService does not set the capabilities to
false before deregistering.

Test: Telephony Unit Tests
Bug: 36374918
Change-Id: I42b066f8a97770f23d71a0c646f384f7cbfdb57b
parent 87056c26
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2476,6 +2476,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        @Override
        public void onImsDisconnected(ImsReasonInfo imsReasonInfo) {
            if (DBG) log("onImsDisconnected imsReasonInfo=" + imsReasonInfo);
            resetImsCapabilities();
            mPhone.setServiceState(ServiceState.STATE_OUT_OF_SERVICE);
            mPhone.setImsRegistered(false);
            mPhone.processDisconnectReason(imsReasonInfo);
@@ -3199,6 +3200,13 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        }
    }

    private void resetImsCapabilities() {
        log("Resetting Capabilities...");
        for (int i = 0; i < mImsFeatureEnabled.length; i++) {
            mImsFeatureEnabled[i] = false;
        }
    }

    /**
     * @return {@code true} if the device is connected to a WIFI network, {@code false} otherwise.
     */