blob: c667165e7a0e48752cc4ba0f1ff5d42e014e8779 [file] [log] [blame]
Jack Yu12a29b52019-03-21 16:33:15 -07001/*
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
Malcolm Chen4c013282018-01-24 16:27:09 -080017package android.telephony;
18
Amruth Ramachandrane4cbd112019-02-22 11:01:00 -080019import android.annotation.NonNull;
Aurimas Liutikas1da3bde2019-08-28 13:01:05 -070020import android.annotation.Nullable;
Amruth Ramachandrane4cbd112019-02-22 11:01:00 -080021import android.annotation.SystemApi;
Jack Yu12a29b52019-03-21 16:33:15 -070022import android.annotation.TestApi;
Malcolm Chen4c013282018-01-24 16:27:09 -080023import android.os.Parcel;
24import android.os.Parcelable;
25
26import java.util.Objects;
27
28
29/**
30 * Class that stores information specific to data network registration.
31 * @hide
32 */
Amruth Ramachandrane4cbd112019-02-22 11:01:00 -080033@SystemApi
Jack Yu12a29b52019-03-21 16:33:15 -070034@TestApi
35public final class DataSpecificRegistrationInfo implements Parcelable {
Malcolm Chen4c013282018-01-24 16:27:09 -080036 /**
Amruth Ramachandrane4cbd112019-02-22 11:01:00 -080037 * @hide
Malcolm Chen4c013282018-01-24 16:27:09 -080038 * The maximum number of simultaneous Data Calls that
39 * must be established using setupDataCall().
40 */
41 public final int maxDataCalls;
42
Pengquan Meng938905e2018-11-08 16:39:13 -080043 /**
Amruth Ramachandrane4cbd112019-02-22 11:01:00 -080044 * @hide
Pengquan Meng938905e2018-11-08 16:39:13 -080045 * Indicates if the use of dual connectivity with NR is restricted.
46 * Reference: 3GPP TS 24.301 v15.03 section 9.3.3.12A.
47 */
48 public final boolean isDcNrRestricted;
49
50 /**
51 * Indicates if NR is supported by the selected PLMN.
Amruth Ramachandrane4cbd112019-02-22 11:01:00 -080052 * @hide
Pengquan Meng938905e2018-11-08 16:39:13 -080053 * {@code true} if the bit N is in the PLMN-InfoList-r15 is true and the selected PLMN is
54 * present in plmn-IdentityList at position N.
55 * Reference: 3GPP TS 36.331 v15.2.2 section 6.3.1 PLMN-InfoList-r15.
56 * 3GPP TS 36.331 v15.2.2 section 6.2.2 SystemInformationBlockType1 message.
57 */
58 public final boolean isNrAvailable;
59
Pengquan Meng73596cb2018-12-03 17:45:14 -080060 /**
Amruth Ramachandrane4cbd112019-02-22 11:01:00 -080061 * @hide
Pengquan Meng73596cb2018-12-03 17:45:14 -080062 * Indicates that if E-UTRA-NR Dual Connectivity (EN-DC) is supported by the primary serving
63 * cell.
64 *
65 * True the primary serving cell is LTE cell and the plmn-InfoList-r15 is present in SIB2 and
66 * at least one bit in this list is true, otherwise this value should be false.
67 *
68 * Reference: 3GPP TS 36.331 v15.2.2 6.3.1 System information blocks.
69 */
70 public final boolean isEnDcAvailable;
71
Amruth Ramachandrana46bc5c2019-01-09 14:25:44 -080072 /**
73 * Provides network support info for LTE VoPS and LTE Emergency bearer support
74 */
Jack Yu12a29b52019-03-21 16:33:15 -070075 private final LteVopsSupportInfo mLteVopsSupportInfo;
Amruth Ramachandrana46bc5c2019-01-09 14:25:44 -080076
Amruth Ramachandrane4cbd112019-02-22 11:01:00 -080077 /**
Jack Yu27ff4072019-04-01 15:01:13 -070078 * Indicates if it's using carrier aggregation
79 *
80 * @hide
81 */
Jack Yu138e2af2019-04-02 13:14:03 -070082 public boolean mIsUsingCarrierAggregation;
Jack Yu27ff4072019-04-01 15:01:13 -070083
84 /**
Amruth Ramachandrane4cbd112019-02-22 11:01:00 -080085 * @hide
86 */
Jack Yu12a29b52019-03-21 16:33:15 -070087 DataSpecificRegistrationInfo(
Pengquan Meng73596cb2018-12-03 17:45:14 -080088 int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable,
Jack Yu27ff4072019-04-01 15:01:13 -070089 boolean isEnDcAvailable, LteVopsSupportInfo lteVops,
90 boolean isUsingCarrierAggregation) {
Malcolm Chen4c013282018-01-24 16:27:09 -080091 this.maxDataCalls = maxDataCalls;
Pengquan Meng938905e2018-11-08 16:39:13 -080092 this.isDcNrRestricted = isDcNrRestricted;
93 this.isNrAvailable = isNrAvailable;
Pengquan Meng73596cb2018-12-03 17:45:14 -080094 this.isEnDcAvailable = isEnDcAvailable;
Jack Yu12a29b52019-03-21 16:33:15 -070095 this.mLteVopsSupportInfo = lteVops;
Jack Yu138e2af2019-04-02 13:14:03 -070096 this.mIsUsingCarrierAggregation = isUsingCarrierAggregation;
Malcolm Chen4c013282018-01-24 16:27:09 -080097 }
98
Jack Yub79342f2019-04-16 08:20:18 -070099 /**
100 * Constructor from another data specific registration info
101 *
102 * @param dsri another data specific registration info
103 * @hide
104 */
105 DataSpecificRegistrationInfo(DataSpecificRegistrationInfo dsri) {
106 maxDataCalls = dsri.maxDataCalls;
107 isDcNrRestricted = dsri.isDcNrRestricted;
108 isNrAvailable = dsri.isNrAvailable;
109 isEnDcAvailable = dsri.isEnDcAvailable;
110 mLteVopsSupportInfo = dsri.mLteVopsSupportInfo;
111 mIsUsingCarrierAggregation = dsri.mIsUsingCarrierAggregation;
112 }
113
Jack Yu12a29b52019-03-21 16:33:15 -0700114 private DataSpecificRegistrationInfo(Parcel source) {
Malcolm Chen4c013282018-01-24 16:27:09 -0800115 maxDataCalls = source.readInt();
Pengquan Meng938905e2018-11-08 16:39:13 -0800116 isDcNrRestricted = source.readBoolean();
117 isNrAvailable = source.readBoolean();
Pengquan Meng73596cb2018-12-03 17:45:14 -0800118 isEnDcAvailable = source.readBoolean();
Jack Yu12a29b52019-03-21 16:33:15 -0700119 mLteVopsSupportInfo = LteVopsSupportInfo.CREATOR.createFromParcel(source);
Jack Yu138e2af2019-04-02 13:14:03 -0700120 mIsUsingCarrierAggregation = source.readBoolean();
Malcolm Chen4c013282018-01-24 16:27:09 -0800121 }
122
123 @Override
124 public void writeToParcel(Parcel dest, int flags) {
125 dest.writeInt(maxDataCalls);
Pengquan Meng938905e2018-11-08 16:39:13 -0800126 dest.writeBoolean(isDcNrRestricted);
127 dest.writeBoolean(isNrAvailable);
Pengquan Meng73596cb2018-12-03 17:45:14 -0800128 dest.writeBoolean(isEnDcAvailable);
Jack Yu12a29b52019-03-21 16:33:15 -0700129 mLteVopsSupportInfo.writeToParcel(dest, flags);
Jack Yu138e2af2019-04-02 13:14:03 -0700130 dest.writeBoolean(mIsUsingCarrierAggregation);
Malcolm Chen4c013282018-01-24 16:27:09 -0800131 }
132
133 @Override
134 public int describeContents() {
135 return 0;
136 }
137
Aurimas Liutikas1da3bde2019-08-28 13:01:05 -0700138 @NonNull
Malcolm Chen4c013282018-01-24 16:27:09 -0800139 @Override
140 public String toString() {
Pengquan Meng938905e2018-11-08 16:39:13 -0800141 return new StringBuilder().append(this.getClass().getName())
142 .append(" :{")
143 .append(" maxDataCalls = " + maxDataCalls)
144 .append(" isDcNrRestricted = " + isDcNrRestricted)
145 .append(" isNrAvailable = " + isNrAvailable)
Pengquan Meng73596cb2018-12-03 17:45:14 -0800146 .append(" isEnDcAvailable = " + isEnDcAvailable)
Jack Yu27ff4072019-04-01 15:01:13 -0700147 .append(" " + mLteVopsSupportInfo.toString())
Jack Yu138e2af2019-04-02 13:14:03 -0700148 .append(" mIsUsingCarrierAggregation = " + mIsUsingCarrierAggregation)
Pengquan Meng938905e2018-11-08 16:39:13 -0800149 .append(" }")
150 .toString();
Malcolm Chen4c013282018-01-24 16:27:09 -0800151 }
152
153 @Override
154 public int hashCode() {
Amruth Ramachandrana46bc5c2019-01-09 14:25:44 -0800155 return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable, isEnDcAvailable,
Jack Yu138e2af2019-04-02 13:14:03 -0700156 mLteVopsSupportInfo, mIsUsingCarrierAggregation);
Malcolm Chen4c013282018-01-24 16:27:09 -0800157 }
158
159 @Override
Aurimas Liutikas1da3bde2019-08-28 13:01:05 -0700160 public boolean equals(@Nullable Object o) {
Malcolm Chen4c013282018-01-24 16:27:09 -0800161 if (this == o) return true;
162
Jack Yu12a29b52019-03-21 16:33:15 -0700163 if (!(o instanceof DataSpecificRegistrationInfo)) return false;
Malcolm Chen4c013282018-01-24 16:27:09 -0800164
Jack Yu12a29b52019-03-21 16:33:15 -0700165 DataSpecificRegistrationInfo other = (DataSpecificRegistrationInfo) o;
Pengquan Meng938905e2018-11-08 16:39:13 -0800166 return this.maxDataCalls == other.maxDataCalls
167 && this.isDcNrRestricted == other.isDcNrRestricted
Pengquan Meng73596cb2018-12-03 17:45:14 -0800168 && this.isNrAvailable == other.isNrAvailable
Amruth Ramachandrana46bc5c2019-01-09 14:25:44 -0800169 && this.isEnDcAvailable == other.isEnDcAvailable
Jack Yu27ff4072019-04-01 15:01:13 -0700170 && this.mLteVopsSupportInfo.equals(other.mLteVopsSupportInfo)
Jack Yu138e2af2019-04-02 13:14:03 -0700171 && this.mIsUsingCarrierAggregation == other.mIsUsingCarrierAggregation;
Malcolm Chen4c013282018-01-24 16:27:09 -0800172 }
173
Jack Yu12a29b52019-03-21 16:33:15 -0700174 public static final @NonNull Parcelable.Creator<DataSpecificRegistrationInfo> CREATOR =
175 new Parcelable.Creator<DataSpecificRegistrationInfo>() {
Malcolm Chen4c013282018-01-24 16:27:09 -0800176 @Override
Jack Yu12a29b52019-03-21 16:33:15 -0700177 public DataSpecificRegistrationInfo createFromParcel(Parcel source) {
178 return new DataSpecificRegistrationInfo(source);
Malcolm Chen4c013282018-01-24 16:27:09 -0800179 }
180
181 @Override
Jack Yu12a29b52019-03-21 16:33:15 -0700182 public DataSpecificRegistrationInfo[] newArray(int size) {
183 return new DataSpecificRegistrationInfo[size];
Malcolm Chen4c013282018-01-24 16:27:09 -0800184 }
185 };
Amruth Ramachandrane4cbd112019-02-22 11:01:00 -0800186
187 /**
Jack Yu12a29b52019-03-21 16:33:15 -0700188 * @return The LTE VOPS (Voice over Packet Switched) support information
Amruth Ramachandrane4cbd112019-02-22 11:01:00 -0800189 */
190 @NonNull
191 public LteVopsSupportInfo getLteVopsSupportInfo() {
Jack Yu12a29b52019-03-21 16:33:15 -0700192 return mLteVopsSupportInfo;
Amruth Ramachandrane4cbd112019-02-22 11:01:00 -0800193 }
Jack Yu138e2af2019-04-02 13:14:03 -0700194
195 /**
196 * Set the flag indicating if using carrier aggregation.
197 *
198 * @param isUsingCarrierAggregation {@code true} if using carrier aggregation.
199 * @hide
200 */
201 public void setIsUsingCarrierAggregation(boolean isUsingCarrierAggregation) {
202 mIsUsingCarrierAggregation = isUsingCarrierAggregation;
203 }
204
205 /**
Jayachandran C4d62c632019-11-07 00:47:28 -0800206 * Get whether network has configured carrier aggregation or not.
207 *
Jack Yu138e2af2019-04-02 13:14:03 -0700208 * @return {@code true} if using carrier aggregation.
209 * @hide
210 */
211 public boolean isUsingCarrierAggregation() {
212 return mIsUsingCarrierAggregation;
213 }
Amruth Ramachandrana46bc5c2019-01-09 14:25:44 -0800214}