Loading src/java/com/android/internal/telephony/CellularNetworkService.java +23 −2 Original line number Diff line number Diff line Loading @@ -275,7 +275,9 @@ public class CellularNetworkService extends NetworkService { return new NetworkRegistrationState(domain, transportType, regState, accessNetworkTechnology, reasonForDenial, emergencyOnly, availableServices, cellIdentity, maxDataCalls); cellIdentity, maxDataCalls, false /* isDcNrRestricted */, false /* isNrAvailable */); } else if (result instanceof android.hardware.radio.V1_2.DataRegStateResult) { android.hardware.radio.V1_2.DataRegStateResult dataRegState = (android.hardware.radio.V1_2.DataRegStateResult) result; Loading @@ -290,7 +292,26 @@ public class CellularNetworkService extends NetworkService { return new NetworkRegistrationState(domain, transportType, regState, accessNetworkTechnology, reasonForDenial, emergencyOnly, availableServices, cellIdentity, maxDataCalls); cellIdentity, maxDataCalls, false /* isDcNrRestricted */, false /* isNrAvailable */); } else if (result instanceof android.hardware.radio.V1_3.DataRegStateResult) { android.hardware.radio.V1_3.DataRegStateResult dataRegState = (android.hardware.radio.V1_3.DataRegStateResult) result; int regState = getRegStateFromHalRegState(dataRegState.base.regState); int accessNetworkTechnology = getAccessNetworkTechnologyFromRat( dataRegState.base.rat); int reasonForDenial = dataRegState.base.reasonDataDenied; boolean emergencyOnly = isEmergencyOnly(dataRegState.base.regState); int maxDataCalls = dataRegState.base.maxDataCalls; int[] availableServices = getAvailableServices(regState, domain, emergencyOnly); CellIdentity cellIdentity = convertHalCellIdentityToCellIdentity(dataRegState.base.cellIdentity); boolean isDcNrRestricted = dataRegState.isDcNrRestricted; boolean isNrAvailable = dataRegState.isNrAvailable; return new NetworkRegistrationState(domain, transportType, regState, accessNetworkTechnology, reasonForDenial, emergencyOnly, availableServices, cellIdentity, maxDataCalls, isDcNrRestricted, isNrAvailable); } return null; Loading src/java/com/android/internal/telephony/RIL.java +20 −3 Original line number Diff line number Diff line Loading @@ -5391,6 +5391,7 @@ public class RIL extends BaseCommands implements CommandsInterface { return lce; } // TODO(b/119224773) refactor the converter of CellInfo. private static void writeToParcelForGsm( Parcel p, int lac, int cid, int arfcn, int bsic, String mcc, String mnc, String al, String as, int ss, int ber, int ta) { Loading @@ -5408,6 +5409,7 @@ public class RIL extends BaseCommands implements CommandsInterface { p.writeInt(ta); } // TODO(b/119224773) refactor the converter of CellInfo. private static void writeToParcelForCdma( Parcel p, int ni, int si, int bsi, int lon, int lat, String al, String as, int dbm, int ecio, int eDbm, int eEcio, int eSnr) { Loading @@ -5415,27 +5417,39 @@ public class RIL extends BaseCommands implements CommandsInterface { new CellSignalStrengthCdma(dbm, ecio, eDbm, eEcio, eSnr).writeToParcel(p, 0); } // TODO(b/119224773) refactor the converter of CellInfo. private static void writeToParcelForLte( Parcel p, int ci, int pci, int tac, int earfcn, int bandwidth, String mcc, String mnc, String al, String as, int ss, int rsrp, int rsrq, int rssnr, int cqi, int ta) { String al, String as, int ss, int rsrp, int rsrq, int rssnr, int cqi, int ta, boolean isEndcAvailable) { // General CellInfo p.writeInt(CellInfo.TYPE_LTE); p.writeString(mcc); p.writeString(mnc); p.writeString(al); p.writeString(as); // CellIdentity p.writeInt(ci); p.writeInt(pci); p.writeInt(tac); p.writeInt(earfcn); p.writeInt(bandwidth); // CellSignalStrength p.writeInt(ss); p.writeInt(rsrp); p.writeInt(rsrq); p.writeInt(rssnr); p.writeInt(cqi); p.writeInt(ta); // CellConfigLte p.writeBoolean(isEndcAvailable); } // TODO(b/119224773) refactor the converter of CellInfo. private static void writeToParcelForWcdma( Parcel p, int lac, int cid, int psc, int uarfcn, String mcc, String mnc, String al, String as, int ss, int ber, int rscp, int ecno) { Loading @@ -5454,6 +5468,7 @@ public class RIL extends BaseCommands implements CommandsInterface { p.writeInt(ecno); } // TODO(b/119224773) refactor the converter of CellInfo. private static void writeToParcelForTdscdma( Parcel p, int lac, int cid, int cpid, int uarfcn, String mcc, String mnc, String al, String as, int ss, int ber, int rscp) { Loading Loading @@ -5544,7 +5559,8 @@ public class RIL extends BaseCommands implements CommandsInterface { cellInfoLte.signalStrengthLte.rsrq, cellInfoLte.signalStrengthLte.rssnr, cellInfoLte.signalStrengthLte.cqi, cellInfoLte.signalStrengthLte.timingAdvance); cellInfoLte.signalStrengthLte.timingAdvance, false /* isEndcAvailable */); break; } Loading Loading @@ -5670,7 +5686,8 @@ public class RIL extends BaseCommands implements CommandsInterface { cellInfoLte.signalStrengthLte.rsrq, cellInfoLte.signalStrengthLte.rssnr, cellInfoLte.signalStrengthLte.cqi, cellInfoLte.signalStrengthLte.timingAdvance); cellInfoLte.signalStrengthLte.timingAdvance, false /* isEndcAvailable */); break; } Loading tests/telephonytests/src/com/android/internal/telephony/CellularNetworkServiceTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ public class CellularNetworkServiceTest extends TelephonyTest { expectedState = new NetworkRegistrationState( domain, AccessNetworkConstants.TransportType.WWAN, voiceRegState, ServiceState.rilRadioTechnologyToNetworkType(voiceRadioTech), reasonForDenial, false, availableServices, null, maxDataCalls); false, availableServices, null, maxDataCalls, false, false); try { verify(mCallback, times(1)).onGetNetworkRegistrationStateComplete( Loading tests/telephonytests/src/com/android/internal/telephony/ServiceStateTest.java +2 −4 Original line number Diff line number Diff line Loading @@ -291,8 +291,7 @@ public class ServiceStateTest extends TestCase { NetworkRegistrationState wwanDataRegState = new NetworkRegistrationState( NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN, 0, 0, 0, false, null, null, 0); 0, 0, 0, false, null, null, 0, false, false); NetworkRegistrationState wlanRegState = new NetworkRegistrationState( NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WLAN, Loading @@ -314,8 +313,7 @@ public class ServiceStateTest extends TestCase { wwanDataRegState = new NetworkRegistrationState( NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN, 0, 0, 0, true, null, null, 0); 0, 0, 0, true, null, null, 0, false, false); ss.addNetworkRegistrationState(wwanDataRegState); assertEquals(ss.getNetworkRegistrationStates(NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN), wwanDataRegState); Loading tests/telephonytests/src/com/android/internal/telephony/ServiceStateTrackerTest.java +5 −3 Original line number Diff line number Diff line Loading @@ -1656,7 +1656,7 @@ public class ServiceStateTrackerTest extends TelephonyTest { private void changeRegState(int state, CellIdentity cid, int voiceRat, int dataRat) { NetworkRegistrationState dataResult = new NetworkRegistrationState( 0, 0, state, dataRat, 0, false, null, cid, 1); 0, 0, state, dataRat, 0, false, null, cid, 1, false, false); sst.mPollingContext[0] = 2; // update data reg state to be in service sst.sendMessage(sst.obtainMessage(ServiceStateTracker.EVENT_POLL_STATE_GPRS, Loading Loading @@ -1741,7 +1741,8 @@ public class ServiceStateTrackerTest extends TelephonyTest { private void sendRegStateUpdateForLteCellId(CellIdentityLte cellId) { NetworkRegistrationState dataResult = new NetworkRegistrationState( 2, 1, 1, TelephonyManager.NETWORK_TYPE_LTE, 0, false, null, cellId, 1); 2, 1, 1, TelephonyManager.NETWORK_TYPE_LTE, 0, false, null, cellId, 1, false, false); NetworkRegistrationState voiceResult = new NetworkRegistrationState( 1, 1, 1, TelephonyManager.NETWORK_TYPE_LTE, 0, false, null, cellId, false, 0, 0, 0); Loading Loading @@ -1804,7 +1805,8 @@ public class ServiceStateTrackerTest extends TelephonyTest { public void testPhyChanBandwidthResetsOnOos() throws Exception { testPhyChanBandwidthRatchetedOnPhyChanBandwidth(); NetworkRegistrationState dataResult = new NetworkRegistrationState( 2, 1, 0, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0, false, null, null, 1); 2, 1, 0, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0, false, null, null, 1, false, false); NetworkRegistrationState voiceResult = new NetworkRegistrationState( 1, 1, 0, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0, false, null, null, false, 0, 0, 0); Loading Loading
src/java/com/android/internal/telephony/CellularNetworkService.java +23 −2 Original line number Diff line number Diff line Loading @@ -275,7 +275,9 @@ public class CellularNetworkService extends NetworkService { return new NetworkRegistrationState(domain, transportType, regState, accessNetworkTechnology, reasonForDenial, emergencyOnly, availableServices, cellIdentity, maxDataCalls); cellIdentity, maxDataCalls, false /* isDcNrRestricted */, false /* isNrAvailable */); } else if (result instanceof android.hardware.radio.V1_2.DataRegStateResult) { android.hardware.radio.V1_2.DataRegStateResult dataRegState = (android.hardware.radio.V1_2.DataRegStateResult) result; Loading @@ -290,7 +292,26 @@ public class CellularNetworkService extends NetworkService { return new NetworkRegistrationState(domain, transportType, regState, accessNetworkTechnology, reasonForDenial, emergencyOnly, availableServices, cellIdentity, maxDataCalls); cellIdentity, maxDataCalls, false /* isDcNrRestricted */, false /* isNrAvailable */); } else if (result instanceof android.hardware.radio.V1_3.DataRegStateResult) { android.hardware.radio.V1_3.DataRegStateResult dataRegState = (android.hardware.radio.V1_3.DataRegStateResult) result; int regState = getRegStateFromHalRegState(dataRegState.base.regState); int accessNetworkTechnology = getAccessNetworkTechnologyFromRat( dataRegState.base.rat); int reasonForDenial = dataRegState.base.reasonDataDenied; boolean emergencyOnly = isEmergencyOnly(dataRegState.base.regState); int maxDataCalls = dataRegState.base.maxDataCalls; int[] availableServices = getAvailableServices(regState, domain, emergencyOnly); CellIdentity cellIdentity = convertHalCellIdentityToCellIdentity(dataRegState.base.cellIdentity); boolean isDcNrRestricted = dataRegState.isDcNrRestricted; boolean isNrAvailable = dataRegState.isNrAvailable; return new NetworkRegistrationState(domain, transportType, regState, accessNetworkTechnology, reasonForDenial, emergencyOnly, availableServices, cellIdentity, maxDataCalls, isDcNrRestricted, isNrAvailable); } return null; Loading
src/java/com/android/internal/telephony/RIL.java +20 −3 Original line number Diff line number Diff line Loading @@ -5391,6 +5391,7 @@ public class RIL extends BaseCommands implements CommandsInterface { return lce; } // TODO(b/119224773) refactor the converter of CellInfo. private static void writeToParcelForGsm( Parcel p, int lac, int cid, int arfcn, int bsic, String mcc, String mnc, String al, String as, int ss, int ber, int ta) { Loading @@ -5408,6 +5409,7 @@ public class RIL extends BaseCommands implements CommandsInterface { p.writeInt(ta); } // TODO(b/119224773) refactor the converter of CellInfo. private static void writeToParcelForCdma( Parcel p, int ni, int si, int bsi, int lon, int lat, String al, String as, int dbm, int ecio, int eDbm, int eEcio, int eSnr) { Loading @@ -5415,27 +5417,39 @@ public class RIL extends BaseCommands implements CommandsInterface { new CellSignalStrengthCdma(dbm, ecio, eDbm, eEcio, eSnr).writeToParcel(p, 0); } // TODO(b/119224773) refactor the converter of CellInfo. private static void writeToParcelForLte( Parcel p, int ci, int pci, int tac, int earfcn, int bandwidth, String mcc, String mnc, String al, String as, int ss, int rsrp, int rsrq, int rssnr, int cqi, int ta) { String al, String as, int ss, int rsrp, int rsrq, int rssnr, int cqi, int ta, boolean isEndcAvailable) { // General CellInfo p.writeInt(CellInfo.TYPE_LTE); p.writeString(mcc); p.writeString(mnc); p.writeString(al); p.writeString(as); // CellIdentity p.writeInt(ci); p.writeInt(pci); p.writeInt(tac); p.writeInt(earfcn); p.writeInt(bandwidth); // CellSignalStrength p.writeInt(ss); p.writeInt(rsrp); p.writeInt(rsrq); p.writeInt(rssnr); p.writeInt(cqi); p.writeInt(ta); // CellConfigLte p.writeBoolean(isEndcAvailable); } // TODO(b/119224773) refactor the converter of CellInfo. private static void writeToParcelForWcdma( Parcel p, int lac, int cid, int psc, int uarfcn, String mcc, String mnc, String al, String as, int ss, int ber, int rscp, int ecno) { Loading @@ -5454,6 +5468,7 @@ public class RIL extends BaseCommands implements CommandsInterface { p.writeInt(ecno); } // TODO(b/119224773) refactor the converter of CellInfo. private static void writeToParcelForTdscdma( Parcel p, int lac, int cid, int cpid, int uarfcn, String mcc, String mnc, String al, String as, int ss, int ber, int rscp) { Loading Loading @@ -5544,7 +5559,8 @@ public class RIL extends BaseCommands implements CommandsInterface { cellInfoLte.signalStrengthLte.rsrq, cellInfoLte.signalStrengthLte.rssnr, cellInfoLte.signalStrengthLte.cqi, cellInfoLte.signalStrengthLte.timingAdvance); cellInfoLte.signalStrengthLte.timingAdvance, false /* isEndcAvailable */); break; } Loading Loading @@ -5670,7 +5686,8 @@ public class RIL extends BaseCommands implements CommandsInterface { cellInfoLte.signalStrengthLte.rsrq, cellInfoLte.signalStrengthLte.rssnr, cellInfoLte.signalStrengthLte.cqi, cellInfoLte.signalStrengthLte.timingAdvance); cellInfoLte.signalStrengthLte.timingAdvance, false /* isEndcAvailable */); break; } Loading
tests/telephonytests/src/com/android/internal/telephony/CellularNetworkServiceTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ public class CellularNetworkServiceTest extends TelephonyTest { expectedState = new NetworkRegistrationState( domain, AccessNetworkConstants.TransportType.WWAN, voiceRegState, ServiceState.rilRadioTechnologyToNetworkType(voiceRadioTech), reasonForDenial, false, availableServices, null, maxDataCalls); false, availableServices, null, maxDataCalls, false, false); try { verify(mCallback, times(1)).onGetNetworkRegistrationStateComplete( Loading
tests/telephonytests/src/com/android/internal/telephony/ServiceStateTest.java +2 −4 Original line number Diff line number Diff line Loading @@ -291,8 +291,7 @@ public class ServiceStateTest extends TestCase { NetworkRegistrationState wwanDataRegState = new NetworkRegistrationState( NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN, 0, 0, 0, false, null, null, 0); 0, 0, 0, false, null, null, 0, false, false); NetworkRegistrationState wlanRegState = new NetworkRegistrationState( NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WLAN, Loading @@ -314,8 +313,7 @@ public class ServiceStateTest extends TestCase { wwanDataRegState = new NetworkRegistrationState( NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN, 0, 0, 0, true, null, null, 0); 0, 0, 0, true, null, null, 0, false, false); ss.addNetworkRegistrationState(wwanDataRegState); assertEquals(ss.getNetworkRegistrationStates(NetworkRegistrationState.DOMAIN_PS, AccessNetworkConstants.TransportType.WWAN), wwanDataRegState); Loading
tests/telephonytests/src/com/android/internal/telephony/ServiceStateTrackerTest.java +5 −3 Original line number Diff line number Diff line Loading @@ -1656,7 +1656,7 @@ public class ServiceStateTrackerTest extends TelephonyTest { private void changeRegState(int state, CellIdentity cid, int voiceRat, int dataRat) { NetworkRegistrationState dataResult = new NetworkRegistrationState( 0, 0, state, dataRat, 0, false, null, cid, 1); 0, 0, state, dataRat, 0, false, null, cid, 1, false, false); sst.mPollingContext[0] = 2; // update data reg state to be in service sst.sendMessage(sst.obtainMessage(ServiceStateTracker.EVENT_POLL_STATE_GPRS, Loading Loading @@ -1741,7 +1741,8 @@ public class ServiceStateTrackerTest extends TelephonyTest { private void sendRegStateUpdateForLteCellId(CellIdentityLte cellId) { NetworkRegistrationState dataResult = new NetworkRegistrationState( 2, 1, 1, TelephonyManager.NETWORK_TYPE_LTE, 0, false, null, cellId, 1); 2, 1, 1, TelephonyManager.NETWORK_TYPE_LTE, 0, false, null, cellId, 1, false, false); NetworkRegistrationState voiceResult = new NetworkRegistrationState( 1, 1, 1, TelephonyManager.NETWORK_TYPE_LTE, 0, false, null, cellId, false, 0, 0, 0); Loading Loading @@ -1804,7 +1805,8 @@ public class ServiceStateTrackerTest extends TelephonyTest { public void testPhyChanBandwidthResetsOnOos() throws Exception { testPhyChanBandwidthRatchetedOnPhyChanBandwidth(); NetworkRegistrationState dataResult = new NetworkRegistrationState( 2, 1, 0, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0, false, null, null, 1); 2, 1, 0, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0, false, null, null, 1, false, false); NetworkRegistrationState voiceResult = new NetworkRegistrationState( 1, 1, 0, TelephonyManager.NETWORK_TYPE_UNKNOWN, 0, false, null, null, false, 0, 0, 0); Loading