Loading src/java/com/android/internal/telephony/CellularNetworkService.java +9 −10 Original line number Diff line number Diff line Loading @@ -355,14 +355,8 @@ public class CellularNetworkService extends NetworkService { List<Integer> availableServices = getAvailableServices( regState, domain, emergencyOnly); // In earlier versions of the HAL, LTE_CA was allowed to indicate that the device // is on CA; however, that has been superseded by the PHYSICAL_CHANNEL_CONFIG signal. // Because some vendors provide both NETWORK_TYPE_LTE_CA *and* PHYSICAL_CHANNEL_CONFIG, // this tweak is left for compatibility; however, the network type is no longer allowed // to be used to declare that carrier aggregation is in effect, because the other // signal provides a much richer information set, and we want to mitigate confusion in // how CA information is being provided. if (networkType == TelephonyManager.NETWORK_TYPE_LTE_CA) { isUsingCarrierAggregation = true; networkType = TelephonyManager.NETWORK_TYPE_LTE; } Loading @@ -388,9 +382,14 @@ public class CellularNetworkService extends NetworkService { // Network Type fixup for carrier aggregation int networkType = ServiceState.rilRadioTechnologyToNetworkType(regResult.rat); boolean isUsingCarrierAggregation = false; // In earlier versions of the HAL, LTE_CA was allowed to indicate that the device // is on CA; however, that has been superseded by the PHYSICAL_CHANNEL_CONFIG signal. // Because some vendors provide both NETWORK_TYPE_LTE_CA *and* PHYSICAL_CHANNEL_CONFIG, // this tweak is left for compatibility; however, the network type is no longer allowed // to be used to declare that carrier aggregation is in effect, because the other // signal provides a much richer information set, and we want to mitigate confusion in // how CA information is being provided. if (networkType == TelephonyManager.NETWORK_TYPE_LTE_CA) { isUsingCarrierAggregation = true; networkType = TelephonyManager.NETWORK_TYPE_LTE; } Loading Loading @@ -449,7 +448,7 @@ public class CellularNetworkService extends NetworkService { return new NetworkRegistrationInfo(domain, transportType, regState, networkType, reasonForDenial, isEmergencyOnly, availableServices, cellIdentity, rplmn, MAX_DATA_CALLS, isDcNrRestricted, isNrAvailable, isEndcAvailable, vopsInfo, isUsingCarrierAggregation); vopsInfo, false /* isUsingCarrierAggregation */); } } Loading src/java/com/android/internal/telephony/NetworkTypeController.java +20 −5 Original line number Diff line number Diff line Loading @@ -435,6 +435,9 @@ public class NetworkTypeController extends StateMachine { case EVENT_PHYSICAL_CHANNEL_CONFIG_NOTIF_CHANGED: AsyncResult result = (AsyncResult) msg.obj; mIsPhysicalChannelConfigOn = (boolean) result.result; if (DBG) { log("mIsPhysicalChannelConfigOn changed to: " + mIsPhysicalChannelConfigOn); } for (int event : ALL_EVENTS) { removeMessages(event); } Loading Loading @@ -689,10 +692,16 @@ public class NetworkTypeController extends StateMachine { } break; case EVENT_NR_FREQUENCY_CHANGED: if (!isNrConnected()) { log("The nr state was changed. To update the state."); sendMessage(EVENT_NR_STATE_CHANGED); } if (!isNrMmwave()) { // STATE_CONNECTED_MMWAVE -> STATE_CONNECTED transitionWithTimerTo(mNrConnectedState); } else { updateOverrideNetworkType(); // STATE_CONNECTED -> STATE_CONNECTED_MMWAVE transitionTo(mNrConnectedState); } break; case EVENT_DATA_ACTIVITY_CHANGED: Loading Loading @@ -747,21 +756,27 @@ public class NetworkTypeController extends StateMachine { private void transitionToCurrentState() { int dataRat = mPhone.getServiceState().getDataNetworkType(); IState transitionState; if (dataRat == TelephonyManager.NETWORK_TYPE_NR || isNrConnected()) { transitionTo(mNrConnectedState); transitionState = mNrConnectedState; mPreviousState = isNrMmwave() ? STATE_CONNECTED_MMWAVE : STATE_CONNECTED; } else if (isLte(dataRat) && isNrNotRestricted()) { if (isDataActive()) { transitionTo(mLteConnectedState); transitionState = mLteConnectedState; mPreviousState = STATE_NOT_RESTRICTED_RRC_CON; } else { transitionTo(mIdleState); transitionState = mIdleState; mPreviousState = STATE_NOT_RESTRICTED_RRC_IDLE; } } else { transitionTo(mLegacyState); transitionState = mLegacyState; mPreviousState = isNrRestricted() ? STATE_RESTRICTED : STATE_LEGACY; } if (!transitionState.equals(getCurrentState())) { transitionTo(transitionState); } else { updateOverrideNetworkType(); } } private void updateTimers() { Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +4 −4 Original line number Diff line number Diff line Loading @@ -1619,14 +1619,14 @@ public class ServiceStateTracker extends Handler { mPhone.notifyPhysicalChannelConfiguration(list); mLastPhysicalChannelConfigList = list; boolean hasChanged = false; if (updateNrFrequencyRangeFromPhysicalChannelConfigs(list, mSS)) { mNrFrequencyChangedRegistrants.notifyRegistrants(); hasChanged = true; } if (updateNrStateFromPhysicalChannelConfigs(list, mSS)) { mNrStateChangedRegistrants.notifyRegistrants(); hasChanged = true; } if (updateNrFrequencyRangeFromPhysicalChannelConfigs(list, mSS)) { mNrFrequencyChangedRegistrants.notifyRegistrants(); hasChanged = true; } hasChanged |= RatRatcheter .updateBandwidths(getBandwidthsFromConfigs(list), mSS); Loading src/java/com/android/internal/telephony/dataconnection/DataConnection.java +16 −1 Original line number Diff line number Diff line Loading @@ -694,11 +694,26 @@ public class DataConnection extends StateMachine { // old modem backward compatibility). boolean isModemRoaming = mPhone.getServiceState().getDataRoamingFromRegistration(); // If the apn is NOT metered, we will allow data roaming regardless of the setting. boolean isUnmeteredApnType = !ApnSettingUtils.isMeteredApnType( cp.mApnContext.getApnTypeBitmask(), mPhone); // Set this flag to true if the user turns on data roaming. Or if we override the roaming // state in framework, we should set this flag to true as well so the modem will not reject // the data call setup (because the modem actually thinks the device is roaming). boolean allowRoaming = mPhone.getDataRoamingEnabled() || (isModemRoaming && !mPhone.getServiceState().getDataRoaming()); || (isModemRoaming && (!mPhone.getServiceState().getDataRoaming() || isUnmeteredApnType)); if (DBG) { log("allowRoaming=" + allowRoaming + ", mPhone.getDataRoamingEnabled()=" + mPhone.getDataRoamingEnabled() + ", isModemRoaming=" + isModemRoaming + ", mPhone.getServiceState().getDataRoaming()=" + mPhone.getServiceState().getDataRoaming() + ", isUnmeteredApnType=" + isUnmeteredApnType ); } // Check if this data setup is a handover. LinkProperties linkProperties = null; Loading src/java/com/android/internal/telephony/euicc/EuiccController.java +12 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,10 @@ public class EuiccController extends IEuiccController.Stub { */ @Override public void setSupportedCountries(boolean isSupported, @NonNull List<String> countriesList) { if (!callerCanWriteEmbeddedSubscriptions()) { throw new SecurityException( "Must have WRITE_EMBEDDED_SUBSCRIPTIONS to set supported countries"); } if (isSupported) { mSupportedCountries = countriesList; } else { Loading @@ -294,6 +298,10 @@ public class EuiccController extends IEuiccController.Stub { @Override @NonNull public List<String> getSupportedCountries(boolean isSupported) { if (!callerCanWriteEmbeddedSubscriptions()) { throw new SecurityException( "Must have WRITE_EMBEDDED_SUBSCRIPTIONS to get supported countries"); } if (isSupported && mSupportedCountries != null) { return mSupportedCountries; } else if (!isSupported && mUnsupportedCountries != null) { Loading @@ -320,6 +328,10 @@ public class EuiccController extends IEuiccController.Stub { */ @Override public boolean isSupportedCountry(@NonNull String countryIso) { if (!callerCanWriteEmbeddedSubscriptions()) { throw new SecurityException( "Must have WRITE_EMBEDDED_SUBSCRIPTIONS to check if the country is supported"); } if (mSupportedCountries == null || mSupportedCountries.isEmpty()) { Log.i(TAG, "Using blacklist unsupportedCountries=" + mUnsupportedCountries); return !isEsimUnsupportedCountry(countryIso); Loading Loading
src/java/com/android/internal/telephony/CellularNetworkService.java +9 −10 Original line number Diff line number Diff line Loading @@ -355,14 +355,8 @@ public class CellularNetworkService extends NetworkService { List<Integer> availableServices = getAvailableServices( regState, domain, emergencyOnly); // In earlier versions of the HAL, LTE_CA was allowed to indicate that the device // is on CA; however, that has been superseded by the PHYSICAL_CHANNEL_CONFIG signal. // Because some vendors provide both NETWORK_TYPE_LTE_CA *and* PHYSICAL_CHANNEL_CONFIG, // this tweak is left for compatibility; however, the network type is no longer allowed // to be used to declare that carrier aggregation is in effect, because the other // signal provides a much richer information set, and we want to mitigate confusion in // how CA information is being provided. if (networkType == TelephonyManager.NETWORK_TYPE_LTE_CA) { isUsingCarrierAggregation = true; networkType = TelephonyManager.NETWORK_TYPE_LTE; } Loading @@ -388,9 +382,14 @@ public class CellularNetworkService extends NetworkService { // Network Type fixup for carrier aggregation int networkType = ServiceState.rilRadioTechnologyToNetworkType(regResult.rat); boolean isUsingCarrierAggregation = false; // In earlier versions of the HAL, LTE_CA was allowed to indicate that the device // is on CA; however, that has been superseded by the PHYSICAL_CHANNEL_CONFIG signal. // Because some vendors provide both NETWORK_TYPE_LTE_CA *and* PHYSICAL_CHANNEL_CONFIG, // this tweak is left for compatibility; however, the network type is no longer allowed // to be used to declare that carrier aggregation is in effect, because the other // signal provides a much richer information set, and we want to mitigate confusion in // how CA information is being provided. if (networkType == TelephonyManager.NETWORK_TYPE_LTE_CA) { isUsingCarrierAggregation = true; networkType = TelephonyManager.NETWORK_TYPE_LTE; } Loading Loading @@ -449,7 +448,7 @@ public class CellularNetworkService extends NetworkService { return new NetworkRegistrationInfo(domain, transportType, regState, networkType, reasonForDenial, isEmergencyOnly, availableServices, cellIdentity, rplmn, MAX_DATA_CALLS, isDcNrRestricted, isNrAvailable, isEndcAvailable, vopsInfo, isUsingCarrierAggregation); vopsInfo, false /* isUsingCarrierAggregation */); } } Loading
src/java/com/android/internal/telephony/NetworkTypeController.java +20 −5 Original line number Diff line number Diff line Loading @@ -435,6 +435,9 @@ public class NetworkTypeController extends StateMachine { case EVENT_PHYSICAL_CHANNEL_CONFIG_NOTIF_CHANGED: AsyncResult result = (AsyncResult) msg.obj; mIsPhysicalChannelConfigOn = (boolean) result.result; if (DBG) { log("mIsPhysicalChannelConfigOn changed to: " + mIsPhysicalChannelConfigOn); } for (int event : ALL_EVENTS) { removeMessages(event); } Loading Loading @@ -689,10 +692,16 @@ public class NetworkTypeController extends StateMachine { } break; case EVENT_NR_FREQUENCY_CHANGED: if (!isNrConnected()) { log("The nr state was changed. To update the state."); sendMessage(EVENT_NR_STATE_CHANGED); } if (!isNrMmwave()) { // STATE_CONNECTED_MMWAVE -> STATE_CONNECTED transitionWithTimerTo(mNrConnectedState); } else { updateOverrideNetworkType(); // STATE_CONNECTED -> STATE_CONNECTED_MMWAVE transitionTo(mNrConnectedState); } break; case EVENT_DATA_ACTIVITY_CHANGED: Loading Loading @@ -747,21 +756,27 @@ public class NetworkTypeController extends StateMachine { private void transitionToCurrentState() { int dataRat = mPhone.getServiceState().getDataNetworkType(); IState transitionState; if (dataRat == TelephonyManager.NETWORK_TYPE_NR || isNrConnected()) { transitionTo(mNrConnectedState); transitionState = mNrConnectedState; mPreviousState = isNrMmwave() ? STATE_CONNECTED_MMWAVE : STATE_CONNECTED; } else if (isLte(dataRat) && isNrNotRestricted()) { if (isDataActive()) { transitionTo(mLteConnectedState); transitionState = mLteConnectedState; mPreviousState = STATE_NOT_RESTRICTED_RRC_CON; } else { transitionTo(mIdleState); transitionState = mIdleState; mPreviousState = STATE_NOT_RESTRICTED_RRC_IDLE; } } else { transitionTo(mLegacyState); transitionState = mLegacyState; mPreviousState = isNrRestricted() ? STATE_RESTRICTED : STATE_LEGACY; } if (!transitionState.equals(getCurrentState())) { transitionTo(transitionState); } else { updateOverrideNetworkType(); } } private void updateTimers() { Loading
src/java/com/android/internal/telephony/ServiceStateTracker.java +4 −4 Original line number Diff line number Diff line Loading @@ -1619,14 +1619,14 @@ public class ServiceStateTracker extends Handler { mPhone.notifyPhysicalChannelConfiguration(list); mLastPhysicalChannelConfigList = list; boolean hasChanged = false; if (updateNrFrequencyRangeFromPhysicalChannelConfigs(list, mSS)) { mNrFrequencyChangedRegistrants.notifyRegistrants(); hasChanged = true; } if (updateNrStateFromPhysicalChannelConfigs(list, mSS)) { mNrStateChangedRegistrants.notifyRegistrants(); hasChanged = true; } if (updateNrFrequencyRangeFromPhysicalChannelConfigs(list, mSS)) { mNrFrequencyChangedRegistrants.notifyRegistrants(); hasChanged = true; } hasChanged |= RatRatcheter .updateBandwidths(getBandwidthsFromConfigs(list), mSS); Loading
src/java/com/android/internal/telephony/dataconnection/DataConnection.java +16 −1 Original line number Diff line number Diff line Loading @@ -694,11 +694,26 @@ public class DataConnection extends StateMachine { // old modem backward compatibility). boolean isModemRoaming = mPhone.getServiceState().getDataRoamingFromRegistration(); // If the apn is NOT metered, we will allow data roaming regardless of the setting. boolean isUnmeteredApnType = !ApnSettingUtils.isMeteredApnType( cp.mApnContext.getApnTypeBitmask(), mPhone); // Set this flag to true if the user turns on data roaming. Or if we override the roaming // state in framework, we should set this flag to true as well so the modem will not reject // the data call setup (because the modem actually thinks the device is roaming). boolean allowRoaming = mPhone.getDataRoamingEnabled() || (isModemRoaming && !mPhone.getServiceState().getDataRoaming()); || (isModemRoaming && (!mPhone.getServiceState().getDataRoaming() || isUnmeteredApnType)); if (DBG) { log("allowRoaming=" + allowRoaming + ", mPhone.getDataRoamingEnabled()=" + mPhone.getDataRoamingEnabled() + ", isModemRoaming=" + isModemRoaming + ", mPhone.getServiceState().getDataRoaming()=" + mPhone.getServiceState().getDataRoaming() + ", isUnmeteredApnType=" + isUnmeteredApnType ); } // Check if this data setup is a handover. LinkProperties linkProperties = null; Loading
src/java/com/android/internal/telephony/euicc/EuiccController.java +12 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,10 @@ public class EuiccController extends IEuiccController.Stub { */ @Override public void setSupportedCountries(boolean isSupported, @NonNull List<String> countriesList) { if (!callerCanWriteEmbeddedSubscriptions()) { throw new SecurityException( "Must have WRITE_EMBEDDED_SUBSCRIPTIONS to set supported countries"); } if (isSupported) { mSupportedCountries = countriesList; } else { Loading @@ -294,6 +298,10 @@ public class EuiccController extends IEuiccController.Stub { @Override @NonNull public List<String> getSupportedCountries(boolean isSupported) { if (!callerCanWriteEmbeddedSubscriptions()) { throw new SecurityException( "Must have WRITE_EMBEDDED_SUBSCRIPTIONS to get supported countries"); } if (isSupported && mSupportedCountries != null) { return mSupportedCountries; } else if (!isSupported && mUnsupportedCountries != null) { Loading @@ -320,6 +328,10 @@ public class EuiccController extends IEuiccController.Stub { */ @Override public boolean isSupportedCountry(@NonNull String countryIso) { if (!callerCanWriteEmbeddedSubscriptions()) { throw new SecurityException( "Must have WRITE_EMBEDDED_SUBSCRIPTIONS to check if the country is supported"); } if (mSupportedCountries == null || mSupportedCountries.isEmpty()) { Log.i(TAG, "Using blacklist unsupportedCountries=" + mUnsupportedCountries); return !isEsimUnsupportedCountry(countryIso); Loading