Loading telephony/java/android/telephony/DataSpecificRegistrationInfo.java +15 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,21 @@ public final class DataSpecificRegistrationInfo implements Parcelable { this.mIsUsingCarrierAggregation = isUsingCarrierAggregation; } /** * Constructor from another data specific registration info * * @param dsri another data specific registration info * @hide */ DataSpecificRegistrationInfo(DataSpecificRegistrationInfo dsri) { maxDataCalls = dsri.maxDataCalls; isDcNrRestricted = dsri.isDcNrRestricted; isNrAvailable = dsri.isNrAvailable; isEnDcAvailable = dsri.isEnDcAvailable; mLteVopsSupportInfo = dsri.mLteVopsSupportInfo; mIsUsingCarrierAggregation = dsri.mIsUsingCarrierAggregation; } private DataSpecificRegistrationInfo(Parcel source) { maxDataCalls = source.readInt(); isDcNrRestricted = source.readBoolean(); Loading telephony/java/android/telephony/NetworkRegistrationInfo.java +33 −0 Original line number Diff line number Diff line Loading @@ -279,6 +279,39 @@ public final class NetworkRegistrationInfo implements Parcelable { mNrState = source.readInt(); } /** * Constructor from another network registration info * * @param nri Another network registration info * @hide */ public NetworkRegistrationInfo(NetworkRegistrationInfo nri) { mDomain = nri.mDomain; mTransportType = nri.mTransportType; mRegistrationState = nri.mRegistrationState; mRoamingType = nri.mRoamingType; mAccessNetworkTechnology = nri.mAccessNetworkTechnology; mRejectCause = nri.mRejectCause; mEmergencyOnly = nri.mEmergencyOnly; mAvailableServices = new ArrayList<>(nri.mAvailableServices); if (nri.mCellIdentity != null) { Parcel p = Parcel.obtain(); nri.mCellIdentity.writeToParcel(p, 0); p.setDataPosition(0); // TODO: Instead of doing this, we should create a formal way for cloning cell identity. // Cell identity is not an immutable object so we have to deep copy it. mCellIdentity = CellIdentity.CREATOR.createFromParcel(p); } if (nri.mVoiceSpecificInfo != null) { mVoiceSpecificInfo = new VoiceSpecificRegistrationInfo(nri.mVoiceSpecificInfo); } if (nri.mDataSpecificInfo != null) { mDataSpecificInfo = new DataSpecificRegistrationInfo(nri.mDataSpecificInfo); } mNrState = nri.mNrState; } /** * @return The transport type. */ Loading telephony/java/android/telephony/ServiceState.java +37 −33 Original line number Diff line number Diff line Loading @@ -421,7 +421,7 @@ public class ServiceState implements Parcelable { Arrays.copyOf(s.mCellBandwidths, s.mCellBandwidths.length); mLteEarfcnRsrpBoost = s.mLteEarfcnRsrpBoost; mNetworkRegistrationInfos = s.mNetworkRegistrationInfos == null ? null : new ArrayList<>(s.mNetworkRegistrationInfos); s.getNetworkRegistrationInfoList(); mNrFrequencyRange = s.mNrFrequencyRange; mOperatorAlphaLongRaw = s.mOperatorAlphaLongRaw; mOperatorAlphaShortRaw = s.mOperatorAlphaShortRaw; Loading Loading @@ -1130,16 +1130,16 @@ public class ServiceState implements Parcelable { /** @hide */ @TestApi public void setVoiceRoamingType(@RoamingType int type) { NetworkRegistrationInfo regState = getNetworkRegistrationInfo( NetworkRegistrationInfo regInfo = getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (regState == null) { regState = new NetworkRegistrationInfo.Builder() if (regInfo == null) { regInfo = new NetworkRegistrationInfo.Builder() .setDomain(NetworkRegistrationInfo.DOMAIN_CS) .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .build(); addNetworkRegistrationInfo(regState); } regState.setRoamingType(type); regInfo.setRoamingType(type); addNetworkRegistrationInfo(regInfo); } /** @hide */ Loading @@ -1151,16 +1151,16 @@ public class ServiceState implements Parcelable { /** @hide */ @TestApi public void setDataRoamingType(@RoamingType int type) { NetworkRegistrationInfo regState = getNetworkRegistrationInfo( NetworkRegistrationInfo regInfo = getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (regState == null) { regState = new NetworkRegistrationInfo.Builder() if (regInfo == null) { regInfo = new NetworkRegistrationInfo.Builder() .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .build(); addNetworkRegistrationInfo(regState); } regState.setRoamingType(type); regInfo.setRoamingType(type); addNetworkRegistrationInfo(regInfo); } /** Loading Loading @@ -1324,16 +1324,16 @@ public class ServiceState implements Parcelable { Rlog.e(LOG_TAG, "ServiceState.setRilVoiceRadioTechnology() called. It's encouraged to " + "use addNetworkRegistrationInfo() instead *******"); // Sync to network registration state NetworkRegistrationInfo regState = getNetworkRegistrationInfo( NetworkRegistrationInfo regInfo = getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (regState == null) { regState = new NetworkRegistrationInfo.Builder() if (regInfo == null) { regInfo = new NetworkRegistrationInfo.Builder() .setDomain(NetworkRegistrationInfo.DOMAIN_CS) .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .build(); addNetworkRegistrationInfo(regState); } regState.setAccessNetworkTechnology(rilRadioTechnologyToNetworkType(rt)); regInfo.setAccessNetworkTechnology(rilRadioTechnologyToNetworkType(rt)); addNetworkRegistrationInfo(regInfo); } Loading @@ -1345,17 +1345,17 @@ public class ServiceState implements Parcelable { // Sync to network registration state. Always write down the WWAN transport. For AP-assisted // mode device, use addNetworkRegistrationInfo() to set the correct transport if RAT // is IWLAN. NetworkRegistrationInfo regState = getNetworkRegistrationInfo( NetworkRegistrationInfo regInfo = getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (regState == null) { regState = new NetworkRegistrationInfo.Builder() if (regInfo == null) { regInfo = new NetworkRegistrationInfo.Builder() .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .build(); addNetworkRegistrationInfo(regState); } regState.setAccessNetworkTechnology(rilRadioTechnologyToNetworkType(rt)); regInfo.setAccessNetworkTechnology(rilRadioTechnologyToNetworkType(rt)); addNetworkRegistrationInfo(regInfo); } /** @hide */ Loading Loading @@ -1397,10 +1397,10 @@ public class ServiceState implements Parcelable { * @hide */ public @NRState int getNrState() { final NetworkRegistrationInfo regState = getNetworkRegistrationInfo( final NetworkRegistrationInfo regInfo = getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (regState == null) return NetworkRegistrationInfo.NR_STATE_NONE; return regState.getNrState(); if (regInfo == null) return NetworkRegistrationInfo.NR_STATE_NONE; return regInfo.getNrState(); } /** Loading Loading @@ -1794,7 +1794,11 @@ public class ServiceState implements Parcelable { @SystemApi public List<NetworkRegistrationInfo> getNetworkRegistrationInfoList() { synchronized (mNetworkRegistrationInfos) { return new ArrayList<>(mNetworkRegistrationInfos); List<NetworkRegistrationInfo> newList = new ArrayList<>(); for (NetworkRegistrationInfo nri : mNetworkRegistrationInfos) { newList.add(new NetworkRegistrationInfo(nri)); } return newList; } } Loading @@ -1814,7 +1818,7 @@ public class ServiceState implements Parcelable { synchronized (mNetworkRegistrationInfos) { for (NetworkRegistrationInfo networkRegistrationInfo : mNetworkRegistrationInfos) { if (networkRegistrationInfo.getTransportType() == transportType) { list.add(networkRegistrationInfo); list.add(new NetworkRegistrationInfo(networkRegistrationInfo)); } } } Loading @@ -1838,7 +1842,7 @@ public class ServiceState implements Parcelable { synchronized (mNetworkRegistrationInfos) { for (NetworkRegistrationInfo networkRegistrationInfo : mNetworkRegistrationInfos) { if (networkRegistrationInfo.getDomain() == domain) { list.add(networkRegistrationInfo); list.add(new NetworkRegistrationInfo(networkRegistrationInfo)); } } } Loading @@ -1863,7 +1867,7 @@ public class ServiceState implements Parcelable { for (NetworkRegistrationInfo networkRegistrationInfo : mNetworkRegistrationInfos) { if (networkRegistrationInfo.getTransportType() == transportType && networkRegistrationInfo.getDomain() == domain) { return networkRegistrationInfo; return new NetworkRegistrationInfo(networkRegistrationInfo); } } } Loading @@ -1875,20 +1879,20 @@ public class ServiceState implements Parcelable { * @hide */ @TestApi public void addNetworkRegistrationInfo(NetworkRegistrationInfo regState) { if (regState == null) return; public void addNetworkRegistrationInfo(NetworkRegistrationInfo nri) { if (nri == null) return; synchronized (mNetworkRegistrationInfos) { for (int i = 0; i < mNetworkRegistrationInfos.size(); i++) { NetworkRegistrationInfo curRegState = mNetworkRegistrationInfos.get(i); if (curRegState.getTransportType() == regState.getTransportType() && curRegState.getDomain() == regState.getDomain()) { if (curRegState.getTransportType() == nri.getTransportType() && curRegState.getDomain() == nri.getDomain()) { mNetworkRegistrationInfos.remove(i); break; } } mNetworkRegistrationInfos.add(regState); mNetworkRegistrationInfos.add(new NetworkRegistrationInfo(nri)); } } Loading telephony/java/android/telephony/VoiceSpecificRegistrationInfo.java +13 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,19 @@ public class VoiceSpecificRegistrationInfo implements Parcelable{ this.defaultRoamingIndicator = defaultRoamingIndicator; } /** * Constructor from another voice specific registration info * * @param vsri another voice specific registration info * @hide */ VoiceSpecificRegistrationInfo(VoiceSpecificRegistrationInfo vsri) { cssSupported = vsri.cssSupported; roamingIndicator = vsri.roamingIndicator; systemIsInPrl = vsri.systemIsInPrl; defaultRoamingIndicator = vsri.defaultRoamingIndicator; } private VoiceSpecificRegistrationInfo(Parcel source) { this.cssSupported = source.readBoolean(); this.roamingIndicator = source.readInt(); Loading Loading
telephony/java/android/telephony/DataSpecificRegistrationInfo.java +15 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,21 @@ public final class DataSpecificRegistrationInfo implements Parcelable { this.mIsUsingCarrierAggregation = isUsingCarrierAggregation; } /** * Constructor from another data specific registration info * * @param dsri another data specific registration info * @hide */ DataSpecificRegistrationInfo(DataSpecificRegistrationInfo dsri) { maxDataCalls = dsri.maxDataCalls; isDcNrRestricted = dsri.isDcNrRestricted; isNrAvailable = dsri.isNrAvailable; isEnDcAvailable = dsri.isEnDcAvailable; mLteVopsSupportInfo = dsri.mLteVopsSupportInfo; mIsUsingCarrierAggregation = dsri.mIsUsingCarrierAggregation; } private DataSpecificRegistrationInfo(Parcel source) { maxDataCalls = source.readInt(); isDcNrRestricted = source.readBoolean(); Loading
telephony/java/android/telephony/NetworkRegistrationInfo.java +33 −0 Original line number Diff line number Diff line Loading @@ -279,6 +279,39 @@ public final class NetworkRegistrationInfo implements Parcelable { mNrState = source.readInt(); } /** * Constructor from another network registration info * * @param nri Another network registration info * @hide */ public NetworkRegistrationInfo(NetworkRegistrationInfo nri) { mDomain = nri.mDomain; mTransportType = nri.mTransportType; mRegistrationState = nri.mRegistrationState; mRoamingType = nri.mRoamingType; mAccessNetworkTechnology = nri.mAccessNetworkTechnology; mRejectCause = nri.mRejectCause; mEmergencyOnly = nri.mEmergencyOnly; mAvailableServices = new ArrayList<>(nri.mAvailableServices); if (nri.mCellIdentity != null) { Parcel p = Parcel.obtain(); nri.mCellIdentity.writeToParcel(p, 0); p.setDataPosition(0); // TODO: Instead of doing this, we should create a formal way for cloning cell identity. // Cell identity is not an immutable object so we have to deep copy it. mCellIdentity = CellIdentity.CREATOR.createFromParcel(p); } if (nri.mVoiceSpecificInfo != null) { mVoiceSpecificInfo = new VoiceSpecificRegistrationInfo(nri.mVoiceSpecificInfo); } if (nri.mDataSpecificInfo != null) { mDataSpecificInfo = new DataSpecificRegistrationInfo(nri.mDataSpecificInfo); } mNrState = nri.mNrState; } /** * @return The transport type. */ Loading
telephony/java/android/telephony/ServiceState.java +37 −33 Original line number Diff line number Diff line Loading @@ -421,7 +421,7 @@ public class ServiceState implements Parcelable { Arrays.copyOf(s.mCellBandwidths, s.mCellBandwidths.length); mLteEarfcnRsrpBoost = s.mLteEarfcnRsrpBoost; mNetworkRegistrationInfos = s.mNetworkRegistrationInfos == null ? null : new ArrayList<>(s.mNetworkRegistrationInfos); s.getNetworkRegistrationInfoList(); mNrFrequencyRange = s.mNrFrequencyRange; mOperatorAlphaLongRaw = s.mOperatorAlphaLongRaw; mOperatorAlphaShortRaw = s.mOperatorAlphaShortRaw; Loading Loading @@ -1130,16 +1130,16 @@ public class ServiceState implements Parcelable { /** @hide */ @TestApi public void setVoiceRoamingType(@RoamingType int type) { NetworkRegistrationInfo regState = getNetworkRegistrationInfo( NetworkRegistrationInfo regInfo = getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (regState == null) { regState = new NetworkRegistrationInfo.Builder() if (regInfo == null) { regInfo = new NetworkRegistrationInfo.Builder() .setDomain(NetworkRegistrationInfo.DOMAIN_CS) .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .build(); addNetworkRegistrationInfo(regState); } regState.setRoamingType(type); regInfo.setRoamingType(type); addNetworkRegistrationInfo(regInfo); } /** @hide */ Loading @@ -1151,16 +1151,16 @@ public class ServiceState implements Parcelable { /** @hide */ @TestApi public void setDataRoamingType(@RoamingType int type) { NetworkRegistrationInfo regState = getNetworkRegistrationInfo( NetworkRegistrationInfo regInfo = getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (regState == null) { regState = new NetworkRegistrationInfo.Builder() if (regInfo == null) { regInfo = new NetworkRegistrationInfo.Builder() .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .build(); addNetworkRegistrationInfo(regState); } regState.setRoamingType(type); regInfo.setRoamingType(type); addNetworkRegistrationInfo(regInfo); } /** Loading Loading @@ -1324,16 +1324,16 @@ public class ServiceState implements Parcelable { Rlog.e(LOG_TAG, "ServiceState.setRilVoiceRadioTechnology() called. It's encouraged to " + "use addNetworkRegistrationInfo() instead *******"); // Sync to network registration state NetworkRegistrationInfo regState = getNetworkRegistrationInfo( NetworkRegistrationInfo regInfo = getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (regState == null) { regState = new NetworkRegistrationInfo.Builder() if (regInfo == null) { regInfo = new NetworkRegistrationInfo.Builder() .setDomain(NetworkRegistrationInfo.DOMAIN_CS) .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .build(); addNetworkRegistrationInfo(regState); } regState.setAccessNetworkTechnology(rilRadioTechnologyToNetworkType(rt)); regInfo.setAccessNetworkTechnology(rilRadioTechnologyToNetworkType(rt)); addNetworkRegistrationInfo(regInfo); } Loading @@ -1345,17 +1345,17 @@ public class ServiceState implements Parcelable { // Sync to network registration state. Always write down the WWAN transport. For AP-assisted // mode device, use addNetworkRegistrationInfo() to set the correct transport if RAT // is IWLAN. NetworkRegistrationInfo regState = getNetworkRegistrationInfo( NetworkRegistrationInfo regInfo = getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (regState == null) { regState = new NetworkRegistrationInfo.Builder() if (regInfo == null) { regInfo = new NetworkRegistrationInfo.Builder() .setDomain(NetworkRegistrationInfo.DOMAIN_PS) .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) .build(); addNetworkRegistrationInfo(regState); } regState.setAccessNetworkTechnology(rilRadioTechnologyToNetworkType(rt)); regInfo.setAccessNetworkTechnology(rilRadioTechnologyToNetworkType(rt)); addNetworkRegistrationInfo(regInfo); } /** @hide */ Loading Loading @@ -1397,10 +1397,10 @@ public class ServiceState implements Parcelable { * @hide */ public @NRState int getNrState() { final NetworkRegistrationInfo regState = getNetworkRegistrationInfo( final NetworkRegistrationInfo regInfo = getNetworkRegistrationInfo( NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (regState == null) return NetworkRegistrationInfo.NR_STATE_NONE; return regState.getNrState(); if (regInfo == null) return NetworkRegistrationInfo.NR_STATE_NONE; return regInfo.getNrState(); } /** Loading Loading @@ -1794,7 +1794,11 @@ public class ServiceState implements Parcelable { @SystemApi public List<NetworkRegistrationInfo> getNetworkRegistrationInfoList() { synchronized (mNetworkRegistrationInfos) { return new ArrayList<>(mNetworkRegistrationInfos); List<NetworkRegistrationInfo> newList = new ArrayList<>(); for (NetworkRegistrationInfo nri : mNetworkRegistrationInfos) { newList.add(new NetworkRegistrationInfo(nri)); } return newList; } } Loading @@ -1814,7 +1818,7 @@ public class ServiceState implements Parcelable { synchronized (mNetworkRegistrationInfos) { for (NetworkRegistrationInfo networkRegistrationInfo : mNetworkRegistrationInfos) { if (networkRegistrationInfo.getTransportType() == transportType) { list.add(networkRegistrationInfo); list.add(new NetworkRegistrationInfo(networkRegistrationInfo)); } } } Loading @@ -1838,7 +1842,7 @@ public class ServiceState implements Parcelable { synchronized (mNetworkRegistrationInfos) { for (NetworkRegistrationInfo networkRegistrationInfo : mNetworkRegistrationInfos) { if (networkRegistrationInfo.getDomain() == domain) { list.add(networkRegistrationInfo); list.add(new NetworkRegistrationInfo(networkRegistrationInfo)); } } } Loading @@ -1863,7 +1867,7 @@ public class ServiceState implements Parcelable { for (NetworkRegistrationInfo networkRegistrationInfo : mNetworkRegistrationInfos) { if (networkRegistrationInfo.getTransportType() == transportType && networkRegistrationInfo.getDomain() == domain) { return networkRegistrationInfo; return new NetworkRegistrationInfo(networkRegistrationInfo); } } } Loading @@ -1875,20 +1879,20 @@ public class ServiceState implements Parcelable { * @hide */ @TestApi public void addNetworkRegistrationInfo(NetworkRegistrationInfo regState) { if (regState == null) return; public void addNetworkRegistrationInfo(NetworkRegistrationInfo nri) { if (nri == null) return; synchronized (mNetworkRegistrationInfos) { for (int i = 0; i < mNetworkRegistrationInfos.size(); i++) { NetworkRegistrationInfo curRegState = mNetworkRegistrationInfos.get(i); if (curRegState.getTransportType() == regState.getTransportType() && curRegState.getDomain() == regState.getDomain()) { if (curRegState.getTransportType() == nri.getTransportType() && curRegState.getDomain() == nri.getDomain()) { mNetworkRegistrationInfos.remove(i); break; } } mNetworkRegistrationInfos.add(regState); mNetworkRegistrationInfos.add(new NetworkRegistrationInfo(nri)); } } Loading
telephony/java/android/telephony/VoiceSpecificRegistrationInfo.java +13 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,19 @@ public class VoiceSpecificRegistrationInfo implements Parcelable{ this.defaultRoamingIndicator = defaultRoamingIndicator; } /** * Constructor from another voice specific registration info * * @param vsri another voice specific registration info * @hide */ VoiceSpecificRegistrationInfo(VoiceSpecificRegistrationInfo vsri) { cssSupported = vsri.cssSupported; roamingIndicator = vsri.roamingIndicator; systemIsInPrl = vsri.systemIsInPrl; defaultRoamingIndicator = vsri.defaultRoamingIndicator; } private VoiceSpecificRegistrationInfo(Parcel source) { this.cssSupported = source.readBoolean(); this.roamingIndicator = source.readInt(); Loading