Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +26 −17 Original line number Diff line number Diff line Loading @@ -89,9 +89,11 @@ import com.android.internal.telephony.dataconnection.DcTracker; import com.android.internal.telephony.dataconnection.TransportManager; import com.android.internal.telephony.metrics.TelephonyMetrics; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState; import com.android.internal.telephony.uicc.IccCardStatus.CardState; import com.android.internal.telephony.uicc.IccRecords; import com.android.internal.telephony.uicc.RuimRecords; import com.android.internal.telephony.uicc.SIMRecords; import com.android.internal.telephony.uicc.UiccCard; import com.android.internal.telephony.uicc.UiccCardApplication; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.telephony.util.NotificationChannelController; Loading Loading @@ -219,7 +221,6 @@ public class ServiceStateTracker extends Handler { protected static final int EVENT_ALL_DATA_DISCONNECTED = 49; protected static final int EVENT_PHONE_TYPE_SWITCHED = 50; protected static final int EVENT_RADIO_POWER_FROM_CARRIER = 51; protected static final int EVENT_SIM_NOT_INSERTED = 52; protected static final int EVENT_IMS_SERVICE_STATE_CHANGED = 53; protected static final int EVENT_RADIO_POWER_OFF_DONE = 54; protected static final int EVENT_PHYSICAL_CHANNEL_CONFIG = 55; Loading Loading @@ -340,14 +341,6 @@ public class ServiceStateTracker extends Handler { } // update voicemail count and notify message waiting changed mPhone.updateVoiceMail(); // cancel notifications if we see SIM_NOT_INSERTED (This happens on bootup before // the SIM is first detected and then subsequently on SIM removals) if (mSubscriptionController.getSlotIndex(subId) == SubscriptionManager.SIM_NOT_INSERTED) { // this is handled on the main thread to mitigate racing with setNotification(). sendMessage(obtainMessage(EVENT_SIM_NOT_INSERTED)); } } } }; Loading Loading @@ -1015,6 +1008,15 @@ public class ServiceStateTracker extends Handler { break; case EVENT_ICC_CHANGED: if (isSimAbsent()) { if (DBG) log("EVENT_ICC_CHANGED: SIM absent"); // cancel notifications if SIM is removed/absent cancelAllNotifications(); // clear cached values on SIM removal mMdn = null; mMin = null; mIsMinInfoReady = false; } onUpdateIccAvailability(); if (mUiccApplcation != null && mUiccApplcation.getState() != AppState.APPSTATE_READY) { Loading Loading @@ -1272,14 +1274,6 @@ public class ServiceStateTracker extends Handler { } break; case EVENT_SIM_NOT_INSERTED: if (DBG) log("EVENT_SIM_NOT_INSERTED"); cancelAllNotifications(); mMdn = null; mMin = null; mIsMinInfoReady = false; break; case EVENT_ALL_DATA_DISCONNECTED: int dds = SubscriptionManager.getDefaultDataSubscriptionId(); ProxyController.getInstance().unregisterForAllDataDisconnected(dds, this); Loading Loading @@ -1475,6 +1469,21 @@ public class ServiceStateTracker extends Handler { } } private boolean isSimAbsent() { boolean simAbsent; if (mUiccController == null) { simAbsent = true; } else { UiccCard uiccCard = mUiccController.getUiccCard(mPhone.getPhoneId()); if (uiccCard == null) { simAbsent = true; } else { simAbsent = (uiccCard.getCardState() == CardState.CARDSTATE_ABSENT); } } return simAbsent; } private int[] getBandwidthsFromConfigs(List<PhysicalChannelConfig> list) { return list.stream() .map(PhysicalChannelConfig::getCellBandwidthDownlink) Loading src/java/com/android/internal/telephony/dataconnection/DataConnection.java +2 −2 Original line number Diff line number Diff line Loading @@ -1639,8 +1639,8 @@ public class DataConnection extends StateMachine { String str = "DcActivatingState: ERROR_DATA_SERVICE_SPECIFIC_ERROR " + " delay=" + delay + " result=" + result + " result.isRestartRadioFail=" + result.mFailCause.isRestartRadioFail(mPhone.getContext(), + " result.isRadioRestartFailure=" + result.mFailCause.isRadioRestartFailure(mPhone.getContext(), mPhone.getSubId()) + " isPermanentFailure=" + mDct.isPermanentFailure(result.mFailCause); Loading src/java/com/android/internal/telephony/dataconnection/DcController.java +1 −1 Original line number Diff line number Diff line Loading @@ -329,7 +329,7 @@ public class DcController extends StateMachine { mDct.isCleanupRequired.set(false); } else { DcFailCause failCause = DcFailCause.fromInt(newState.getStatus()); if (failCause.isRestartRadioFail(mPhone.getContext(), if (failCause.isRadioRestartFailure(mPhone.getContext(), mPhone.getSubId())) { if (DBG) { log("onDataStateChanged: X restart radio, failCause=" Loading src/java/com/android/internal/telephony/dataconnection/DcFailCause.java +18 −14 Original line number Diff line number Diff line Loading @@ -16,10 +16,10 @@ package com.android.internal.telephony.dataconnection; import android.content.Context; import android.content.res.Resources; import android.os.PersistableBundle; import android.telephony.CarrierConfigManager; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; Loading Loading @@ -146,25 +146,29 @@ public enum DcFailCause { } /** * Returns whether or not the radio has failed and also needs to be restarted. * By default, we do not restart radio on REGULAR_DEACTIVATION. * Returns whether or not the fail cause is a failure that requires a modem restart * * @param context device context * @param subId subscription id * @return true if the radio has failed and the carrier requres restart, otherwise false * @param subId subscription index * @return true if the fail cause code needs platform to trigger a modem restart. */ public boolean isRestartRadioFail(Context context, int subId) { if (this == REGULAR_DEACTIVATION) { public boolean isRadioRestartFailure(Context context, int subId) { CarrierConfigManager configManager = (CarrierConfigManager) context.getSystemService(Context.CARRIER_CONFIG_SERVICE); if (configManager != null) { PersistableBundle b = configManager.getConfigForSubId(subId); if (b != null) { return b.getBoolean(CarrierConfigManager. KEY_RESTART_RADIO_ON_PDP_FAIL_REGULAR_DEACTIVATION_BOOL); int[] causeCodes = b.getIntArray(CarrierConfigManager .KEY_RADIO_RESTART_FAILURE_CAUSES_INT_ARRAY); if (causeCodes != null) { return Arrays.stream(causeCodes).anyMatch(i -> i == getErrorCode()); } return b.getBoolean(CarrierConfigManager .KEY_RESTART_RADIO_ON_PDP_FAIL_REGULAR_DEACTIVATION_BOOL); } } return false; } Loading src/java/com/android/internal/telephony/dataconnection/DcTracker.java +2 −2 Original line number Diff line number Diff line Loading @@ -3051,8 +3051,8 @@ public class DcTracker extends Handler { intent.putExtra(TelephonyIntents.EXTRA_APN_TYPE_KEY, apnContext.getApnType()); mPhone.getCarrierSignalAgent().notifyCarrierSignalReceivers(intent); if (cause.isRestartRadioFail(mPhone.getContext(), mPhone.getSubId()) || apnContext.restartOnError(cause.getErrorCode())) { if (cause.isRadioRestartFailure(mPhone.getContext(), mPhone.getSubId()) || apnContext.restartOnError(cause.getErrorCode())) { if (DBG) log("Modem restarted."); sendRestartRadio(); } Loading Loading
src/java/com/android/internal/telephony/ServiceStateTracker.java +26 −17 Original line number Diff line number Diff line Loading @@ -89,9 +89,11 @@ import com.android.internal.telephony.dataconnection.DcTracker; import com.android.internal.telephony.dataconnection.TransportManager; import com.android.internal.telephony.metrics.TelephonyMetrics; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState; import com.android.internal.telephony.uicc.IccCardStatus.CardState; import com.android.internal.telephony.uicc.IccRecords; import com.android.internal.telephony.uicc.RuimRecords; import com.android.internal.telephony.uicc.SIMRecords; import com.android.internal.telephony.uicc.UiccCard; import com.android.internal.telephony.uicc.UiccCardApplication; import com.android.internal.telephony.uicc.UiccController; import com.android.internal.telephony.util.NotificationChannelController; Loading Loading @@ -219,7 +221,6 @@ public class ServiceStateTracker extends Handler { protected static final int EVENT_ALL_DATA_DISCONNECTED = 49; protected static final int EVENT_PHONE_TYPE_SWITCHED = 50; protected static final int EVENT_RADIO_POWER_FROM_CARRIER = 51; protected static final int EVENT_SIM_NOT_INSERTED = 52; protected static final int EVENT_IMS_SERVICE_STATE_CHANGED = 53; protected static final int EVENT_RADIO_POWER_OFF_DONE = 54; protected static final int EVENT_PHYSICAL_CHANNEL_CONFIG = 55; Loading Loading @@ -340,14 +341,6 @@ public class ServiceStateTracker extends Handler { } // update voicemail count and notify message waiting changed mPhone.updateVoiceMail(); // cancel notifications if we see SIM_NOT_INSERTED (This happens on bootup before // the SIM is first detected and then subsequently on SIM removals) if (mSubscriptionController.getSlotIndex(subId) == SubscriptionManager.SIM_NOT_INSERTED) { // this is handled on the main thread to mitigate racing with setNotification(). sendMessage(obtainMessage(EVENT_SIM_NOT_INSERTED)); } } } }; Loading Loading @@ -1015,6 +1008,15 @@ public class ServiceStateTracker extends Handler { break; case EVENT_ICC_CHANGED: if (isSimAbsent()) { if (DBG) log("EVENT_ICC_CHANGED: SIM absent"); // cancel notifications if SIM is removed/absent cancelAllNotifications(); // clear cached values on SIM removal mMdn = null; mMin = null; mIsMinInfoReady = false; } onUpdateIccAvailability(); if (mUiccApplcation != null && mUiccApplcation.getState() != AppState.APPSTATE_READY) { Loading Loading @@ -1272,14 +1274,6 @@ public class ServiceStateTracker extends Handler { } break; case EVENT_SIM_NOT_INSERTED: if (DBG) log("EVENT_SIM_NOT_INSERTED"); cancelAllNotifications(); mMdn = null; mMin = null; mIsMinInfoReady = false; break; case EVENT_ALL_DATA_DISCONNECTED: int dds = SubscriptionManager.getDefaultDataSubscriptionId(); ProxyController.getInstance().unregisterForAllDataDisconnected(dds, this); Loading Loading @@ -1475,6 +1469,21 @@ public class ServiceStateTracker extends Handler { } } private boolean isSimAbsent() { boolean simAbsent; if (mUiccController == null) { simAbsent = true; } else { UiccCard uiccCard = mUiccController.getUiccCard(mPhone.getPhoneId()); if (uiccCard == null) { simAbsent = true; } else { simAbsent = (uiccCard.getCardState() == CardState.CARDSTATE_ABSENT); } } return simAbsent; } private int[] getBandwidthsFromConfigs(List<PhysicalChannelConfig> list) { return list.stream() .map(PhysicalChannelConfig::getCellBandwidthDownlink) Loading
src/java/com/android/internal/telephony/dataconnection/DataConnection.java +2 −2 Original line number Diff line number Diff line Loading @@ -1639,8 +1639,8 @@ public class DataConnection extends StateMachine { String str = "DcActivatingState: ERROR_DATA_SERVICE_SPECIFIC_ERROR " + " delay=" + delay + " result=" + result + " result.isRestartRadioFail=" + result.mFailCause.isRestartRadioFail(mPhone.getContext(), + " result.isRadioRestartFailure=" + result.mFailCause.isRadioRestartFailure(mPhone.getContext(), mPhone.getSubId()) + " isPermanentFailure=" + mDct.isPermanentFailure(result.mFailCause); Loading
src/java/com/android/internal/telephony/dataconnection/DcController.java +1 −1 Original line number Diff line number Diff line Loading @@ -329,7 +329,7 @@ public class DcController extends StateMachine { mDct.isCleanupRequired.set(false); } else { DcFailCause failCause = DcFailCause.fromInt(newState.getStatus()); if (failCause.isRestartRadioFail(mPhone.getContext(), if (failCause.isRadioRestartFailure(mPhone.getContext(), mPhone.getSubId())) { if (DBG) { log("onDataStateChanged: X restart radio, failCause=" Loading
src/java/com/android/internal/telephony/dataconnection/DcFailCause.java +18 −14 Original line number Diff line number Diff line Loading @@ -16,10 +16,10 @@ package com.android.internal.telephony.dataconnection; import android.content.Context; import android.content.res.Resources; import android.os.PersistableBundle; import android.telephony.CarrierConfigManager; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; Loading Loading @@ -146,25 +146,29 @@ public enum DcFailCause { } /** * Returns whether or not the radio has failed and also needs to be restarted. * By default, we do not restart radio on REGULAR_DEACTIVATION. * Returns whether or not the fail cause is a failure that requires a modem restart * * @param context device context * @param subId subscription id * @return true if the radio has failed and the carrier requres restart, otherwise false * @param subId subscription index * @return true if the fail cause code needs platform to trigger a modem restart. */ public boolean isRestartRadioFail(Context context, int subId) { if (this == REGULAR_DEACTIVATION) { public boolean isRadioRestartFailure(Context context, int subId) { CarrierConfigManager configManager = (CarrierConfigManager) context.getSystemService(Context.CARRIER_CONFIG_SERVICE); if (configManager != null) { PersistableBundle b = configManager.getConfigForSubId(subId); if (b != null) { return b.getBoolean(CarrierConfigManager. KEY_RESTART_RADIO_ON_PDP_FAIL_REGULAR_DEACTIVATION_BOOL); int[] causeCodes = b.getIntArray(CarrierConfigManager .KEY_RADIO_RESTART_FAILURE_CAUSES_INT_ARRAY); if (causeCodes != null) { return Arrays.stream(causeCodes).anyMatch(i -> i == getErrorCode()); } return b.getBoolean(CarrierConfigManager .KEY_RESTART_RADIO_ON_PDP_FAIL_REGULAR_DEACTIVATION_BOOL); } } return false; } Loading
src/java/com/android/internal/telephony/dataconnection/DcTracker.java +2 −2 Original line number Diff line number Diff line Loading @@ -3051,8 +3051,8 @@ public class DcTracker extends Handler { intent.putExtra(TelephonyIntents.EXTRA_APN_TYPE_KEY, apnContext.getApnType()); mPhone.getCarrierSignalAgent().notifyCarrierSignalReceivers(intent); if (cause.isRestartRadioFail(mPhone.getContext(), mPhone.getSubId()) || apnContext.restartOnError(cause.getErrorCode())) { if (cause.isRadioRestartFailure(mPhone.getContext(), mPhone.getSubId()) || apnContext.restartOnError(cause.getErrorCode())) { if (DBG) log("Modem restarted."); sendRestartRadio(); } Loading