blob: afa492226f659bbcc4a330172778f6e6a1e16990 [file] [log] [blame]
Wink Savilleb208a242012-07-25 14:08:09 -07001/*
2 * Copyright (C) 2012 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
17package android.telephony;
18
Wink Savilleb208a242012-07-25 14:08:09 -070019/**
20 * Abstract base class for cell phone signal strength related information.
Wink Savilleb208a242012-07-25 14:08:09 -070021 */
Wink Savillec6e4917a2012-09-21 13:54:05 -070022public abstract class CellSignalStrength {
Wink Savilleb208a242012-07-25 14:08:09 -070023
Nathan Harolda6d893e2018-11-14 11:51:51 -080024 public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN =
25 TelephonyProtoEnums.SIGNAL_STRENGTH_NONE_OR_UNKNOWN; // 0
Casey Ho8e270502015-04-21 09:37:55 -070026
Nathan Harolda6d893e2018-11-14 11:51:51 -080027 public static final int SIGNAL_STRENGTH_POOR =
28 TelephonyProtoEnums.SIGNAL_STRENGTH_POOR; // 1
Casey Ho8e270502015-04-21 09:37:55 -070029
Nathan Harolda6d893e2018-11-14 11:51:51 -080030 public static final int SIGNAL_STRENGTH_MODERATE =
31 TelephonyProtoEnums.SIGNAL_STRENGTH_MODERATE; // 2
Casey Ho8e270502015-04-21 09:37:55 -070032
Nathan Harolda6d893e2018-11-14 11:51:51 -080033 public static final int SIGNAL_STRENGTH_GOOD =
34 TelephonyProtoEnums.SIGNAL_STRENGTH_GOOD; // 3
Casey Ho8e270502015-04-21 09:37:55 -070035
Nathan Harolda6d893e2018-11-14 11:51:51 -080036 public static final int SIGNAL_STRENGTH_GREAT =
37 TelephonyProtoEnums.SIGNAL_STRENGTH_GREAT; // 4
Casey Ho8e270502015-04-21 09:37:55 -070038
Wink Savilleb208a242012-07-25 14:08:09 -070039 /** @hide */
40 public static final int NUM_SIGNAL_STRENGTH_BINS = 5;
Casey Ho8e270502015-04-21 09:37:55 -070041
Wink Savilleb208a242012-07-25 14:08:09 -070042 /** @hide */
43 public static final String[] SIGNAL_STRENGTH_NAMES = {
44 "none", "poor", "moderate", "good", "great"
45 };
46
47 /** @hide */
Wink Saville3caf66d2012-07-25 17:06:54 -070048 protected CellSignalStrength() {
49 }
50
51 /** @hide */
Wink Savilleb208a242012-07-25 14:08:09 -070052 public abstract void setDefaultValues();
53
54 /**
55 * Get signal level as an int from 0..4
Casey Ho8e270502015-04-21 09:37:55 -070056 * <p>
57 * @see SIGNAL_STRENGTH_NONE_OR_UNKNOWN
58 * @see SIGNAL_STRENGTH_POOR
59 * @see SIGNAL_STRENGTH_MODERATE
60 * @see SIGNAL_STRENGTH_GOOD
61 * @see SIGNAL_STRENGTH_GREAT
Wink Savilleb208a242012-07-25 14:08:09 -070062 */
63 public abstract int getLevel();
64
65 /**
66 * Get the signal level as an asu value between 0..31, 99 is unknown
Wink Savilleb208a242012-07-25 14:08:09 -070067 */
68 public abstract int getAsuLevel();
69
70 /**
71 * Get the signal strength as dBm
Wink Savilleb208a242012-07-25 14:08:09 -070072 */
73 public abstract int getDbm();
74
75 /**
76 * Copies the CellSignalStrength.
77 *
78 * @return A deep copy of this class.
79 * @hide
80 */
81 public abstract CellSignalStrength copy();
82
83 @Override
84 public abstract int hashCode();
85
86 @Override
87 public abstract boolean equals (Object o);
Wink Savilleb208a242012-07-25 14:08:09 -070088}