Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +89 −1 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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} Loading Loading @@ -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); Loading Loading @@ -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 Loading Loading @@ -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); } Loading Loading @@ -2734,6 +2766,10 @@ public class ServiceStateTracker extends Handler { mEventLog.writeServiceStateChanged(mSS); } if (hasGprsAttached || hasGprsDetached || hasRegistered || hasDeregistered) { logAttachChange(); } if (hasGprsAttached) { mAttachedRegistrants.notifyRegistrants(); } Loading @@ -2742,6 +2778,10 @@ public class ServiceStateTracker extends Handler { mDetachedRegistrants.notifyRegistrants(); } if (hasRilDataRadioTechnologyChanged || hasRilVoiceRadioTechnologyChanged) { logRatChange(); } if (hasDataRegStateChanged || hasRilDataRadioTechnologyChanged) { notifyDataRegStateRilRadioTechnologyChanged(); Loading @@ -2753,6 +2793,10 @@ public class ServiceStateTracker extends Handler { } } if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) { logRoamingChange(); } if (hasVoiceRoamingOn) { mVoiceRoamingOnRegistrants.notifyRegistrants(); } Loading Loading @@ -2930,6 +2974,10 @@ public class ServiceStateTracker extends Handler { mPhone.notifyServiceStateChanged(mSS); } if (hasCdmaDataConnectionAttached || hasCdmaDataConnectionDetached || hasRegistered) { logAttachChange(); } if (hasCdmaDataConnectionAttached) { mAttachedRegistrants.notifyRegistrants(); } Loading @@ -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 Loading @@ -2956,6 +3008,10 @@ public class ServiceStateTracker extends Handler { mVoiceRoamingOffRegistrants.notifyRegistrants(); } if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) { logRoamingChange(); } if (hasDataRoamingOn) { mDataRoamingOnRegistrants.notifyRegistrants(); } Loading Loading @@ -3152,6 +3208,11 @@ public class ServiceStateTracker extends Handler { mPhone.notifyServiceStateChanged(mSS); } if (hasCdmaDataConnectionAttached || has4gHandoff || hasCdmaDataConnectionDetached || hasRegistered || hasDeregistered) { logAttachChange(); } if (hasCdmaDataConnectionAttached || has4gHandoff) { mAttachedRegistrants.notifyRegistrants(); } Loading @@ -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 Loading @@ -3170,6 +3235,10 @@ public class ServiceStateTracker extends Handler { } } if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) { logRoamingChange(); } if (hasVoiceRoamingOn) { mVoiceRoamingOnRegistrants.notifyRegistrants(); } Loading Loading @@ -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() { Loading src/java/com/android/internal/telephony/dataconnection/DataConnection.java +18 −0 Original line number Diff line number Diff line Loading @@ -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) || Loading Loading
src/java/com/android/internal/telephony/ServiceStateTracker.java +89 −1 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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} Loading Loading @@ -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); Loading Loading @@ -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 Loading Loading @@ -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); } Loading Loading @@ -2734,6 +2766,10 @@ public class ServiceStateTracker extends Handler { mEventLog.writeServiceStateChanged(mSS); } if (hasGprsAttached || hasGprsDetached || hasRegistered || hasDeregistered) { logAttachChange(); } if (hasGprsAttached) { mAttachedRegistrants.notifyRegistrants(); } Loading @@ -2742,6 +2778,10 @@ public class ServiceStateTracker extends Handler { mDetachedRegistrants.notifyRegistrants(); } if (hasRilDataRadioTechnologyChanged || hasRilVoiceRadioTechnologyChanged) { logRatChange(); } if (hasDataRegStateChanged || hasRilDataRadioTechnologyChanged) { notifyDataRegStateRilRadioTechnologyChanged(); Loading @@ -2753,6 +2793,10 @@ public class ServiceStateTracker extends Handler { } } if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) { logRoamingChange(); } if (hasVoiceRoamingOn) { mVoiceRoamingOnRegistrants.notifyRegistrants(); } Loading Loading @@ -2930,6 +2974,10 @@ public class ServiceStateTracker extends Handler { mPhone.notifyServiceStateChanged(mSS); } if (hasCdmaDataConnectionAttached || hasCdmaDataConnectionDetached || hasRegistered) { logAttachChange(); } if (hasCdmaDataConnectionAttached) { mAttachedRegistrants.notifyRegistrants(); } Loading @@ -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 Loading @@ -2956,6 +3008,10 @@ public class ServiceStateTracker extends Handler { mVoiceRoamingOffRegistrants.notifyRegistrants(); } if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) { logRoamingChange(); } if (hasDataRoamingOn) { mDataRoamingOnRegistrants.notifyRegistrants(); } Loading Loading @@ -3152,6 +3208,11 @@ public class ServiceStateTracker extends Handler { mPhone.notifyServiceStateChanged(mSS); } if (hasCdmaDataConnectionAttached || has4gHandoff || hasCdmaDataConnectionDetached || hasRegistered || hasDeregistered) { logAttachChange(); } if (hasCdmaDataConnectionAttached || has4gHandoff) { mAttachedRegistrants.notifyRegistrants(); } Loading @@ -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 Loading @@ -3170,6 +3235,10 @@ public class ServiceStateTracker extends Handler { } } if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) { logRoamingChange(); } if (hasVoiceRoamingOn) { mVoiceRoamingOnRegistrants.notifyRegistrants(); } Loading Loading @@ -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() { Loading
src/java/com/android/internal/telephony/dataconnection/DataConnection.java +18 −0 Original line number Diff line number Diff line Loading @@ -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) || Loading