1 /* 2 * Copyright (C) 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.os.Parcel; 20 import android.os.Parcelable; 21 22 import java.util.Objects; 23 24 /** 25 * The container of LTE cell related configs. 26 * @hide 27 */ 28 public class CellConfigLte implements Parcelable { 29 private final boolean mIsEndcAvailable; 30 31 /** @hide */ CellConfigLte()32 public CellConfigLte() { 33 mIsEndcAvailable = false; 34 } 35 36 /** @hide */ CellConfigLte(boolean isEndcAvailable)37 public CellConfigLte(boolean isEndcAvailable) { 38 mIsEndcAvailable = isEndcAvailable; 39 } 40 41 /** @hide */ CellConfigLte(CellConfigLte config)42 public CellConfigLte(CellConfigLte config) { 43 mIsEndcAvailable = config.mIsEndcAvailable; 44 } 45 46 /** 47 * Indicates that if E-UTRA-NR Dual Connectivity (EN-DC) is supported by the LTE cell. 48 * 49 * Reference: 3GPP TS 36.331 v15.2.2 6.3.1 System information blocks. 50 * 51 * @return {@code true} if E-UTRA-NR Dual Connectivity (EN-DC) is supported by the LTE cell. 52 * 53 */ isEndcAvailable()54 boolean isEndcAvailable() { 55 return mIsEndcAvailable; 56 } 57 58 @Override describeContents()59 public int describeContents() { 60 return 0; 61 } 62 63 @Override hashCode()64 public int hashCode() { 65 return Objects.hash(mIsEndcAvailable); 66 } 67 68 @Override equals(Object other)69 public boolean equals(Object other) { 70 if (!(other instanceof CellConfigLte)) return false; 71 72 CellConfigLte o = (CellConfigLte) other; 73 return mIsEndcAvailable == o.mIsEndcAvailable; 74 } 75 76 @Override writeToParcel(Parcel dest, int flags)77 public void writeToParcel(Parcel dest, int flags) { 78 dest.writeBoolean(mIsEndcAvailable); 79 } 80 81 @Override toString()82 public String toString() { 83 return new StringBuilder().append(this.getClass().getName()) 84 .append(" :{") 85 .append(" isEndcAvailable = " + mIsEndcAvailable) 86 .append(" }") 87 .toString(); 88 } 89 CellConfigLte(Parcel in)90 private CellConfigLte(Parcel in) { 91 mIsEndcAvailable = in.readBoolean(); 92 } 93 94 public static final @android.annotation.NonNull Creator<CellConfigLte> CREATOR = new Creator<CellConfigLte>() { 95 @Override 96 public CellConfigLte createFromParcel(Parcel in) { 97 return new CellConfigLte(in); 98 } 99 100 @Override 101 public CellConfigLte[] newArray(int size) { 102 return new CellConfigLte[0]; 103 } 104 }; 105 } 106