Merge "Migrate LTE_CA flag to NRI from DSRI"

This commit is contained in:
Nathan Harold
2020-07-16 16:59:34 +00:00
committed by Gerrit Code Review
3 changed files with 48 additions and 69 deletions

View File

@@ -72,28 +72,20 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
/** /**
* Provides network support info for LTE VoPS and LTE Emergency bearer support * Provides network support info for LTE VoPS and LTE Emergency bearer support
*/ */
@Nullable
private final LteVopsSupportInfo mLteVopsSupportInfo; private final LteVopsSupportInfo mLteVopsSupportInfo;
/**
* Indicates if it's using carrier aggregation
*
* @hide
*/
public boolean mIsUsingCarrierAggregation;
/** /**
* @hide * @hide
*/ */
DataSpecificRegistrationInfo( DataSpecificRegistrationInfo(
int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable, int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable,
boolean isEnDcAvailable, LteVopsSupportInfo lteVops, boolean isEnDcAvailable, @Nullable LteVopsSupportInfo lteVops) {
boolean isUsingCarrierAggregation) {
this.maxDataCalls = maxDataCalls; this.maxDataCalls = maxDataCalls;
this.isDcNrRestricted = isDcNrRestricted; this.isDcNrRestricted = isDcNrRestricted;
this.isNrAvailable = isNrAvailable; this.isNrAvailable = isNrAvailable;
this.isEnDcAvailable = isEnDcAvailable; this.isEnDcAvailable = isEnDcAvailable;
this.mLteVopsSupportInfo = lteVops; this.mLteVopsSupportInfo = lteVops;
this.mIsUsingCarrierAggregation = isUsingCarrierAggregation;
} }
/** /**
@@ -102,32 +94,29 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
* @param dsri another data specific registration info * @param dsri another data specific registration info
* @hide * @hide
*/ */
DataSpecificRegistrationInfo(DataSpecificRegistrationInfo dsri) { DataSpecificRegistrationInfo(@NonNull DataSpecificRegistrationInfo dsri) {
maxDataCalls = dsri.maxDataCalls; maxDataCalls = dsri.maxDataCalls;
isDcNrRestricted = dsri.isDcNrRestricted; isDcNrRestricted = dsri.isDcNrRestricted;
isNrAvailable = dsri.isNrAvailable; isNrAvailable = dsri.isNrAvailable;
isEnDcAvailable = dsri.isEnDcAvailable; isEnDcAvailable = dsri.isEnDcAvailable;
mLteVopsSupportInfo = dsri.mLteVopsSupportInfo; mLteVopsSupportInfo = dsri.mLteVopsSupportInfo;
mIsUsingCarrierAggregation = dsri.mIsUsingCarrierAggregation;
} }
private DataSpecificRegistrationInfo(Parcel source) { private DataSpecificRegistrationInfo(/* @NonNull */ Parcel source) {
maxDataCalls = source.readInt(); maxDataCalls = source.readInt();
isDcNrRestricted = source.readBoolean(); isDcNrRestricted = source.readBoolean();
isNrAvailable = source.readBoolean(); isNrAvailable = source.readBoolean();
isEnDcAvailable = source.readBoolean(); isEnDcAvailable = source.readBoolean();
mLteVopsSupportInfo = LteVopsSupportInfo.CREATOR.createFromParcel(source); mLteVopsSupportInfo = LteVopsSupportInfo.CREATOR.createFromParcel(source);
mIsUsingCarrierAggregation = source.readBoolean();
} }
@Override @Override
public void writeToParcel(Parcel dest, int flags) { public void writeToParcel(/* @NonNull */ Parcel dest, int flags) {
dest.writeInt(maxDataCalls); dest.writeInt(maxDataCalls);
dest.writeBoolean(isDcNrRestricted); dest.writeBoolean(isDcNrRestricted);
dest.writeBoolean(isNrAvailable); dest.writeBoolean(isNrAvailable);
dest.writeBoolean(isEnDcAvailable); dest.writeBoolean(isEnDcAvailable);
mLteVopsSupportInfo.writeToParcel(dest, flags); mLteVopsSupportInfo.writeToParcel(dest, flags);
dest.writeBoolean(mIsUsingCarrierAggregation);
} }
@Override @Override
@@ -144,8 +133,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
.append(" isDcNrRestricted = " + isDcNrRestricted) .append(" isDcNrRestricted = " + isDcNrRestricted)
.append(" isNrAvailable = " + isNrAvailable) .append(" isNrAvailable = " + isNrAvailable)
.append(" isEnDcAvailable = " + isEnDcAvailable) .append(" isEnDcAvailable = " + isEnDcAvailable)
.append(" " + mLteVopsSupportInfo.toString()) .append(" " + mLteVopsSupportInfo)
.append(" mIsUsingCarrierAggregation = " + mIsUsingCarrierAggregation)
.append(" }") .append(" }")
.toString(); .toString();
} }
@@ -153,7 +141,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable, isEnDcAvailable, return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable, isEnDcAvailable,
mLteVopsSupportInfo, mIsUsingCarrierAggregation); mLteVopsSupportInfo);
} }
@Override @Override
@@ -167,8 +155,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
&& this.isDcNrRestricted == other.isDcNrRestricted && this.isDcNrRestricted == other.isDcNrRestricted
&& this.isNrAvailable == other.isNrAvailable && this.isNrAvailable == other.isNrAvailable
&& this.isEnDcAvailable == other.isEnDcAvailable && this.isEnDcAvailable == other.isEnDcAvailable
&& this.mLteVopsSupportInfo.equals(other.mLteVopsSupportInfo) && Objects.equals(mLteVopsSupportInfo, other.mLteVopsSupportInfo);
&& this.mIsUsingCarrierAggregation == other.mIsUsingCarrierAggregation;
} }
public static final @NonNull Parcelable.Creator<DataSpecificRegistrationInfo> CREATOR = public static final @NonNull Parcelable.Creator<DataSpecificRegistrationInfo> CREATOR =
@@ -192,23 +179,4 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
return mLteVopsSupportInfo; return mLteVopsSupportInfo;
} }
/**
* Set the flag indicating if using carrier aggregation.
*
* @param isUsingCarrierAggregation {@code true} if using carrier aggregation.
* @hide
*/
public void setIsUsingCarrierAggregation(boolean isUsingCarrierAggregation) {
mIsUsingCarrierAggregation = isUsingCarrierAggregation;
}
/**
* Get whether network has configured carrier aggregation or not.
*
* @return {@code true} if using carrier aggregation.
* @hide
*/
public boolean isUsingCarrierAggregation() {
return mIsUsingCarrierAggregation;
}
} }

