Loading src/java/com/android/internal/telephony/Phone.java +6 −1 Original line number Diff line number Diff line Loading @@ -3933,7 +3933,12 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { public void callEndCleanupHandOverCallIfAny() { } public void cancelUSSD() { /** * Cancel USSD session. * * @param msg The message to dispatch when the USSD session terminated. */ public void cancelUSSD(Message msg) { } /** Loading src/java/com/android/internal/telephony/RIL.java +1 −1 Original line number Diff line number Diff line Loading @@ -530,7 +530,7 @@ public class RIL extends BaseCommands implements CommandsInterface { } } } catch (NoSuchElementException e) { mRadioProxy = null; mOemHookProxy = null; riljLoge("IOemHook service is not on the device HAL: " + e); } catch (RemoteException e) { mOemHookProxy = null; Loading src/java/com/android/internal/telephony/RadioBugDetector.java +1 −0 Original line number Diff line number Diff line Loading @@ -127,6 +127,7 @@ public class RadioBugDetector { mRadioBugStatus = isSystemError ? RADIO_BUG_REPETITIVE_SYSTEM_ERROR : RADIO_BUG_REPETITIVE_WAKELOCK_TIMEOUT_ERROR; Intent intent = new Intent(TelephonyIntents.ACTION_REPORT_RADIO_BUG); intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); intent.putExtra(TelephonyIntents.EXTRA_SLOT_ID, mSlotId); intent.putExtra(TelephonyIntents.EXTRA_RADIO_BUG_TYPE, mRadioBugStatus); mContext.sendBroadcast(intent, android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE); Loading src/java/com/android/internal/telephony/RatRatcheter.java +17 −4 Original line number Diff line number Diff line Loading @@ -21,13 +21,14 @@ import android.content.Intent; import android.content.IntentFilter; import android.os.PersistableBundle; import android.os.UserHandle; import android.telephony.AccessNetworkConstants; import android.telephony.CarrierConfigManager; import android.telephony.ServiceState; import android.telephony.NetworkRegistrationInfo; import android.telephony.Rlog; import android.telephony.ServiceState; import android.util.SparseArray; import android.util.SparseIntArray; import java.util.ArrayList; import java.util.Arrays; /** Loading Loading @@ -118,7 +119,13 @@ public class RatRatcheter { if (mVoiceRatchetEnabled) { int newVoiceRat = ratchetRat(oldSS.getRilVoiceRadioTechnology(), newSS.getRilVoiceRadioTechnology()); newSS.setRilVoiceRadioTechnology(newVoiceRat); NetworkRegistrationInfo nri = newSS.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (nri != null) { nri.setAccessNetworkTechnology( ServiceState.rilRadioTechnologyToNetworkType(newVoiceRat)); newSS.addNetworkRegistrationInfo(nri); } } else if (oldSS.getRilVoiceRadioTechnology() != newSS.getRilVoiceRadioTechnology()) { // resume rat ratchet on following rat change within the same location mVoiceRatchetEnabled = true; Loading @@ -127,7 +134,13 @@ public class RatRatcheter { if (mDataRatchetEnabled) { int newDataRat = ratchetRat(oldSS.getRilDataRadioTechnology(), newSS.getRilDataRadioTechnology()); newSS.setRilDataRadioTechnology(newDataRat); NetworkRegistrationInfo nri = newSS.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (nri != null) { nri.setAccessNetworkTechnology( ServiceState.rilRadioTechnologyToNetworkType(newDataRat)); newSS.addNetworkRegistrationInfo(nri); } } else if (oldSS.getRilDataRadioTechnology() != newSS.getRilDataRadioTechnology()) { // resume rat ratchet on following rat change within the same location mDataRatchetEnabled = true; Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +54 −11 Original line number Diff line number Diff line Loading @@ -1988,7 +1988,6 @@ public class ServiceStateTracker extends Handler { == TelephonyManager.NETWORK_TYPE_IWLAN && wlanPsRegState.getRegistrationState() == NetworkRegistrationInfo.REGISTRATION_STATE_HOME) { serviceState.setRilDataRadioTechnology(ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN); serviceState.setDataRegState(ServiceState.STATE_IN_SERVICE); } else if (wwanPsRegState != null) { // If the device is not camped on IWLAN, then we use cellular PS registration state Loading @@ -1997,7 +1996,6 @@ public class ServiceStateTracker extends Handler { int dataRat = ServiceState.networkTypeToRilRadioTechnology( wwanPsRegState.getAccessNetworkTechnology()); serviceState.setDataRegState(regCodeToServiceState(regState)); serviceState.setRilDataRadioTechnology(dataRat); } if (DBG) { log("combinePsRegistrationStates: " + serviceState); Loading @@ -2019,7 +2017,6 @@ public class ServiceStateTracker extends Handler { mNewSS.setVoiceRegState(regCodeToServiceState(registrationState)); mNewSS.setCssIndicator(cssIndicator); mNewSS.setRilVoiceRadioTechnology(newVoiceRat); mNewSS.addNetworkRegistrationInfo(networkRegState); setPhyCellInfoFromCellIdentity(mNewSS, networkRegState.getCellIdentity()); Loading Loading @@ -2153,8 +2150,6 @@ public class ServiceStateTracker extends Handler { updateServiceStateLteEarfcnBoost(mNewSS, getLteEarfcn(networkRegState.getCellIdentity())); mNewSS.setIsUsingCarrierAggregation(dataSpecificStates.isUsingCarrierAggregation); break; } Loading Loading @@ -2671,7 +2666,7 @@ public class ServiceStateTracker extends Handler { plmn = String.format(wfcVoiceSpnFormat, originalPlmn); } else if (mCi.getRadioState() == TelephonyManager.RADIO_POWER_OFF) { // todo: temporary hack; should have a better fix. This is to avoid using operator // name from ServiceState (populated in resetServiceStateInIwlanMode()) until // name from ServiceState (populated in processIwlanRegistrationInfo()) until // wifi calling is actually enabled log("updateSpnDisplay: overwriting plmn from " + plmn + " to null as radio " + "state is off"); Loading Loading @@ -2992,7 +2987,7 @@ public class ServiceStateTracker extends Handler { mNewSS.setDataRoaming(true); } useDataRegStateForDataOnlyDevices(); resetServiceStateInIwlanMode(); processIwlanRegistrationInfo(); if (Build.IS_DEBUGGABLE && mPhone.mTelephonyTester != null) { mPhone.mTelephonyTester.overrideServiceState(mNewSS); Loading Loading @@ -5044,8 +5039,13 @@ public class ServiceStateTracker extends Handler { /* Reset Service state when IWLAN is enabled as polling in airplane mode * causes state to go to OUT_OF_SERVICE state instead of STATE_OFF */ @UnsupportedAppUsage protected void resetServiceStateInIwlanMode() { /** * This method adds IWLAN registration info for legacy mode devices camped on IWLAN. It also * makes some adjustments when the device camps on IWLAN in airplane mode. */ private void processIwlanRegistrationInfo() { if (mCi.getRadioState() == TelephonyManager.RADIO_POWER_OFF) { boolean resetIwlanRatVal = false; log("set service state as POWER_OFF"); Loading @@ -5059,11 +5059,54 @@ public class ServiceStateTracker extends Handler { String operator = mNewSS.getOperatorAlphaLong(); mNewSS.setStateOff(); if (resetIwlanRatVal) { mNewSS.setRilDataRadioTechnology(ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN); mNewSS.setDataRegState(ServiceState.STATE_IN_SERVICE); NetworkRegistrationInfo nri = new NetworkRegistrationInfo.Builder() .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN) .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_IWLAN) .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME) .build(); mNewSS.addNetworkRegistrationInfo(nri); if (mTransportManager.isInLegacyMode()) { // If in legacy mode, simulate the behavior that IWLAN registration info // is reported through WWAN transport. nri = new NetworkRegistrationInfo.Builder() .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_IWLAN) .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME) .build(); mNewSS.addNetworkRegistrationInfo(nri); } mNewSS.setOperatorAlphaLong(operator); log("pollStateDone: mNewSS = " + mNewSS); } return; } // If the device operates in legacy mode and camps on IWLAN, modem reports IWLAN as a RAT // through WWAN registration info. To be consistent with the behavior with AP-assisted mode, // we manually make a WLAN registration info for clients to consume. In this scenario, // both WWAN and WLAN registration info are the IWLAN registration info and that's the // unfortunate limitation we have when the device operates in legacy mode. In AP-assisted // mode, the WWAN registration will correctly report the actual cellular registration info // when the device camps on IWLAN. if (mTransportManager.isInLegacyMode()) { NetworkRegistrationInfo wwanNri = mSS.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (wwanNri != null && wwanNri.getAccessNetworkTechnology() == TelephonyManager.NETWORK_TYPE_IWLAN) { NetworkRegistrationInfo wlanNri = new NetworkRegistrationInfo.Builder() .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN) .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .setRegistrationState(wwanNri.getRegistrationState()) .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_IWLAN) .setRejectCause(wwanNri.getRejectCause()) .setEmergencyOnly(wwanNri.isEmergencyEnabled()) .setAvailableServices(wwanNri.getAvailableServices()) .build(); mSS.addNetworkRegistrationInfo(wlanNri); } } } Loading Loading
src/java/com/android/internal/telephony/Phone.java +6 −1 Original line number Diff line number Diff line Loading @@ -3933,7 +3933,12 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { public void callEndCleanupHandOverCallIfAny() { } public void cancelUSSD() { /** * Cancel USSD session. * * @param msg The message to dispatch when the USSD session terminated. */ public void cancelUSSD(Message msg) { } /** Loading
src/java/com/android/internal/telephony/RIL.java +1 −1 Original line number Diff line number Diff line Loading @@ -530,7 +530,7 @@ public class RIL extends BaseCommands implements CommandsInterface { } } } catch (NoSuchElementException e) { mRadioProxy = null; mOemHookProxy = null; riljLoge("IOemHook service is not on the device HAL: " + e); } catch (RemoteException e) { mOemHookProxy = null; Loading
src/java/com/android/internal/telephony/RadioBugDetector.java +1 −0 Original line number Diff line number Diff line Loading @@ -127,6 +127,7 @@ public class RadioBugDetector { mRadioBugStatus = isSystemError ? RADIO_BUG_REPETITIVE_SYSTEM_ERROR : RADIO_BUG_REPETITIVE_WAKELOCK_TIMEOUT_ERROR; Intent intent = new Intent(TelephonyIntents.ACTION_REPORT_RADIO_BUG); intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); intent.putExtra(TelephonyIntents.EXTRA_SLOT_ID, mSlotId); intent.putExtra(TelephonyIntents.EXTRA_RADIO_BUG_TYPE, mRadioBugStatus); mContext.sendBroadcast(intent, android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE); Loading
src/java/com/android/internal/telephony/RatRatcheter.java +17 −4 Original line number Diff line number Diff line Loading @@ -21,13 +21,14 @@ import android.content.Intent; import android.content.IntentFilter; import android.os.PersistableBundle; import android.os.UserHandle; import android.telephony.AccessNetworkConstants; import android.telephony.CarrierConfigManager; import android.telephony.ServiceState; import android.telephony.NetworkRegistrationInfo; import android.telephony.Rlog; import android.telephony.ServiceState; import android.util.SparseArray; import android.util.SparseIntArray; import java.util.ArrayList; import java.util.Arrays; /** Loading Loading @@ -118,7 +119,13 @@ public class RatRatcheter { if (mVoiceRatchetEnabled) { int newVoiceRat = ratchetRat(oldSS.getRilVoiceRadioTechnology(), newSS.getRilVoiceRadioTechnology()); newSS.setRilVoiceRadioTechnology(newVoiceRat); NetworkRegistrationInfo nri = newSS.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (nri != null) { nri.setAccessNetworkTechnology( ServiceState.rilRadioTechnologyToNetworkType(newVoiceRat)); newSS.addNetworkRegistrationInfo(nri); } } else if (oldSS.getRilVoiceRadioTechnology() != newSS.getRilVoiceRadioTechnology()) { // resume rat ratchet on following rat change within the same location mVoiceRatchetEnabled = true; Loading @@ -127,7 +134,13 @@ public class RatRatcheter { if (mDataRatchetEnabled) { int newDataRat = ratchetRat(oldSS.getRilDataRadioTechnology(), newSS.getRilDataRadioTechnology()); newSS.setRilDataRadioTechnology(newDataRat); NetworkRegistrationInfo nri = newSS.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (nri != null) { nri.setAccessNetworkTechnology( ServiceState.rilRadioTechnologyToNetworkType(newDataRat)); newSS.addNetworkRegistrationInfo(nri); } } else if (oldSS.getRilDataRadioTechnology() != newSS.getRilDataRadioTechnology()) { // resume rat ratchet on following rat change within the same location mDataRatchetEnabled = true; Loading
src/java/com/android/internal/telephony/ServiceStateTracker.java +54 −11 Original line number Diff line number Diff line Loading @@ -1988,7 +1988,6 @@ public class ServiceStateTracker extends Handler { == TelephonyManager.NETWORK_TYPE_IWLAN && wlanPsRegState.getRegistrationState() == NetworkRegistrationInfo.REGISTRATION_STATE_HOME) { serviceState.setRilDataRadioTechnology(ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN); serviceState.setDataRegState(ServiceState.STATE_IN_SERVICE); } else if (wwanPsRegState != null) { // If the device is not camped on IWLAN, then we use cellular PS registration state Loading @@ -1997,7 +1996,6 @@ public class ServiceStateTracker extends Handler { int dataRat = ServiceState.networkTypeToRilRadioTechnology( wwanPsRegState.getAccessNetworkTechnology()); serviceState.setDataRegState(regCodeToServiceState(regState)); serviceState.setRilDataRadioTechnology(dataRat); } if (DBG) { log("combinePsRegistrationStates: " + serviceState); Loading @@ -2019,7 +2017,6 @@ public class ServiceStateTracker extends Handler { mNewSS.setVoiceRegState(regCodeToServiceState(registrationState)); mNewSS.setCssIndicator(cssIndicator); mNewSS.setRilVoiceRadioTechnology(newVoiceRat); mNewSS.addNetworkRegistrationInfo(networkRegState); setPhyCellInfoFromCellIdentity(mNewSS, networkRegState.getCellIdentity()); Loading Loading @@ -2153,8 +2150,6 @@ public class ServiceStateTracker extends Handler { updateServiceStateLteEarfcnBoost(mNewSS, getLteEarfcn(networkRegState.getCellIdentity())); mNewSS.setIsUsingCarrierAggregation(dataSpecificStates.isUsingCarrierAggregation); break; } Loading Loading @@ -2671,7 +2666,7 @@ public class ServiceStateTracker extends Handler { plmn = String.format(wfcVoiceSpnFormat, originalPlmn); } else if (mCi.getRadioState() == TelephonyManager.RADIO_POWER_OFF) { // todo: temporary hack; should have a better fix. This is to avoid using operator // name from ServiceState (populated in resetServiceStateInIwlanMode()) until // name from ServiceState (populated in processIwlanRegistrationInfo()) until // wifi calling is actually enabled log("updateSpnDisplay: overwriting plmn from " + plmn + " to null as radio " + "state is off"); Loading Loading @@ -2992,7 +2987,7 @@ public class ServiceStateTracker extends Handler { mNewSS.setDataRoaming(true); } useDataRegStateForDataOnlyDevices(); resetServiceStateInIwlanMode(); processIwlanRegistrationInfo(); if (Build.IS_DEBUGGABLE && mPhone.mTelephonyTester != null) { mPhone.mTelephonyTester.overrideServiceState(mNewSS); Loading Loading @@ -5044,8 +5039,13 @@ public class ServiceStateTracker extends Handler { /* Reset Service state when IWLAN is enabled as polling in airplane mode * causes state to go to OUT_OF_SERVICE state instead of STATE_OFF */ @UnsupportedAppUsage protected void resetServiceStateInIwlanMode() { /** * This method adds IWLAN registration info for legacy mode devices camped on IWLAN. It also * makes some adjustments when the device camps on IWLAN in airplane mode. */ private void processIwlanRegistrationInfo() { if (mCi.getRadioState() == TelephonyManager.RADIO_POWER_OFF) { boolean resetIwlanRatVal = false; log("set service state as POWER_OFF"); Loading @@ -5059,11 +5059,54 @@ public class ServiceStateTracker extends Handler { String operator = mNewSS.getOperatorAlphaLong(); mNewSS.setStateOff(); if (resetIwlanRatVal) { mNewSS.setRilDataRadioTechnology(ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN); mNewSS.setDataRegState(ServiceState.STATE_IN_SERVICE); NetworkRegistrationInfo nri = new NetworkRegistrationInfo.Builder() .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN) .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_IWLAN) .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME) .build(); mNewSS.addNetworkRegistrationInfo(nri); if (mTransportManager.isInLegacyMode()) { // If in legacy mode, simulate the behavior that IWLAN registration info // is reported through WWAN transport. nri = new NetworkRegistrationInfo.Builder() .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_IWLAN) .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME) .build(); mNewSS.addNetworkRegistrationInfo(nri); } mNewSS.setOperatorAlphaLong(operator); log("pollStateDone: mNewSS = " + mNewSS); } return; } // If the device operates in legacy mode and camps on IWLAN, modem reports IWLAN as a RAT // through WWAN registration info. To be consistent with the behavior with AP-assisted mode, // we manually make a WLAN registration info for clients to consume. In this scenario, // both WWAN and WLAN registration info are the IWLAN registration info and that's the // unfortunate limitation we have when the device operates in legacy mode. In AP-assisted // mode, the WWAN registration will correctly report the actual cellular registration info // when the device camps on IWLAN. if (mTransportManager.isInLegacyMode()) { NetworkRegistrationInfo wwanNri = mSS.getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (wwanNri != null && wwanNri.getAccessNetworkTechnology() == TelephonyManager.NETWORK_TYPE_IWLAN) { NetworkRegistrationInfo wlanNri = new NetworkRegistrationInfo.Builder() .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN) .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .setRegistrationState(wwanNri.getRegistrationState()) .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_IWLAN) .setRejectCause(wwanNri.getRejectCause()) .setEmergencyOnly(wwanNri.isEmergencyEnabled()) .setAvailableServices(wwanNri.getAvailableServices()) .build(); mSS.addNetworkRegistrationInfo(wlanNri); } } } Loading