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