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

Commit 2c542468 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fixed that out of service in latest service state"

parents b920e2fd 90e4dfd0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -578,13 +578,14 @@ public class GsmCdmaPhone extends Phone {
    public ServiceState getServiceState() {
        if (mSST == null || mSST.mSS.getState() != ServiceState.STATE_IN_SERVICE) {
            if (mImsPhone != null) {
                return mergeServiceStates((mSST == null) ? new ServiceState() : mSST.mSS,
                return mergeServiceStates((mSST == null)
                                ? new ServiceState() : mSST.getServiceState(),
                        mImsPhone.getServiceState());
            }
        }

        if (mSST != null) {
            return mSST.mSS;
            return mSST.getServiceState();
        } else {
            // avoid potential NPE in EmergencyCallHelper during Phone switch
            return new ServiceState();
+1 −1
Original line number Diff line number Diff line
@@ -514,7 +514,7 @@ public class ImsPhone extends ImsPhoneBase {
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    @Override
    public ServiceState getServiceState() {
        return mSS;
        return new ServiceState(mSS);
    }

    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
+3 −0
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest {
    public void testGetServiceState() {
        ServiceState serviceState = new ServiceState();
        mSST.mSS = serviceState;
        doReturn(serviceState).when(mSST).getServiceState();
        assertEquals(serviceState, mPhoneUT.getServiceState());
    }

@@ -238,6 +239,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest {
        serviceState.setIwlanPreferred(true);

        mSST.mSS = serviceState;
        doReturn(serviceState).when(mSST).getServiceState();
        mPhoneUT.mSST = mSST;

        ServiceState mergedServiceState = mPhoneUT.getServiceState();
@@ -320,6 +322,7 @@ public class GsmCdmaPhoneTest extends TelephonyTest {
        serviceState.setIwlanPreferred(true);

        mSST.mSS = serviceState;
        doReturn(serviceState).when(mSST).getServiceState();
        mPhoneUT.mSST = mSST;

        ServiceState mergedServiceState = mPhoneUT.getServiceState();