Merge "Modify constructor of NetworkRegistrationState"
am: 61c09d128b
Change-Id: I0b68c4cec94e5bd357871c864e42fbc3f44c39d0
This commit is contained in:
@@ -33,17 +33,31 @@ public class DataSpecificRegistrationStates implements Parcelable{
|
|||||||
*/
|
*/
|
||||||
public final boolean isNrAvailable;
|
public final boolean isNrAvailable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates that if E-UTRA-NR Dual Connectivity (EN-DC) is supported by the primary serving
|
||||||
|
* cell.
|
||||||
|
*
|
||||||
|
* True the primary serving cell is LTE cell and the plmn-InfoList-r15 is present in SIB2 and
|
||||||
|
* at least one bit in this list is true, otherwise this value should be false.
|
||||||
|
*
|
||||||
|
* Reference: 3GPP TS 36.331 v15.2.2 6.3.1 System information blocks.
|
||||||
|
*/
|
||||||
|
public final boolean isEnDcAvailable;
|
||||||
|
|
||||||
DataSpecificRegistrationStates(
|
DataSpecificRegistrationStates(
|
||||||
int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable) {
|
int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable,
|
||||||
|
boolean isEnDcAvailable) {
|
||||||
this.maxDataCalls = maxDataCalls;
|
this.maxDataCalls = maxDataCalls;
|
||||||
this.isDcNrRestricted = isDcNrRestricted;
|
this.isDcNrRestricted = isDcNrRestricted;
|
||||||
this.isNrAvailable = isNrAvailable;
|
this.isNrAvailable = isNrAvailable;
|
||||||
|
this.isEnDcAvailable = isEnDcAvailable;
|
||||||
}
|
}
|
||||||
|
|
||||||
private DataSpecificRegistrationStates(Parcel source) {
|
private DataSpecificRegistrationStates(Parcel source) {
|
||||||
maxDataCalls = source.readInt();
|
maxDataCalls = source.readInt();
|
||||||
isDcNrRestricted = source.readBoolean();
|
isDcNrRestricted = source.readBoolean();
|
||||||
isNrAvailable = source.readBoolean();
|
isNrAvailable = source.readBoolean();
|
||||||
|
isEnDcAvailable = source.readBoolean();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -51,6 +65,7 @@ public class DataSpecificRegistrationStates implements Parcelable{
|
|||||||
dest.writeInt(maxDataCalls);
|
dest.writeInt(maxDataCalls);
|
||||||
dest.writeBoolean(isDcNrRestricted);
|
dest.writeBoolean(isDcNrRestricted);
|
||||||
dest.writeBoolean(isNrAvailable);
|
dest.writeBoolean(isNrAvailable);
|
||||||
|
dest.writeBoolean(isEnDcAvailable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -65,13 +80,14 @@ public class DataSpecificRegistrationStates implements Parcelable{
|
|||||||
.append(" maxDataCalls = " + maxDataCalls)
|
.append(" maxDataCalls = " + maxDataCalls)
|
||||||
.append(" isDcNrRestricted = " + isDcNrRestricted)
|
.append(" isDcNrRestricted = " + isDcNrRestricted)
|
||||||
.append(" isNrAvailable = " + isNrAvailable)
|
.append(" isNrAvailable = " + isNrAvailable)
|
||||||
|
.append(" isEnDcAvailable = " + isEnDcAvailable)
|
||||||
.append(" }")
|
.append(" }")
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable);
|
return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable, isEnDcAvailable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -83,7 +99,8 @@ public class DataSpecificRegistrationStates implements Parcelable{
|
|||||||
DataSpecificRegistrationStates other = (DataSpecificRegistrationStates) o;
|
DataSpecificRegistrationStates other = (DataSpecificRegistrationStates) o;
|
||||||
return this.maxDataCalls == other.maxDataCalls
|
return this.maxDataCalls == other.maxDataCalls
|
||||||
&& this.isDcNrRestricted == other.isDcNrRestricted
|
&& this.isDcNrRestricted == other.isDcNrRestricted
|
||||||
&& this.isNrAvailable == other.isNrAvailable;
|
&& this.isNrAvailable == other.isNrAvailable
|
||||||
|
&& this.isEnDcAvailable == other.isEnDcAvailable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Parcelable.Creator<DataSpecificRegistrationStates> CREATOR =
|
public static final Parcelable.Creator<DataSpecificRegistrationStates> CREATOR =
|
||||||
|
|||||||
@@ -219,12 +219,13 @@ public class NetworkRegistrationState implements Parcelable {
|
|||||||
public NetworkRegistrationState(int domain, int transportType, int regState,
|
public NetworkRegistrationState(int domain, int transportType, int regState,
|
||||||
int accessNetworkTechnology, int rejectCause, boolean emergencyOnly,
|
int accessNetworkTechnology, int rejectCause, boolean emergencyOnly,
|
||||||
int[] availableServices, @Nullable CellIdentity cellIdentity, int maxDataCalls,
|
int[] availableServices, @Nullable CellIdentity cellIdentity, int maxDataCalls,
|
||||||
boolean isDcNrRestricted, boolean isNrAvailable) {
|
boolean isDcNrRestricted, boolean isNrAvailable, boolean isEndcAvailable) {
|
||||||
this(domain, transportType, regState, accessNetworkTechnology, rejectCause, emergencyOnly,
|
this(domain, transportType, regState, accessNetworkTechnology, rejectCause, emergencyOnly,
|
||||||
availableServices, cellIdentity);
|
availableServices, cellIdentity);
|
||||||
|
|
||||||
mDataSpecificStates = new DataSpecificRegistrationStates(
|
mDataSpecificStates = new DataSpecificRegistrationStates(
|
||||||
maxDataCalls, isDcNrRestricted, isNrAvailable);
|
maxDataCalls, isDcNrRestricted, isNrAvailable, isEndcAvailable);
|
||||||
|
updateNrStatus(mDataSpecificStates);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected NetworkRegistrationState(Parcel source) {
|
protected NetworkRegistrationState(Parcel source) {
|
||||||
@@ -448,6 +449,34 @@ public class NetworkRegistrationState implements Parcelable {
|
|||||||
dest.writeInt(mNrStatus);
|
dest.writeInt(mNrStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use the 5G NR Non-Standalone indicators from the network registration state to update the
|
||||||
|
* NR status. There are 3 indicators in the network registration state:
|
||||||
|
*
|
||||||
|
* 1. if E-UTRA-NR Dual Connectivity (EN-DC) is supported by the primary serving cell.
|
||||||
|
* 2. if NR is supported by the selected PLMN.
|
||||||
|
* 3. if the use of dual connectivity with NR is restricted.
|
||||||
|
*
|
||||||
|
* The network has 5G NR capability if E-UTRA-NR Dual Connectivity is supported by the primary
|
||||||
|
* serving cell.
|
||||||
|
*
|
||||||
|
* The use of NR 5G is not restricted If the network has 5G NR capability and both the use of
|
||||||
|
* DCNR is not restricted and NR is supported by the selected PLMN. Otherwise the use of 5G
|
||||||
|
* NR is restricted.
|
||||||
|
*
|
||||||
|
* @param state data specific registration state contains the 5G NR indicators.
|
||||||
|
*/
|
||||||
|
private void updateNrStatus(DataSpecificRegistrationStates state) {
|
||||||
|
mNrStatus = NR_STATUS_NONE;
|
||||||
|
if (state.isEnDcAvailable) {
|
||||||
|
if (!state.isDcNrRestricted && state.isNrAvailable) {
|
||||||
|
mNrStatus = NR_STATUS_NOT_RESTRICTED;
|
||||||
|
} else {
|
||||||
|
mNrStatus = NR_STATUS_RESTRICTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static final Parcelable.Creator<NetworkRegistrationState> CREATOR =
|
public static final Parcelable.Creator<NetworkRegistrationState> CREATOR =
|
||||||
new Parcelable.Creator<NetworkRegistrationState>() {
|
new Parcelable.Creator<NetworkRegistrationState>() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user