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

Commit c2912809 authored by Etan Cohen's avatar Etan Cohen Committed by Steve Kondik
Browse files

Update GSM/CDMA getState API to consider state of the IMS phone as well.

Provides a true indication if the combined phone is IDLE or not.

Fix the one location where this combined information may cause issues: the
decision whether can send SMS over IMS or not.

Bug: 18774469
Change-Id: Iddb91798ae7278addbbf013d3880e126a7a29fdb
parent 41e18a4c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -300,6 +300,13 @@ public class CDMAPhone extends PhoneBase {

    @Override
    public PhoneConstants.State getState() {
        if (mImsPhone != null) {
            PhoneConstants.State imsState = mImsPhone.getState();
            if (imsState != PhoneConstants.State.IDLE) {
                return imsState;
            }
        }

        return mCT.mState;
    }

+1 −1
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ public class CdmaSMSDispatcher extends SMSDispatcher {
                    && !mPhone.getServiceStateTracker().isConcurrentVoiceAndDataAllowed()))
                    && mPhone.getServiceState().getVoiceNetworkType()
                    == TelephonyManager.NETWORK_TYPE_1xRTT
                    && mPhone.getState() != PhoneConstants.State.IDLE;
                    && ((CDMAPhone) mPhone).mCT.mState != PhoneConstants.State.IDLE;

        // sms over cdma is used:
        //   if sms over IMS is not supported AND
+7 −0
Original line number Diff line number Diff line
@@ -291,6 +291,13 @@ public class GSMPhone extends PhoneBase {

    @Override
    public PhoneConstants.State getState() {
        if (mImsPhone != null) {
            PhoneConstants.State imsState = mImsPhone.getState();
            if (imsState != PhoneConstants.State.IDLE) {
                return imsState;
            }
        }

        return mCT.mState;
    }