• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.telephony;
18 
19 import android.annotation.NonNull;
20 import android.annotation.SystemApi;
21 import android.annotation.TestApi;
22 import android.os.Parcel;
23 import android.os.Parcelable;
24 
25 import java.util.Objects;
26 
27 
28 /**
29  * Class that stores information specific to data network registration.
30  * @hide
31  */
32 @SystemApi
33 @TestApi
34 public final class DataSpecificRegistrationInfo implements Parcelable {
35     /**
36      * @hide
37      * The maximum number of simultaneous Data Calls that
38      * must be established using setupDataCall().
39      */
40     public final int maxDataCalls;
41 
42     /**
43      * @hide
44      * Indicates if the use of dual connectivity with NR is restricted.
45      * Reference: 3GPP TS 24.301 v15.03 section 9.3.3.12A.
46      */
47     public final boolean isDcNrRestricted;
48 
49     /**
50      * Indicates if NR is supported by the selected PLMN.
51      * @hide
52      * {@code true} if the bit N is in the PLMN-InfoList-r15 is true and the selected PLMN is
53      * present in plmn-IdentityList at position N.
54      * Reference: 3GPP TS 36.331 v15.2.2 section 6.3.1 PLMN-InfoList-r15.
55      *            3GPP TS 36.331 v15.2.2 section 6.2.2 SystemInformationBlockType1 message.
56      */
57     public final boolean isNrAvailable;
58 
59     /**
60      * @hide
61      * Indicates that if E-UTRA-NR Dual Connectivity (EN-DC) is supported by the primary serving
62      * cell.
63      *
64      * True the primary serving cell is LTE cell and the plmn-InfoList-r15 is present in SIB2 and
65      * at least one bit in this list is true, otherwise this value should be false.
66      *
67      * Reference: 3GPP TS 36.331 v15.2.2 6.3.1 System information blocks.
68      */
69     public final boolean isEnDcAvailable;
70 
71     /**
72      * Provides network support info for LTE VoPS and LTE Emergency bearer support
73      */
74     private final LteVopsSupportInfo mLteVopsSupportInfo;
75 
76     /**
77      * Indicates if it's using carrier aggregation
78      *
79      * @hide
80      */
81     public boolean mIsUsingCarrierAggregation;
82 
83     /**
84      * @hide
85      */
DataSpecificRegistrationInfo( int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable, boolean isEnDcAvailable, LteVopsSupportInfo lteVops, boolean isUsingCarrierAggregation)86     DataSpecificRegistrationInfo(
87             int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable,
88             boolean isEnDcAvailable, LteVopsSupportInfo lteVops,
89             boolean isUsingCarrierAggregation) {
90         this.maxDataCalls = maxDataCalls;
91         this.isDcNrRestricted = isDcNrRestricted;
92         this.isNrAvailable = isNrAvailable;
93         this.isEnDcAvailable = isEnDcAvailable;
94         this.mLteVopsSupportInfo = lteVops;
95         this.mIsUsingCarrierAggregation = isUsingCarrierAggregation;
96     }
97 
98     /**
99      * Constructor from another data specific registration info
100      *
101      * @param dsri another data specific registration info
102      * @hide
103      */
DataSpecificRegistrationInfo(DataSpecificRegistrationInfo dsri)104     DataSpecificRegistrationInfo(DataSpecificRegistrationInfo dsri) {
105         maxDataCalls = dsri.maxDataCalls;
106         isDcNrRestricted = dsri.isDcNrRestricted;
107         isNrAvailable = dsri.isNrAvailable;
108         isEnDcAvailable = dsri.isEnDcAvailable;
109         mLteVopsSupportInfo = dsri.mLteVopsSupportInfo;
110         mIsUsingCarrierAggregation = dsri.mIsUsingCarrierAggregation;
111     }
112 
DataSpecificRegistrationInfo(Parcel source)113     private DataSpecificRegistrationInfo(Parcel source) {
114         maxDataCalls = source.readInt();
115         isDcNrRestricted = source.readBoolean();
116         isNrAvailable = source.readBoolean();
117         isEnDcAvailable = source.readBoolean();
118         mLteVopsSupportInfo = LteVopsSupportInfo.CREATOR.createFromParcel(source);
119         mIsUsingCarrierAggregation = source.readBoolean();
120     }
121 
122     @Override
writeToParcel(Parcel dest, int flags)123     public void writeToParcel(Parcel dest, int flags) {
124         dest.writeInt(maxDataCalls);
125         dest.writeBoolean(isDcNrRestricted);
126         dest.writeBoolean(isNrAvailable);
127         dest.writeBoolean(isEnDcAvailable);
128         mLteVopsSupportInfo.writeToParcel(dest, flags);
129         dest.writeBoolean(mIsUsingCarrierAggregation);
130     }
131 
132     @Override
describeContents()133     public int describeContents() {
134         return 0;
135     }
136 
137     @Override
toString()138     public String toString() {
139         return new StringBuilder().append(this.getClass().getName())
140                 .append(" :{")
141                 .append(" maxDataCalls = " + maxDataCalls)
142                 .append(" isDcNrRestricted = " + isDcNrRestricted)
143                 .append(" isNrAvailable = " + isNrAvailable)
144                 .append(" isEnDcAvailable = " + isEnDcAvailable)
145                 .append(" " + mLteVopsSupportInfo.toString())
146                 .append(" mIsUsingCarrierAggregation = " + mIsUsingCarrierAggregation)
147                 .append(" }")
148                 .toString();
149     }
150 
151     @Override
hashCode()152     public int hashCode() {
153         return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable, isEnDcAvailable,
154                 mLteVopsSupportInfo, mIsUsingCarrierAggregation);
155     }
156 
157     @Override
equals(Object o)158     public boolean equals(Object o) {
159         if (this == o) return true;
160 
161         if (!(o instanceof DataSpecificRegistrationInfo)) return false;
162 
163         DataSpecificRegistrationInfo other = (DataSpecificRegistrationInfo) o;
164         return this.maxDataCalls == other.maxDataCalls
165                 && this.isDcNrRestricted == other.isDcNrRestricted
166                 && this.isNrAvailable == other.isNrAvailable
167                 && this.isEnDcAvailable == other.isEnDcAvailable
168                 && this.mLteVopsSupportInfo.equals(other.mLteVopsSupportInfo)
169                 && this.mIsUsingCarrierAggregation == other.mIsUsingCarrierAggregation;
170     }
171 
172     public static final @NonNull Parcelable.Creator<DataSpecificRegistrationInfo> CREATOR =
173             new Parcelable.Creator<DataSpecificRegistrationInfo>() {
174                 @Override
175                 public DataSpecificRegistrationInfo createFromParcel(Parcel source) {
176                     return new DataSpecificRegistrationInfo(source);
177                 }
178 
179                 @Override
180                 public DataSpecificRegistrationInfo[] newArray(int size) {
181                     return new DataSpecificRegistrationInfo[size];
182                 }
183             };
184 
185     /**
186      * @return The LTE VOPS (Voice over Packet Switched) support information
187      */
188     @NonNull
getLteVopsSupportInfo()189     public LteVopsSupportInfo getLteVopsSupportInfo() {
190         return mLteVopsSupportInfo;
191     }
192 
193     /**
194      * Set the flag indicating if using carrier aggregation.
195      *
196      * @param isUsingCarrierAggregation {@code true} if using carrier aggregation.
197      * @hide
198      */
setIsUsingCarrierAggregation(boolean isUsingCarrierAggregation)199     public void setIsUsingCarrierAggregation(boolean isUsingCarrierAggregation) {
200         mIsUsingCarrierAggregation = isUsingCarrierAggregation;
201     }
202 
203     /**
204      * @return {@code true} if using carrier aggregation.
205      * @hide
206      */
isUsingCarrierAggregation()207     public boolean isUsingCarrierAggregation() {
208         return mIsUsingCarrierAggregation;
209     }
210 }
211