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

Commit 6a14ff8d authored by Robert Greenwalt's avatar Robert Greenwalt Committed by android-build-merger
Browse files

Plug hole in Roaming indication. am: 1fb93b5f am: 9a290045

am: 91164b47

Change-Id: I5877584d2073fbd240dff0ebfc58be52d00a0770
parents a51ce599 91164b47
Loading
Loading
Loading
Loading
+89 −1
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ import android.telephony.cdma.CdmaCellLocation;
import android.telephony.gsm.GsmCellLocation;
import android.text.TextUtils;
import android.util.EventLog;
import android.util.LocalLog;
import android.util.Pair;
import android.util.TimeUtils;

@@ -90,6 +91,7 @@ import com.android.internal.telephony.uicc.RuimRecords;
import com.android.internal.telephony.uicc.SIMRecords;
import com.android.internal.telephony.uicc.UiccCardApplication;
import com.android.internal.telephony.uicc.UiccController;
import com.android.internal.util.IndentingPrintWriter;

/**
 * {@hide}
@@ -278,6 +280,11 @@ public class ServiceStateTracker extends Handler {

    private final RatRatcheter mRatRatcheter;

    private final LocalLog mRoamingLog = new LocalLog(10);
    private final LocalLog mAttachLog = new LocalLog(10);
    private final LocalLog mPhoneTypeLog = new LocalLog(10);
    private final LocalLog mRatLog = new LocalLog(20);

    private class SstSubscriptionsChangedListener extends OnSubscriptionsChangedListener {
        public final AtomicInteger mPreviousSubId =
                new AtomicInteger(SubscriptionManager.INVALID_SUBSCRIPTION_ID);
@@ -615,6 +622,15 @@ public class ServiceStateTracker extends Handler {
        // strength information displayed on the UI.
        mCi.getSignalStrength(obtainMessage(EVENT_GET_SIGNAL_STRENGTH));
        sendMessage(obtainMessage(EVENT_PHONE_TYPE_SWITCHED));

        logPhoneTypeChange();

        // Tell everybody that we've thrown away state and are starting over with
        // empty, detached ServiceStates.
        mVoiceRoamingOffRegistrants.notifyRegistrants();
        mDataRoamingOffRegistrants.notifyRegistrants();
        mDetachedRegistrants.notifyRegistrants();
        notifyDataRegStateRilRadioTechnologyChanged();
    }

    @VisibleForTesting
@@ -2381,6 +2397,22 @@ public class ServiceStateTracker extends Handler {
        }
    }

    private void logRoamingChange() {
        mRoamingLog.log(mSS.toString());
    }

    private void logAttachChange() {
        mAttachLog.log(mSS.toString());
    }

    private void logPhoneTypeChange() {
        mPhoneTypeLog.log(Integer.toString(mPhone.getPhoneType()));
    }

    private void logRatChange() {
        mRatLog.log(mSS.toString());
    }

    protected void log(String s) {
        Rlog.d(LOG_TAG, s);
    }
@@ -2734,6 +2766,10 @@ public class ServiceStateTracker extends Handler {
            mEventLog.writeServiceStateChanged(mSS);
        }

        if (hasGprsAttached || hasGprsDetached || hasRegistered || hasDeregistered) {
            logAttachChange();
        }

        if (hasGprsAttached) {
            mAttachedRegistrants.notifyRegistrants();
        }
@@ -2742,6 +2778,10 @@ public class ServiceStateTracker extends Handler {
            mDetachedRegistrants.notifyRegistrants();
        }

        if (hasRilDataRadioTechnologyChanged || hasRilVoiceRadioTechnologyChanged) {
            logRatChange();
        }

        if (hasDataRegStateChanged || hasRilDataRadioTechnologyChanged) {
            notifyDataRegStateRilRadioTechnologyChanged();

@@ -2753,6 +2793,10 @@ public class ServiceStateTracker extends Handler {
            }
        }

        if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) {
            logRoamingChange();
        }

        if (hasVoiceRoamingOn) {
            mVoiceRoamingOnRegistrants.notifyRegistrants();
        }
@@ -2930,6 +2974,10 @@ public class ServiceStateTracker extends Handler {
            mPhone.notifyServiceStateChanged(mSS);
        }

        if (hasCdmaDataConnectionAttached || hasCdmaDataConnectionDetached || hasRegistered) {
            logAttachChange();
        }

        if (hasCdmaDataConnectionAttached) {
            mAttachedRegistrants.notifyRegistrants();
        }
@@ -2938,6 +2986,10 @@ public class ServiceStateTracker extends Handler {
            mDetachedRegistrants.notifyRegistrants();
        }

        if (hasRilDataRadioTechnologyChanged || hasRilVoiceRadioTechnologyChanged) {
            logRatChange();
        }

        if (hasCdmaDataConnectionChanged || hasRilDataRadioTechnologyChanged) {
            notifyDataRegStateRilRadioTechnologyChanged();
            if (ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN
@@ -2956,6 +3008,10 @@ public class ServiceStateTracker extends Handler {
            mVoiceRoamingOffRegistrants.notifyRegistrants();
        }

        if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) {
            logRoamingChange();
        }

        if (hasDataRoamingOn) {
            mDataRoamingOnRegistrants.notifyRegistrants();
        }
@@ -3152,6 +3208,11 @@ public class ServiceStateTracker extends Handler {
            mPhone.notifyServiceStateChanged(mSS);
        }

        if (hasCdmaDataConnectionAttached || has4gHandoff || hasCdmaDataConnectionDetached ||
                hasRegistered || hasDeregistered) {
            logAttachChange();
        }

        if (hasCdmaDataConnectionAttached || has4gHandoff) {
            mAttachedRegistrants.notifyRegistrants();
        }
@@ -3160,6 +3221,10 @@ public class ServiceStateTracker extends Handler {
            mDetachedRegistrants.notifyRegistrants();
        }

        if (hasDataRadioTechnologyChanged || hasVoiceRadioTechnologyChanged) {
            logRatChange();
        }

        if ((hasCdmaDataConnectionChanged || hasDataRadioTechnologyChanged)) {
            notifyDataRegStateRilRadioTechnologyChanged();
            if (ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN
@@ -3170,6 +3235,10 @@ public class ServiceStateTracker extends Handler {
            }
        }

        if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) {
            logRoamingChange();
        }

        if (hasVoiceRoamingOn) {
            mVoiceRoamingOnRegistrants.notifyRegistrants();
        }
@@ -4639,7 +4708,26 @@ public class ServiceStateTracker extends Handler {
        pw.println(" mDeviceShuttingDown=" + mDeviceShuttingDown);
        pw.println(" mSpnUpdatePending=" + mSpnUpdatePending);


        pw.println(" Roaming Log:");
        IndentingPrintWriter ipw = new IndentingPrintWriter(pw, "  ");
        ipw.increaseIndent();
        mRoamingLog.dump(fd, ipw, args);
        ipw.decreaseIndent();

        ipw.println(" Attach Log:");
        ipw.increaseIndent();
        mAttachLog.dump(fd, ipw, args);
        ipw.decreaseIndent();

        ipw.println(" Phone Change Log:");
        ipw.increaseIndent();
        mPhoneTypeLog.dump(fd, ipw, args);
        ipw.decreaseIndent();

        ipw.println(" Rat Change Log:");
        ipw.increaseIndent();
        mRatLog.dump(fd, ipw, args);
        ipw.decreaseIndent();
    }

    public boolean isImsRegistered() {
+18 −0
Original line number Diff line number Diff line
@@ -1557,6 +1557,24 @@ public class DataConnection extends StateMachine {
        @Override public void enter() {
            if (DBG) log("DcActiveState: enter dc=" + DataConnection.this);

            // verify and get updated information in case these things
            // are obsolete
            {
                ServiceState ss = mPhone.getServiceState();
                final int networkType = ss.getDataNetworkType();
                if (mNetworkInfo.getSubtype() != networkType) {
                    log("DcActiveState with incorrect subtype (" + mNetworkInfo.getSubtype() +
                            ", " + networkType + "), updating.");
                }
                mNetworkInfo.setSubtype(networkType, TelephonyManager.getNetworkTypeName(networkType));
                final boolean roaming = ss.getDataRoaming();
                if (roaming != mNetworkInfo.isRoaming()) {
                    log("DcActiveState with incorrect roaming (" + mNetworkInfo.isRoaming() +
                            ", " + roaming +"), updating.");
                }
                mNetworkInfo.setRoaming(roaming);
            }

            boolean createNetworkAgent = true;
            // If a disconnect is already pending, avoid notifying all of connected
            if (hasMessages(EVENT_DISCONNECT) ||