Merge "Migrate LTE_CA flag to NRI from DSRI"
This commit is contained in:
@@ -72,28 +72,20 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
/**
|
||||
* Provides network support info for LTE VoPS and LTE Emergency bearer support
|
||||
*/
|
||||
@Nullable
|
||||
private final LteVopsSupportInfo mLteVopsSupportInfo;
|
||||
|
||||
/**
|
||||
* Indicates if it's using carrier aggregation
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public boolean mIsUsingCarrierAggregation;
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
DataSpecificRegistrationInfo(
|
||||
int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable,
|
||||
boolean isEnDcAvailable, LteVopsSupportInfo lteVops,
|
||||
boolean isUsingCarrierAggregation) {
|
||||
boolean isEnDcAvailable, @Nullable LteVopsSupportInfo lteVops) {
|
||||
this.maxDataCalls = maxDataCalls;
|
||||
this.isDcNrRestricted = isDcNrRestricted;
|
||||
this.isNrAvailable = isNrAvailable;
|
||||
this.isEnDcAvailable = isEnDcAvailable;
|
||||
this.mLteVopsSupportInfo = lteVops;
|
||||
this.mIsUsingCarrierAggregation = isUsingCarrierAggregation;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,32 +94,29 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
* @param dsri another data specific registration info
|
||||
* @hide
|
||||
*/
|
||||
DataSpecificRegistrationInfo(DataSpecificRegistrationInfo dsri) {
|
||||
DataSpecificRegistrationInfo(@NonNull DataSpecificRegistrationInfo dsri) {
|
||||
maxDataCalls = dsri.maxDataCalls;
|
||||
isDcNrRestricted = dsri.isDcNrRestricted;
|
||||
isNrAvailable = dsri.isNrAvailable;
|
||||
isEnDcAvailable = dsri.isEnDcAvailable;
|
||||
mLteVopsSupportInfo = dsri.mLteVopsSupportInfo;
|
||||
mIsUsingCarrierAggregation = dsri.mIsUsingCarrierAggregation;
|
||||
}
|
||||
|
||||
private DataSpecificRegistrationInfo(Parcel source) {
|
||||
private DataSpecificRegistrationInfo(/* @NonNull */ Parcel source) {
|
||||
maxDataCalls = source.readInt();
|
||||
isDcNrRestricted = source.readBoolean();
|
||||
isNrAvailable = source.readBoolean();
|
||||
isEnDcAvailable = source.readBoolean();
|
||||
mLteVopsSupportInfo = LteVopsSupportInfo.CREATOR.createFromParcel(source);
|
||||
mIsUsingCarrierAggregation = source.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
public void writeToParcel(/* @NonNull */ Parcel dest, int flags) {
|
||||
dest.writeInt(maxDataCalls);
|
||||
dest.writeBoolean(isDcNrRestricted);
|
||||
dest.writeBoolean(isNrAvailable);
|
||||
dest.writeBoolean(isEnDcAvailable);
|
||||
mLteVopsSupportInfo.writeToParcel(dest, flags);
|
||||
dest.writeBoolean(mIsUsingCarrierAggregation);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -144,8 +133,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
.append(" isDcNrRestricted = " + isDcNrRestricted)
|
||||
.append(" isNrAvailable = " + isNrAvailable)
|
||||
.append(" isEnDcAvailable = " + isEnDcAvailable)
|
||||
.append(" " + mLteVopsSupportInfo.toString())
|
||||
.append(" mIsUsingCarrierAggregation = " + mIsUsingCarrierAggregation)
|
||||
.append(" " + mLteVopsSupportInfo)
|
||||
.append(" }")
|
||||
.toString();
|
||||
}
|
||||
@@ -153,7 +141,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable, isEnDcAvailable,
|
||||
mLteVopsSupportInfo, mIsUsingCarrierAggregation);
|
||||
mLteVopsSupportInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -167,8 +155,7 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
&& this.isDcNrRestricted == other.isDcNrRestricted
|
||||
&& this.isNrAvailable == other.isNrAvailable
|
||||
&& this.isEnDcAvailable == other.isEnDcAvailable
|
||||
&& this.mLteVopsSupportInfo.equals(other.mLteVopsSupportInfo)
|
||||
&& this.mIsUsingCarrierAggregation == other.mIsUsingCarrierAggregation;
|
||||
&& Objects.equals(mLteVopsSupportInfo, other.mLteVopsSupportInfo);
|
||||
}
|
||||
|
||||
public static final @NonNull Parcelable.Creator<DataSpecificRegistrationInfo> CREATOR =
|
||||
@@ -192,23 +179,4 @@ public final class DataSpecificRegistrationInfo implements Parcelable {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,6 +218,9 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
||||
@NonNull
|
||||
private String mRplmn;
|
||||
|
||||
// Updated based on the accessNetworkTechnology
|
||||
private boolean mIsUsingCarrierAggregation;
|
||||
|
||||
/**
|
||||
* @param domain Network domain. Must be a {@link Domain}. For transport type
|
||||
* {@link AccessNetworkConstants#TRANSPORT_TYPE_WLAN}, this must set to {@link #DOMAIN_PS}.
|
||||
@@ -251,7 +254,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
||||
mRegistrationState = registrationState;
|
||||
mRoamingType = (registrationState == REGISTRATION_STATE_ROAMING)
|
||||
? ServiceState.ROAMING_TYPE_UNKNOWN : ServiceState.ROAMING_TYPE_NOT_ROAMING;
|
||||
mAccessNetworkTechnology = accessNetworkTechnology;
|
||||
setAccessNetworkTechnology(accessNetworkTechnology);
|
||||
mRejectCause = rejectCause;
|
||||
mAvailableServices = (availableServices != null)
|
||||
? new ArrayList<>(availableServices) : new ArrayList<>();
|
||||
@@ -290,13 +293,11 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
||||
@Nullable CellIdentity cellIdentity, @Nullable String rplmn,
|
||||
int maxDataCalls, boolean isDcNrRestricted,
|
||||
boolean isNrAvailable, boolean isEndcAvailable,
|
||||
LteVopsSupportInfo lteVopsSupportInfo,
|
||||
boolean isUsingCarrierAggregation) {
|
||||
LteVopsSupportInfo lteVopsSupportInfo) {
|
||||
this(domain, transportType, registrationState, accessNetworkTechnology, rejectCause,
|
||||
emergencyOnly, availableServices, cellIdentity, rplmn);
|
||||
mDataSpecificInfo = new DataSpecificRegistrationInfo(
|
||||
maxDataCalls, isDcNrRestricted, isNrAvailable, isEndcAvailable, lteVopsSupportInfo,
|
||||
isUsingCarrierAggregation);
|
||||
maxDataCalls, isDcNrRestricted, isNrAvailable, isEndcAvailable, lteVopsSupportInfo);
|
||||
updateNrState();
|
||||
}
|
||||
|
||||
@@ -317,6 +318,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
||||
DataSpecificRegistrationInfo.class.getClassLoader());
|
||||
mNrState = source.readInt();
|
||||
mRplmn = source.readString();
|
||||
mIsUsingCarrierAggregation = source.readBoolean();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -331,6 +333,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
||||
mRegistrationState = nri.mRegistrationState;
|
||||
mRoamingType = nri.mRoamingType;
|
||||
mAccessNetworkTechnology = nri.mAccessNetworkTechnology;
|
||||
mIsUsingCarrierAggregation = nri.mIsUsingCarrierAggregation;
|
||||
mRejectCause = nri.mRejectCause;
|
||||
mEmergencyOnly = nri.mEmergencyOnly;
|
||||
mAvailableServices = new ArrayList<>(nri.mAvailableServices);
|
||||
@@ -484,9 +487,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
||||
if (tech == TelephonyManager.NETWORK_TYPE_LTE_CA) {
|
||||
// For old device backward compatibility support
|
||||
tech = TelephonyManager.NETWORK_TYPE_LTE;
|
||||
if (mDataSpecificInfo != null) {
|
||||
mDataSpecificInfo.setIsUsingCarrierAggregation(true);
|
||||
}
|
||||
mIsUsingCarrierAggregation = true;
|
||||
}
|
||||
mAccessNetworkTechnology = tech;
|
||||
}
|
||||
@@ -510,6 +511,27 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
||||
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
|
||||
*/
|
||||
@@ -616,6 +638,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
||||
.append(" dataSpecificInfo=").append(mDataSpecificInfo)
|
||||
.append(" nrState=").append(nrStateToString(mNrState))
|
||||
.append(" rRplmn=").append(mRplmn)
|
||||
.append(" isUsingCarrierAggregation=").append(mIsUsingCarrierAggregation)
|
||||
.append("}").toString();
|
||||
}
|
||||
|
||||
@@ -623,7 +646,8 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
||||
public int hashCode() {
|
||||
return Objects.hash(mDomain, mTransportType, mRegistrationState, mRoamingType,
|
||||
mAccessNetworkTechnology, mRejectCause, mEmergencyOnly, mAvailableServices,
|
||||
mCellIdentity, mVoiceSpecificInfo, mDataSpecificInfo, mNrState, mRplmn);
|
||||
mCellIdentity, mVoiceSpecificInfo, mDataSpecificInfo, mNrState, mRplmn,
|
||||
mIsUsingCarrierAggregation);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -643,6 +667,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
||||
&& mRejectCause == other.mRejectCause
|
||||
&& mEmergencyOnly == other.mEmergencyOnly
|
||||
&& mAvailableServices.equals(other.mAvailableServices)
|
||||
&& mIsUsingCarrierAggregation == other.mIsUsingCarrierAggregation
|
||||
&& Objects.equals(mCellIdentity, other.mCellIdentity)
|
||||
&& Objects.equals(mVoiceSpecificInfo, other.mVoiceSpecificInfo)
|
||||
&& Objects.equals(mDataSpecificInfo, other.mDataSpecificInfo)
|
||||
@@ -669,6 +694,7 @@ public final class NetworkRegistrationInfo implements Parcelable {
|
||||
dest.writeParcelable(mDataSpecificInfo, 0);
|
||||
dest.writeInt(mNrState);
|
||||
dest.writeString(mRplmn);
|
||||
dest.writeBoolean(mIsUsingCarrierAggregation);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1392,29 +1392,14 @@ public class ServiceState implements Parcelable {
|
||||
|
||||
/** @hide */
|
||||
public boolean isUsingCarrierAggregation() {
|
||||
boolean isUsingCa = false;
|
||||
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;
|
||||
}
|
||||
if (getCellBandwidths().length > 1) return true;
|
||||
|
||||
/** @hide */
|
||||
public void setIsUsingCarrierAggregation(boolean ca) {
|
||||
NetworkRegistrationInfo nri = getNetworkRegistrationInfo(
|
||||
NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
|
||||
if (nri != null) {
|
||||
DataSpecificRegistrationInfo dsri = nri.getDataSpecificInfo();
|
||||
if (dsri != null) {
|
||||
dsri.setIsUsingCarrierAggregation(ca);
|
||||
addNetworkRegistrationInfo(nri);
|
||||
synchronized (mNetworkRegistrationInfos) {
|
||||
for (NetworkRegistrationInfo nri : mNetworkRegistrationInfos) {
|
||||
if (nri.isUsingCarrierAggregation()) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user