Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +89 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,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 @@ -89,6 +90,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 @@ -277,6 +279,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 @@ -614,6 +621,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 @@ -2380,6 +2396,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 @@ -2733,6 +2765,10 @@ public class ServiceStateTracker extends Handler { mEventLog.writeServiceStateChanged(mSS); } if (hasGprsAttached || hasGprsDetached || hasRegistered || hasDeregistered) { logAttachChange(); } if (hasGprsAttached) { mAttachedRegistrants.notifyRegistrants(); } Loading @@ -2741,6 +2777,10 @@ public class ServiceStateTracker extends Handler { mDetachedRegistrants.notifyRegistrants(); } if (hasRilDataRadioTechnologyChanged || hasRilVoiceRadioTechnologyChanged) { logRatChange(); } if (hasDataRegStateChanged || hasRilDataRadioTechnologyChanged) { notifyDataRegStateRilRadioTechnologyChanged(); Loading @@ -2752,6 +2792,10 @@ public class ServiceStateTracker extends Handler { } } if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) { logRoamingChange(); } if (hasVoiceRoamingOn) { mVoiceRoamingOnRegistrants.notifyRegistrants(); } Loading Loading @@ -2929,6 +2973,10 @@ public class ServiceStateTracker extends Handler { mPhone.notifyServiceStateChanged(mSS); } if (hasCdmaDataConnectionAttached || hasCdmaDataConnectionDetached || hasRegistered) { logAttachChange(); } if (hasCdmaDataConnectionAttached) { mAttachedRegistrants.notifyRegistrants(); } Loading @@ -2937,6 +2985,10 @@ public class ServiceStateTracker extends Handler { mDetachedRegistrants.notifyRegistrants(); } if (hasRilDataRadioTechnologyChanged || hasRilVoiceRadioTechnologyChanged) { logRatChange(); } if (hasCdmaDataConnectionChanged || hasRilDataRadioTechnologyChanged) { notifyDataRegStateRilRadioTechnologyChanged(); if (ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN Loading @@ -2955,6 +3007,10 @@ public class ServiceStateTracker extends Handler { mVoiceRoamingOffRegistrants.notifyRegistrants(); } if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) { logRoamingChange(); } if (hasDataRoamingOn) { mDataRoamingOnRegistrants.notifyRegistrants(); } Loading Loading @@ -3151,6 +3207,11 @@ public class ServiceStateTracker extends Handler { mPhone.notifyServiceStateChanged(mSS); } if (hasCdmaDataConnectionAttached || has4gHandoff || hasCdmaDataConnectionDetached || hasRegistered || hasDeregistered) { logAttachChange(); } if (hasCdmaDataConnectionAttached || has4gHandoff) { mAttachedRegistrants.notifyRegistrants(); } Loading @@ -3159,6 +3220,10 @@ public class ServiceStateTracker extends Handler { mDetachedRegistrants.notifyRegistrants(); } if (hasDataRadioTechnologyChanged || hasVoiceRadioTechnologyChanged) { logRatChange(); } if ((hasCdmaDataConnectionChanged || hasDataRadioTechnologyChanged)) { notifyDataRegStateRilRadioTechnologyChanged(); if (ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN Loading @@ -3169,6 +3234,10 @@ public class ServiceStateTracker extends Handler { } } if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) { logRoamingChange(); } if (hasVoiceRoamingOn) { mVoiceRoamingOnRegistrants.notifyRegistrants(); } Loading Loading @@ -4637,7 +4706,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 @@ -66,6 +66,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 @@ -89,6 +90,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 @@ -277,6 +279,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 @@ -614,6 +621,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 @@ -2380,6 +2396,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 @@ -2733,6 +2765,10 @@ public class ServiceStateTracker extends Handler { mEventLog.writeServiceStateChanged(mSS); } if (hasGprsAttached || hasGprsDetached || hasRegistered || hasDeregistered) { logAttachChange(); } if (hasGprsAttached) { mAttachedRegistrants.notifyRegistrants(); } Loading @@ -2741,6 +2777,10 @@ public class ServiceStateTracker extends Handler { mDetachedRegistrants.notifyRegistrants(); } if (hasRilDataRadioTechnologyChanged || hasRilVoiceRadioTechnologyChanged) { logRatChange(); } if (hasDataRegStateChanged || hasRilDataRadioTechnologyChanged) { notifyDataRegStateRilRadioTechnologyChanged(); Loading @@ -2752,6 +2792,10 @@ public class ServiceStateTracker extends Handler { } } if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) { logRoamingChange(); } if (hasVoiceRoamingOn) { mVoiceRoamingOnRegistrants.notifyRegistrants(); } Loading Loading @@ -2929,6 +2973,10 @@ public class ServiceStateTracker extends Handler { mPhone.notifyServiceStateChanged(mSS); } if (hasCdmaDataConnectionAttached || hasCdmaDataConnectionDetached || hasRegistered) { logAttachChange(); } if (hasCdmaDataConnectionAttached) { mAttachedRegistrants.notifyRegistrants(); } Loading @@ -2937,6 +2985,10 @@ public class ServiceStateTracker extends Handler { mDetachedRegistrants.notifyRegistrants(); } if (hasRilDataRadioTechnologyChanged || hasRilVoiceRadioTechnologyChanged) { logRatChange(); } if (hasCdmaDataConnectionChanged || hasRilDataRadioTechnologyChanged) { notifyDataRegStateRilRadioTechnologyChanged(); if (ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN Loading @@ -2955,6 +3007,10 @@ public class ServiceStateTracker extends Handler { mVoiceRoamingOffRegistrants.notifyRegistrants(); } if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) { logRoamingChange(); } if (hasDataRoamingOn) { mDataRoamingOnRegistrants.notifyRegistrants(); } Loading Loading @@ -3151,6 +3207,11 @@ public class ServiceStateTracker extends Handler { mPhone.notifyServiceStateChanged(mSS); } if (hasCdmaDataConnectionAttached || has4gHandoff || hasCdmaDataConnectionDetached || hasRegistered || hasDeregistered) { logAttachChange(); } if (hasCdmaDataConnectionAttached || has4gHandoff) { mAttachedRegistrants.notifyRegistrants(); } Loading @@ -3159,6 +3220,10 @@ public class ServiceStateTracker extends Handler { mDetachedRegistrants.notifyRegistrants(); } if (hasDataRadioTechnologyChanged || hasVoiceRadioTechnologyChanged) { logRatChange(); } if ((hasCdmaDataConnectionChanged || hasDataRadioTechnologyChanged)) { notifyDataRegStateRilRadioTechnologyChanged(); if (ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN Loading @@ -3169,6 +3234,10 @@ public class ServiceStateTracker extends Handler { } } if (hasVoiceRoamingOn || hasVoiceRoamingOff || hasDataRoamingOn || hasDataRoamingOff) { logRoamingChange(); } if (hasVoiceRoamingOn) { mVoiceRoamingOnRegistrants.notifyRegistrants(); } Loading Loading @@ -4637,7 +4706,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