Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 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 | |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 17 | package android.telephony; |
| 18 | |
Amruth Ramachandran | e4cbd11 | 2019-02-22 11:01:00 -0800 | [diff] [blame] | 19 | import android.annotation.NonNull; |
Aurimas Liutikas | 1da3bde | 2019-08-28 13:01:05 -0700 | [diff] [blame] | 20 | import android.annotation.Nullable; |
Amruth Ramachandran | e4cbd11 | 2019-02-22 11:01:00 -0800 | [diff] [blame] | 21 | import android.annotation.SystemApi; |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 22 | import android.annotation.TestApi; |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 23 | import android.os.Parcel; |
| 24 | import android.os.Parcelable; |
| 25 | |
| 26 | import java.util.Objects; |
| 27 | |
| 28 | |
| 29 | /** |
| 30 | * Class that stores information specific to data network registration. |
| 31 | * @hide |
| 32 | */ |
Amruth Ramachandran | e4cbd11 | 2019-02-22 11:01:00 -0800 | [diff] [blame] | 33 | @SystemApi |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 34 | @TestApi |
| 35 | public final class DataSpecificRegistrationInfo implements Parcelable { |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 36 | /** |
Amruth Ramachandran | e4cbd11 | 2019-02-22 11:01:00 -0800 | [diff] [blame] | 37 | * @hide |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 38 | * The maximum number of simultaneous Data Calls that |
| 39 | * must be established using setupDataCall(). |
| 40 | */ |
| 41 | public final int maxDataCalls; |
| 42 | |
Pengquan Meng | 938905e | 2018-11-08 16:39:13 -0800 | [diff] [blame] | 43 | /** |
Amruth Ramachandran | e4cbd11 | 2019-02-22 11:01:00 -0800 | [diff] [blame] | 44 | * @hide |
Pengquan Meng | 938905e | 2018-11-08 16:39:13 -0800 | [diff] [blame] | 45 | * 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 Ramachandran | e4cbd11 | 2019-02-22 11:01:00 -0800 | [diff] [blame] | 52 | * @hide |
Pengquan Meng | 938905e | 2018-11-08 16:39:13 -0800 | [diff] [blame] | 53 | * {@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 Meng | 73596cb | 2018-12-03 17:45:14 -0800 | [diff] [blame] | 60 | /** |
Amruth Ramachandran | e4cbd11 | 2019-02-22 11:01:00 -0800 | [diff] [blame] | 61 | * @hide |
Pengquan Meng | 73596cb | 2018-12-03 17:45:14 -0800 | [diff] [blame] | 62 | * 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 Ramachandran | a46bc5c | 2019-01-09 14:25:44 -0800 | [diff] [blame] | 72 | /** |
| 73 | * Provides network support info for LTE VoPS and LTE Emergency bearer support |
| 74 | */ |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 75 | private final LteVopsSupportInfo mLteVopsSupportInfo; |
Amruth Ramachandran | a46bc5c | 2019-01-09 14:25:44 -0800 | [diff] [blame] | 76 | |
Amruth Ramachandran | e4cbd11 | 2019-02-22 11:01:00 -0800 | [diff] [blame] | 77 | /** |
Jack Yu | 27ff407 | 2019-04-01 15:01:13 -0700 | [diff] [blame] | 78 | * Indicates if it's using carrier aggregation |
| 79 | * |
| 80 | * @hide |
| 81 | */ |
Jack Yu | 138e2af | 2019-04-02 13:14:03 -0700 | [diff] [blame] | 82 | public boolean mIsUsingCarrierAggregation; |
Jack Yu | 27ff407 | 2019-04-01 15:01:13 -0700 | [diff] [blame] | 83 | |
| 84 | /** |
Amruth Ramachandran | e4cbd11 | 2019-02-22 11:01:00 -0800 | [diff] [blame] | 85 | * @hide |
| 86 | */ |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 87 | DataSpecificRegistrationInfo( |
Pengquan Meng | 73596cb | 2018-12-03 17:45:14 -0800 | [diff] [blame] | 88 | int maxDataCalls, boolean isDcNrRestricted, boolean isNrAvailable, |
Jack Yu | 27ff407 | 2019-04-01 15:01:13 -0700 | [diff] [blame] | 89 | boolean isEnDcAvailable, LteVopsSupportInfo lteVops, |
| 90 | boolean isUsingCarrierAggregation) { |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 91 | this.maxDataCalls = maxDataCalls; |
Pengquan Meng | 938905e | 2018-11-08 16:39:13 -0800 | [diff] [blame] | 92 | this.isDcNrRestricted = isDcNrRestricted; |
| 93 | this.isNrAvailable = isNrAvailable; |
Pengquan Meng | 73596cb | 2018-12-03 17:45:14 -0800 | [diff] [blame] | 94 | this.isEnDcAvailable = isEnDcAvailable; |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 95 | this.mLteVopsSupportInfo = lteVops; |
Jack Yu | 138e2af | 2019-04-02 13:14:03 -0700 | [diff] [blame] | 96 | this.mIsUsingCarrierAggregation = isUsingCarrierAggregation; |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 97 | } |
| 98 | |
Jack Yu | b79342f | 2019-04-16 08:20:18 -0700 | [diff] [blame] | 99 | /** |
| 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 Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 114 | private DataSpecificRegistrationInfo(Parcel source) { |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 115 | maxDataCalls = source.readInt(); |
Pengquan Meng | 938905e | 2018-11-08 16:39:13 -0800 | [diff] [blame] | 116 | isDcNrRestricted = source.readBoolean(); |
| 117 | isNrAvailable = source.readBoolean(); |
Pengquan Meng | 73596cb | 2018-12-03 17:45:14 -0800 | [diff] [blame] | 118 | isEnDcAvailable = source.readBoolean(); |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 119 | mLteVopsSupportInfo = LteVopsSupportInfo.CREATOR.createFromParcel(source); |
Jack Yu | 138e2af | 2019-04-02 13:14:03 -0700 | [diff] [blame] | 120 | mIsUsingCarrierAggregation = source.readBoolean(); |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | @Override |
| 124 | public void writeToParcel(Parcel dest, int flags) { |
| 125 | dest.writeInt(maxDataCalls); |
Pengquan Meng | 938905e | 2018-11-08 16:39:13 -0800 | [diff] [blame] | 126 | dest.writeBoolean(isDcNrRestricted); |
| 127 | dest.writeBoolean(isNrAvailable); |
Pengquan Meng | 73596cb | 2018-12-03 17:45:14 -0800 | [diff] [blame] | 128 | dest.writeBoolean(isEnDcAvailable); |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 129 | mLteVopsSupportInfo.writeToParcel(dest, flags); |
Jack Yu | 138e2af | 2019-04-02 13:14:03 -0700 | [diff] [blame] | 130 | dest.writeBoolean(mIsUsingCarrierAggregation); |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | @Override |
| 134 | public int describeContents() { |
| 135 | return 0; |
| 136 | } |
| 137 | |
Aurimas Liutikas | 1da3bde | 2019-08-28 13:01:05 -0700 | [diff] [blame] | 138 | @NonNull |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 139 | @Override |
| 140 | public String toString() { |
Pengquan Meng | 938905e | 2018-11-08 16:39:13 -0800 | [diff] [blame] | 141 | return new StringBuilder().append(this.getClass().getName()) |
| 142 | .append(" :{") |
| 143 | .append(" maxDataCalls = " + maxDataCalls) |
| 144 | .append(" isDcNrRestricted = " + isDcNrRestricted) |
| 145 | .append(" isNrAvailable = " + isNrAvailable) |
Pengquan Meng | 73596cb | 2018-12-03 17:45:14 -0800 | [diff] [blame] | 146 | .append(" isEnDcAvailable = " + isEnDcAvailable) |
Jack Yu | 27ff407 | 2019-04-01 15:01:13 -0700 | [diff] [blame] | 147 | .append(" " + mLteVopsSupportInfo.toString()) |
Jack Yu | 138e2af | 2019-04-02 13:14:03 -0700 | [diff] [blame] | 148 | .append(" mIsUsingCarrierAggregation = " + mIsUsingCarrierAggregation) |
Pengquan Meng | 938905e | 2018-11-08 16:39:13 -0800 | [diff] [blame] | 149 | .append(" }") |
| 150 | .toString(); |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 151 | } |
| 152 | |
| 153 | @Override |
| 154 | public int hashCode() { |
Amruth Ramachandran | a46bc5c | 2019-01-09 14:25:44 -0800 | [diff] [blame] | 155 | return Objects.hash(maxDataCalls, isDcNrRestricted, isNrAvailable, isEnDcAvailable, |
Jack Yu | 138e2af | 2019-04-02 13:14:03 -0700 | [diff] [blame] | 156 | mLteVopsSupportInfo, mIsUsingCarrierAggregation); |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | @Override |
Aurimas Liutikas | 1da3bde | 2019-08-28 13:01:05 -0700 | [diff] [blame] | 160 | public boolean equals(@Nullable Object o) { |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 161 | if (this == o) return true; |
| 162 | |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 163 | if (!(o instanceof DataSpecificRegistrationInfo)) return false; |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 164 | |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 165 | DataSpecificRegistrationInfo other = (DataSpecificRegistrationInfo) o; |
Pengquan Meng | 938905e | 2018-11-08 16:39:13 -0800 | [diff] [blame] | 166 | return this.maxDataCalls == other.maxDataCalls |
| 167 | && this.isDcNrRestricted == other.isDcNrRestricted |
Pengquan Meng | 73596cb | 2018-12-03 17:45:14 -0800 | [diff] [blame] | 168 | && this.isNrAvailable == other.isNrAvailable |
Amruth Ramachandran | a46bc5c | 2019-01-09 14:25:44 -0800 | [diff] [blame] | 169 | && this.isEnDcAvailable == other.isEnDcAvailable |
Jack Yu | 27ff407 | 2019-04-01 15:01:13 -0700 | [diff] [blame] | 170 | && this.mLteVopsSupportInfo.equals(other.mLteVopsSupportInfo) |
Jack Yu | 138e2af | 2019-04-02 13:14:03 -0700 | [diff] [blame] | 171 | && this.mIsUsingCarrierAggregation == other.mIsUsingCarrierAggregation; |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 172 | } |
| 173 | |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 174 | public static final @NonNull Parcelable.Creator<DataSpecificRegistrationInfo> CREATOR = |
| 175 | new Parcelable.Creator<DataSpecificRegistrationInfo>() { |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 176 | @Override |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 177 | public DataSpecificRegistrationInfo createFromParcel(Parcel source) { |
| 178 | return new DataSpecificRegistrationInfo(source); |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 179 | } |
| 180 | |
| 181 | @Override |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 182 | public DataSpecificRegistrationInfo[] newArray(int size) { |
| 183 | return new DataSpecificRegistrationInfo[size]; |
Malcolm Chen | 4c01328 | 2018-01-24 16:27:09 -0800 | [diff] [blame] | 184 | } |
| 185 | }; |
Amruth Ramachandran | e4cbd11 | 2019-02-22 11:01:00 -0800 | [diff] [blame] | 186 | |
| 187 | /** |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 188 | * @return The LTE VOPS (Voice over Packet Switched) support information |
Amruth Ramachandran | e4cbd11 | 2019-02-22 11:01:00 -0800 | [diff] [blame] | 189 | */ |
| 190 | @NonNull |
| 191 | public LteVopsSupportInfo getLteVopsSupportInfo() { |
Jack Yu | 12a29b5 | 2019-03-21 16:33:15 -0700 | [diff] [blame] | 192 | return mLteVopsSupportInfo; |
Amruth Ramachandran | e4cbd11 | 2019-02-22 11:01:00 -0800 | [diff] [blame] | 193 | } |
Jack Yu | 138e2af | 2019-04-02 13:14:03 -0700 | [diff] [blame] | 194 | |
| 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 C | 4d62c63 | 2019-11-07 00:47:28 -0800 | [diff] [blame] | 206 | * Get whether network has configured carrier aggregation or not. |
| 207 | * |
Jack Yu | 138e2af | 2019-04-02 13:14:03 -0700 | [diff] [blame] | 208 | * @return {@code true} if using carrier aggregation. |
| 209 | * @hide |
| 210 | */ |
| 211 | public boolean isUsingCarrierAggregation() { |
| 212 | return mIsUsingCarrierAggregation; |
| 213 | } |
Amruth Ramachandran | a46bc5c | 2019-01-09 14:25:44 -0800 | [diff] [blame] | 214 | } |