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

Commit 7d0fa830 authored by Benergy Meenan Ravuri's avatar Benergy Meenan Ravuri Committed by Linux Build Service Account
Browse files

IMS: Update VoLTE, VoWifi icons based on IMS capabilities

Handle IMS capabilities changed indication and update
service state.

Change-Id: I54e3a51c2756c5e399432f89fb6250c5a2ae93a9
CRs-Fixed: 998552
parent b6f78ff7
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -3234,6 +3234,20 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        return false;
    }

    /**
     * Determines if video wifi calling enabled for the phone
     *
     * @return {@code true} if video wifi calling is enabled, {@code false} otherwise.
     */
     public boolean isVideoWifiCallingEnabled() {
         Phone imsPhone = mImsPhone;
         if ((imsPhone != null)
                 && (imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE)) {
            return imsPhone.isVideoWifiCallingEnabled();
         }
         return false;
     }

    /**
     * Returns the status of Link Capacity Estimation (LCE) service.
     */
+17 −0
Original line number Diff line number Diff line
@@ -1184,6 +1184,7 @@ public class ServiceStateTracker extends Handler {
            case EVENT_IMS_CAPABILITY_CHANGED:
                if (DBG) log("EVENT_IMS_CAPABILITY_CHANGED");
                updateSpnDisplay();
                updateRilImsRadioTechnology();
                break;

            //CDMA
@@ -2421,6 +2422,18 @@ public class ServiceStateTracker extends Handler {
        }
    }

    private void updateRilImsRadioTechnology() {
        int imsRadioTechnology = mPhone.getImsPhone() != null ?
                mPhone.getImsPhone().getServiceState().getRilImsRadioTechnology() :
                ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN;
        if (imsRadioTechnology != mSS.getRilImsRadioTechnology()) {
            Rlog.i(LOG_TAG, "updateRilImsRadioTechnology : Old ims RAT: " +
                    mSS.getRilImsRadioTechnology() + " new ims RAT: " + imsRadioTechnology);
            mSS.setRilImsRadioTechnology(imsRadioTechnology);
            mPhone.notifyServiceStateChanged(mSS);
        }
    }

    /**
     * A complete "service state" from our perspective is
     * composed of a handful of separate requests to the radio.
@@ -2595,6 +2608,8 @@ public class ServiceStateTracker extends Handler {
            }
        }

        // Ims call capable rat will be filled as part of service state changed.
        mNewSS.setRilImsRadioTechnology(mSS.getRilImsRadioTechnology());
        // swap mSS and mNewSS to put new state in mSS
        ServiceState tss = mSS;
        mSS = mNewSS;
@@ -2819,6 +2834,8 @@ public class ServiceStateTracker extends Handler {
                    mNewSS.getVoiceRegState(), mNewSS.getDataRegState());
        }

        // Ims call capable rat will be filled as part of service state changed.
        mNewSS.setRilImsRadioTechnology(mSS.getRilImsRadioTechnology());
        ServiceState tss;
        tss = mSS;
        mSS = mNewSS;
+4 −0
Original line number Diff line number Diff line
@@ -1431,6 +1431,10 @@ public class ImsPhone extends ImsPhoneBase {
        return mCT.isVideoCallEnabled();
    }

    public boolean isVideoWifiCallingEnabled() {
        return mCT.isVideoWifiCallingEnabled();
    }

    @Override
    public Phone getDefaultPhone() {
        return mDefaultPhone;
+17 −1
Original line number Diff line number Diff line
@@ -1904,7 +1904,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                for (ImsPhoneConnection connection : mConnections) {
                    connection.updateWifiState();
                }

                mPhone.getServiceState().setRilImsRadioTechnology(getRilImsRadioTechnology());
                mPhone.onFeatureCapabilityChanged();

                mEventLog.writeOnImsCapabilities(mImsFeatureEnabled);
@@ -2163,6 +2163,22 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                || mImsFeatureEnabled[ImsConfig.FeatureConstants.FEATURE_TYPE_VIDEO_OVER_WIFI]);
    }

    public boolean isVideoWifiCallingEnabled() {
        return mImsFeatureEnabled[ImsConfig.FeatureConstants.FEATURE_TYPE_VIDEO_OVER_WIFI];
    }

    private int getRilImsRadioTechnology() {
        int imsRadioTechnology = ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN;
        if (mImsFeatureEnabled[ImsConfig.FeatureConstants.FEATURE_TYPE_VOICE_OVER_LTE]
                || mImsFeatureEnabled[ImsConfig.FeatureConstants.FEATURE_TYPE_VIDEO_OVER_LTE]) {
            imsRadioTechnology = ServiceState.RIL_RADIO_TECHNOLOGY_LTE;
        } else if (mImsFeatureEnabled[ImsConfig.FeatureConstants.FEATURE_TYPE_VOICE_OVER_WIFI]
                || mImsFeatureEnabled[ImsConfig.FeatureConstants.FEATURE_TYPE_VIDEO_OVER_WIFI]) {
            imsRadioTechnology = ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN;
        }
        return imsRadioTechnology;
    }

    @Override
    public PhoneConstants.State getState() {
        return mState;