View File

@@ -218,6 +218,9 @@ public final class NetworkRegistrationInfo implements Parcelable {
@NonNull @NonNull
private String mRplmn; private String mRplmn;
// Updated based on the accessNetworkTechnology
private boolean mIsUsingCarrierAggregation;
/** /**
* @param domain Network domain. Must be a {@link Domain}. For transport type * @param domain Network domain. Must be a {@link Domain}. For transport type
* {@link AccessNetworkConstants#TRANSPORT_TYPE_WLAN}, this must set to {@link #DOMAIN_PS}. * {@link AccessNetworkConstants#TRANSPORT_TYPE_WLAN}, this must set to {@link #DOMAIN_PS}.
@@ -251,7 +254,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
mRegistrationState = registrationState; mRegistrationState = registrationState;
mRoamingType = (registrationState == REGISTRATION_STATE_ROAMING) mRoamingType = (registrationState == REGISTRATION_STATE_ROAMING)
? ServiceState.ROAMING_TYPE_UNKNOWN : ServiceState.ROAMING_TYPE_NOT_ROAMING; ? ServiceState.ROAMING_TYPE_UNKNOWN : ServiceState.ROAMING_TYPE_NOT_ROAMING;
mAccessNetworkTechnology = accessNetworkTechnology; setAccessNetworkTechnology(accessNetworkTechnology);
mRejectCause = rejectCause; mRejectCause = rejectCause;
mAvailableServices = (availableServices != null) mAvailableServices = (availableServices != null)
? new ArrayList<>(availableServices) : new ArrayList<>(); ? new ArrayList<>(availableServices) : new ArrayList<>();
@@ -290,13 +293,11 @@ public final class NetworkRegistrationInfo implements Parcelable {
@Nullable CellIdentity cellIdentity, @Nullable String rplmn, @Nullable CellIdentity cellIdentity, @Nullable String rplmn,
int maxDataCalls, boolean isDcNrRestricted, int maxDataCalls, boolean isDcNrRestricted,
boolean isNrAvailable, boolean isEndcAvailable, boolean isNrAvailable, boolean isEndcAvailable,
LteVopsSupportInfo lteVopsSupportInfo, LteVopsSupportInfo lteVopsSupportInfo) {
boolean isUsingCarrierAggregation) {
this(domain, transportType, registrationState, accessNetworkTechnology, rejectCause, this(domain, transportType, registrationState, accessNetworkTechnology, rejectCause,
emergencyOnly, availableServices, cellIdentity, rplmn); emergencyOnly, availableServices, cellIdentity, rplmn);
mDataSpecificInfo = new DataSpecificRegistrationInfo( mDataSpecificInfo = new DataSpecificRegistrationInfo(
maxDataCalls, isDcNrRestricted, isNrAvailable, isEndcAvailable, lteVopsSupportInfo, maxDataCalls, isDcNrRestricted, isNrAvailable, isEndcAvailable, lteVopsSupportInfo);
isUsingCarrierAggregation);
updateNrState(); updateNrState();
} }
@@ -317,6 +318,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
DataSpecificRegistrationInfo.class.getClassLoader()); DataSpecificRegistrationInfo.class.getClassLoader());
mNrState = source.readInt(); mNrState = source.readInt();
mRplmn = source.readString(); mRplmn = source.readString();
mIsUsingCarrierAggregation = source.readBoolean();
} }
/** /**
@@ -331,6 +333,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
mRegistrationState = nri.mRegistrationState; mRegistrationState = nri.mRegistrationState;
mRoamingType = nri.mRoamingType; mRoamingType = nri.mRoamingType;
mAccessNetworkTechnology = nri.mAccessNetworkTechnology; mAccessNetworkTechnology = nri.mAccessNetworkTechnology;
mIsUsingCarrierAggregation = nri.mIsUsingCarrierAggregation;
mRejectCause = nri.mRejectCause; mRejectCause = nri.mRejectCause;
mEmergencyOnly = nri.mEmergencyOnly; mEmergencyOnly = nri.mEmergencyOnly;
mAvailableServices = new ArrayList<>(nri.mAvailableServices); mAvailableServices = new ArrayList<>(nri.mAvailableServices);
@@ -484,9 +487,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
if (tech == TelephonyManager.NETWORK_TYPE_LTE_CA) { if (tech == TelephonyManager.NETWORK_TYPE_LTE_CA) {
// For old device backward compatibility support // For old device backward compatibility support
tech = TelephonyManager.NETWORK_TYPE_LTE; tech = TelephonyManager.NETWORK_TYPE_LTE;
if (mDataSpecificInfo != null) { mIsUsingCarrierAggregation = true;
mDataSpecificInfo.setIsUsingCarrierAggregation(true);
}
} }
mAccessNetworkTechnology = tech; mAccessNetworkTechnology = tech;
} }
@@ -510,6 +511,27 @@ public final class NetworkRegistrationInfo implements Parcelable {
return mCellIdentity; return mCellIdentity;
} }
/**
* Set whether network has configured carrier aggregation or not.
*
* @param isUsingCarrierAggregation set whether or not carrier aggregation is used.
*
* @hide
*/
public void setIsUsingCarrierAggregation(boolean isUsingCarrierAggregation) {
mIsUsingCarrierAggregation = isUsingCarrierAggregation;
}
/**
* Get whether network has configured carrier aggregation or not.
*
* @return {@code true} if using carrier aggregation.
* @hide
*/
public boolean isUsingCarrierAggregation() {
return mIsUsingCarrierAggregation;
}
/** /**
* @hide * @hide
*/ */
@@ -616,6 +638,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
.append(" dataSpecificInfo=").append(mDataSpecificInfo) .append(" dataSpecificInfo=").append(mDataSpecificInfo)
.append(" nrState=").append(nrStateToString(mNrState)) .append(" nrState=").append(nrStateToString(mNrState))
.append(" rRplmn=").append(mRplmn) .append(" rRplmn=").append(mRplmn)
.append(" isUsingCarrierAggregation=").append(mIsUsingCarrierAggregation)
.append("}").toString(); .append("}").toString();
} }
@@ -623,7 +646,8 @@ public final class NetworkRegistrationInfo implements Parcelable {
public int hashCode() { public int hashCode() {
return Objects.hash(mDomain, mTransportType, mRegistrationState, mRoamingType, return Objects.hash(mDomain, mTransportType, mRegistrationState, mRoamingType,
mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices, mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices,
mCellIdentity, mVoiceSpecificInfo, mDataSpecificInfo, mNrState, mRplmn); mCellIdentity, mVoiceSpecificInfo, mDataSpecificInfo, mNrState, mRplmn,
mIsUsingCarrierAggregation);
} }
@Override @Override
@@ -643,6 +667,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
&& mRejectCause == other.mRejectCause && mRejectCause == other.mRejectCause
&& mEmergencyOnly == other.mEmergencyOnly && mEmergencyOnly == other.mEmergencyOnly
&& mAvailableServices.equals(other.mAvailableServices) && mAvailableServices.equals(other.mAvailableServices)
&& mIsUsingCarrierAggregation == other.mIsUsingCarrierAggregation
&& Objects.equals(mCellIdentity, other.mCellIdentity) && Objects.equals(mCellIdentity, other.mCellIdentity)
&& Objects.equals(mVoiceSpecificInfo, other.mVoiceSpecificInfo) && Objects.equals(mVoiceSpecificInfo, other.mVoiceSpecificInfo)
&& Objects.equals(mDataSpecificInfo, other.mDataSpecificInfo) && Objects.equals(mDataSpecificInfo, other.mDataSpecificInfo)
@@ -669,6 +694,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
dest.writeParcelable(mDataSpecificInfo, 0); dest.writeParcelable(mDataSpecificInfo, 0);
dest.writeInt(mNrState); dest.writeInt(mNrState);
dest.writeString(mRplmn); dest.writeString(mRplmn);
dest.writeBoolean(mIsUsingCarrierAggregation);
} }
/** /**

View File

@@ -1392,29 +1392,14 @@ public class ServiceState implements Parcelable {
/** @hide */ /** @hide */
public boolean isUsingCarrierAggregation() { public boolean isUsingCarrierAggregation() {
boolean isUsingCa = false; if (getCellBandwidths().length > 1) return true;
NetworkRegistrationInfo nri = getNetworkRegistrationInfo(
NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (nri != null) {
DataSpecificRegistrationInfo dsri = nri.getDataSpecificInfo();
if (dsri != null) {
isUsingCa = dsri.isUsingCarrierAggregation();
}
}
return isUsingCa || getCellBandwidths().length > 1;
}
/** @hide */ synchronized (mNetworkRegistrationInfos) {
public void setIsUsingCarrierAggregation(boolean ca) { for (NetworkRegistrationInfo nri : mNetworkRegistrationInfos) {
NetworkRegistrationInfo nri = getNetworkRegistrationInfo( if (nri.isUsingCarrierAggregation()) return true;
NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
if (nri != null) {
DataSpecificRegistrationInfo dsri = nri.getDataSpecificInfo();
if (dsri != null) {
dsri.setIsUsingCarrierAggregation(ca);
addNetworkRegistrationInfo(nri);
} }
} }
return false;
} }
/** /**