• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2020 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.data;
18 
19 import android.annotation.NonNull;
20 import android.os.Parcel;
21 import android.os.Parcelable;
22 
23 import java.util.Objects;
24 
25 
26 /**
27  * Class that stores information specific to NR QOS.
28  *
29  * @hide
30  */
31 public final class EpsQos extends Qos implements Parcelable {
32 
33     int qosClassId;
34 
EpsQos(QosBandwidth downlink, QosBandwidth uplink, int qosClassId)35     public EpsQos(QosBandwidth downlink, QosBandwidth uplink, int qosClassId) {
36         super(Qos.QOS_TYPE_EPS, downlink, uplink);
37         this.qosClassId = qosClassId;
38     }
39 
EpsQos(Parcel source)40     private EpsQos(Parcel source) {
41         super(source);
42         qosClassId = source.readInt();
43     }
44 
getQci()45     public int getQci() {
46         return qosClassId;
47     }
48 
createFromParcelBody(@onNull Parcel in)49     public static @NonNull EpsQos createFromParcelBody(@NonNull Parcel in) {
50         return new EpsQos(in);
51     }
52 
53     @Override
writeToParcel(@onNull Parcel dest, int flags)54     public void writeToParcel(@NonNull Parcel dest, int flags) {
55         super.writeToParcel(Qos.QOS_TYPE_EPS, dest, flags);
56         dest.writeInt(qosClassId);
57     }
58 
59     @Override
describeContents()60     public int describeContents() {
61         return 0;
62     }
63 
64     @Override
hashCode()65     public int hashCode() {
66         return Objects.hash(super.hashCode(), qosClassId);
67     }
68 
69     @Override
equals(Object o)70     public boolean equals(Object o) {
71         if (this == o) return true;
72 
73         if (o == null || !(o instanceof EpsQos)) {
74             return false;
75         }
76 
77         EpsQos other = (EpsQos) o;
78 
79         return this.qosClassId == other.qosClassId
80                && super.equals(other);
81     }
82 
83     @Override
toString()84     public String toString() {
85         return "EpsQos {"
86                 + " qosClassId=" + qosClassId
87                 + " downlink=" + downlink
88                 + " uplink=" + uplink + "}";
89     }
90 
91     public static final @NonNull Parcelable.Creator<EpsQos> CREATOR =
92             new Parcelable.Creator<EpsQos>() {
93                 @Override
94                 public EpsQos createFromParcel(Parcel source) {
95                     return new EpsQos(source);
96                 }
97 
98                 @Override
99                 public EpsQos[] newArray(int size) {
100                     return new EpsQos[size];
101                 }
102             };
103 }
104