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

Commit 6b101639 authored by Wink Saville's avatar Wink Saville Committed by Android Git Automerger
Browse files

am 30961e36: Merge "On data only devices use data registration state." into jb-mr2-dev

* commit '30961e36':
  On data only devices use data registration state.
parents fd23eac7 30961e36
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ public abstract class ServiceStateTracker extends Handler {

    protected PhoneBase mPhoneBase;

    protected boolean mVoiceCapable;

    public ServiceState mSS = new ServiceState();
    protected ServiceState mNewSS = new ServiceState();

@@ -196,6 +198,8 @@ public abstract class ServiceStateTracker extends Handler {
        mPhoneBase = phoneBase;
        mCellInfo = cellInfo;
        mCi = ci;
        mVoiceCapable = mPhoneBase.getContext().getResources().getBoolean(
                com.android.internal.R.bool.config_voice_capable);
        mUiccController = UiccController.getInstance();
        mUiccController.registerForIccChanged(this, EVENT_ICC_CHANGED, null);
        mCi.setOnSignalStrengthUpdate(this, EVENT_SIGNAL_STRENGTH_UPDATE, null);
@@ -229,6 +233,22 @@ public abstract class ServiceStateTracker extends Handler {
        return notified;
    }

    /**
     * Some operators have been known to report registration failure
     * data only devices, to fix that use DataRegState.
     */
    protected void useDataRegStateForDataOnlyDevices() {
        if (mVoiceCapable == false) {
            if (DBG) {
                log("useDataRegStateForDataOnlyDevice: VoiceRegState=" + mNewSS.getVoiceRegState()
                    + " DataRegState=" + mNewSS.getDataRegState());
            }
            // TODO: Consider not lying and instead have callers know the difference. 
            mNewSS.setVoiceRegState(mNewSS.getDataRegState());
        }
    }


    /**
     * Registration point for combined roaming on
     * combined roaming is true when roaming is true and ONS differs SPN
+2 −0
Original line number Diff line number Diff line
@@ -251,6 +251,8 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
    protected void pollStateDone() {
        log("pollStateDone: lte 1 ss=[" + mSS + "] newSS=[" + mNewSS + "]");

        useDataRegStateForDataOnlyDevices();

        boolean hasRegistered = mSS.getVoiceRegState() != ServiceState.STATE_IN_SERVICE
                && mNewSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE;

+2 −0
Original line number Diff line number Diff line
@@ -964,6 +964,8 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
            mNewSS.setRoaming(true);
        }

        useDataRegStateForDataOnlyDevices();

        boolean hasRegistered =
            mSS.getVoiceRegState() != ServiceState.STATE_IN_SERVICE
            && mNewSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE;
+2 −0
Original line number Diff line number Diff line
@@ -806,6 +806,8 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
            mNewSS.setRoaming(true);
        }

        useDataRegStateForDataOnlyDevices();

        boolean hasRegistered =
            mSS.getVoiceRegState() != ServiceState.STATE_IN_SERVICE
            && mNewSS.getVoiceRegState() == ServiceState.STATE_IN_SERVICE;