Debian Codegraph @

core/java/android/net/MobileLinkQualityInfo.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2013 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.net;
18
19 import android.compat.annotation.UnsupportedAppUsage;
20 import android.os.Build;
21 import android.os.Parcel;
22
23 /**
24 * Class that represents useful attributes of mobile network links
25 * such as the upload/download throughput or error rate etc.
26 * @hide
27 */
28 public class MobileLinkQualityInfo extends LinkQualityInfo {
29 // Represents TelephonyManager.NetworkType
30 private int mMobileNetworkType = UNKNOWN_INT;
31 private int mRssi = UNKNOWN_INT;
32 private int mGsmErrorRate = UNKNOWN_INT;
33 private int mCdmaDbm = UNKNOWN_INT;
34 private int mCdmaEcio = UNKNOWN_INT;
35 private int mEvdoDbm = UNKNOWN_INT;
36 private int mEvdoEcio = UNKNOWN_INT;
37 private int mEvdoSnr = UNKNOWN_INT;
38 private int mLteSignalStrength = UNKNOWN_INT;
39 private int mLteRsrp = UNKNOWN_INT;
40 private int mLteRsrq = UNKNOWN_INT;
41 private int mLteRssnr = UNKNOWN_INT;
42 private int mLteCqi = UNKNOWN_INT;
43
44 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
45 public MobileLinkQualityInfo() {
46 }
47
48 /**
49 * Implement the Parcelable interface.
50 * @hide
51 */
52 @Override
53 public void writeToParcel(Parcel dest, int flags) {
54 super.writeToParcel(dest, flags, OBJECT_TYPE_MOBILE_LINK_QUALITY_INFO);
55
56 dest.writeInt(mMobileNetworkType);
57 dest.writeInt(mRssi);
58 dest.writeInt(mGsmErrorRate);
59 dest.writeInt(mCdmaDbm);
60 dest.writeInt(mCdmaEcio);
61 dest.writeInt(mEvdoDbm);
62 dest.writeInt(mEvdoEcio);
63 dest.writeInt(mEvdoSnr);
64 dest.writeInt(mLteSignalStrength);
65 dest.writeInt(mLteRsrp);
66 dest.writeInt(mLteRsrq);
67 dest.writeInt(mLteRssnr);
68 dest.writeInt(mLteCqi);
69 }
70
71 /* Un-parceling helper */
72 /**
73 * @hide
74 */
75 public static MobileLinkQualityInfo createFromParcelBody(Parcel in) {
76
77 MobileLinkQualityInfo li = new MobileLinkQualityInfo();
78
79 li.initializeFromParcel(in);
80
81 li.mMobileNetworkType = in.readInt();
82 li.mRssi = in.readInt();
83 li.mGsmErrorRate = in.readInt();
84 li.mCdmaDbm = in.readInt();
85 li.mCdmaEcio = in.readInt();
86 li.mEvdoDbm = in.readInt();
87 li.mEvdoEcio = in.readInt();
88 li.mEvdoSnr = in.readInt();
89 li.mLteSignalStrength = in.readInt();
90 li.mLteRsrp = in.readInt();
91 li.mLteRsrq = in.readInt();
92 li.mLteRssnr = in.readInt();
93 li.mLteCqi = in.readInt();
94
95 return li;
96 }
97
98 /**
99 * returns mobile network type as defined by {@link android.telephony.TelephonyManager}
100 * @return network type or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
101 */
102 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
103 public int getMobileNetworkType() {
104 return mMobileNetworkType;
105 }
106
107 /**
108 * @hide
109 */
110 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
111 public void setMobileNetworkType(int mobileNetworkType) {
112 mMobileNetworkType = mobileNetworkType;
113 }
114
115 /**
116 * returns signal strength for GSM networks
117 * @return signal strength in db or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
118 */
119 public int getRssi() {
120 return mRssi;
121 }
122
123 /**
124 * @hide
125 */
126 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
127 public void setRssi(int Rssi) {
128 mRssi = Rssi;
129 }
130
131 /**
132 * returns error rates for GSM networks
133 * @return error rate or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
134 */
135 public int getGsmErrorRate() {
136 return mGsmErrorRate;
137 }
138
139 /**
140 * @hide
141 */
142 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
143 public void setGsmErrorRate(int gsmErrorRate) {
144 mGsmErrorRate = gsmErrorRate;
145 }
146
147 /**
148 * returns signal strength for CDMA networks
149 * @return signal strength in db or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
150 */
151 public int getCdmaDbm() {
152 return mCdmaDbm;
153 }
154
155 /**
156 * @hide
157 */
158 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
159 public void setCdmaDbm(int cdmaDbm) {
160 mCdmaDbm = cdmaDbm;
161 }
162
163 /**
164 * returns signal to noise ratio for CDMA networks
165 * @return signal to noise ratio in db or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
166 */
167 public int getCdmaEcio() {
168 return mCdmaEcio;
169 }
170
171 /**
172 * @hide
173 */
174 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
175 public void setCdmaEcio(int cdmaEcio) {
176 mCdmaEcio = cdmaEcio;
177 }
178
179 /**
180 * returns signal strength for EVDO networks
181 * @return signal strength in db or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
182 */
183 public int getEvdoDbm() {
184 return mEvdoDbm;
185 }
186
187 /**
188 * @hide
189 */
190 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
191 public void setEvdoDbm(int evdoDbm) {
192 mEvdoDbm = evdoDbm;
193 }
194
195 /**
196 * returns signal to noise ratio for EVDO spectrum
197 * @return signal to noise ration in db or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
198 */
199 public int getEvdoEcio() {
200 return mEvdoEcio;
201 }
202
203 /**
204 * @hide
205 */
206 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
207 public void setEvdoEcio(int evdoEcio) {
208 mEvdoEcio = evdoEcio;
209 }
210
211 /**
212 * returns end-to-end signal to noise ratio for EVDO networks
213 * @return signal to noise ration in db or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
214 */
215 public int getEvdoSnr() {
216 return mEvdoSnr;
217 }
218
219 /**
220 * @hide
221 */
222 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
223 public void setEvdoSnr(int evdoSnr) {
224 mEvdoSnr = evdoSnr;
225 }
226
227 /**
228 * returns signal strength for LTE network
229 * @return signal strength in db or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
230 */
231 public int getLteSignalStrength() {
232 return mLteSignalStrength;
233 }
234
235 /**
236 * @hide
237 */
238 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
239 public void setLteSignalStrength(int lteSignalStrength) {
240 mLteSignalStrength = lteSignalStrength;
241 }
242
243 /**
244 * returns RSRP (Reference Signal Received Power) for LTE network
245 * @return RSRP in db or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
246 */
247 public int getLteRsrp() {
248 return mLteRsrp;
249 }
250
251 /**
252 * @hide
253 */
254 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
255 public void setLteRsrp(int lteRsrp) {
256 mLteRsrp = lteRsrp;
257 }
258
259 /**
260 * returns RSRQ (Reference Signal Received Quality) for LTE network
261 * @return RSRQ ??? or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
262 */
263 public int getLteRsrq() {
264 return mLteRsrq;
265 }
266
267 /**
268 * @hide
269 */
270 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
271 public void setLteRsrq(int lteRsrq) {
272 mLteRsrq = lteRsrq;
273 }
274
275 /**
276 * returns signal to noise ratio for LTE networks
277 * @return signal to noise ration in db or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
278 */
279 public int getLteRssnr() {
280 return mLteRssnr;
281 }
282
283 /**
284 * @hide
285 */
286 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
287 public void setLteRssnr(int lteRssnr) {
288 mLteRssnr = lteRssnr;
289 }
290
291 /**
292 * returns channel quality indicator for LTE networks
293 * @return CQI or {@link android.net.LinkQualityInfo#UNKNOWN_INT}
294 */
295 public int getLteCqi() {
296 return mLteCqi;
297 }
298
299 /**
300 * @hide
301 */
302 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
303 public void setLteCqi(int lteCqi) {
304 mLteCqi = lteCqi;
305 }
306 }