blob: 3b470fcba706c638e5230a171d54c3788eb403ed [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
19import android.os.Parcel;
20import android.os.Parcelable;
Wink Savilleb208a242012-07-25 14:08:09 -070021
22/**
23 * Abstract base class for cell phone signal strength related information.
Wink Savilleb208a242012-07-25 14:08:09 -070024 */
Wink Savillec6e49172012-09-21 13:54:05 -070025public abstract class CellSignalStrength {
Wink Savilleb208a242012-07-25 14:08:09 -070026
27 /** @hide */
28 public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN = 0;
29 /** @hide */
30 public static final int SIGNAL_STRENGTH_POOR = 1;
31 /** @hide */
32 public static final int SIGNAL_STRENGTH_MODERATE = 2;
33 /** @hide */
34 public static final int SIGNAL_STRENGTH_GOOD = 3;
35 /** @hide */
36 public static final int SIGNAL_STRENGTH_GREAT = 4;
37 /** @hide */
38 public static final int NUM_SIGNAL_STRENGTH_BINS = 5;
39 /** @hide */
40 public static final String[] SIGNAL_STRENGTH_NAMES = {
41 "none", "poor", "moderate", "good", "great"
42 };
43
44 /** @hide */
Wink Saville3caf66d2012-07-25 17:06:54 -070045 protected CellSignalStrength() {
46 }
47
48 /** @hide */
Wink Savilleb208a242012-07-25 14:08:09 -070049 public abstract void setDefaultValues();
50
51 /**
52 * Get signal level as an int from 0..4
Wink Savilleb208a242012-07-25 14:08:09 -070053 */
54 public abstract int getLevel();
55
56 /**
57 * Get the signal level as an asu value between 0..31, 99 is unknown
Wink Savilleb208a242012-07-25 14:08:09 -070058 */
59 public abstract int getAsuLevel();
60
61 /**
62 * Get the signal strength as dBm
Wink Savilleb208a242012-07-25 14:08:09 -070063 */
64 public abstract int getDbm();
65
66 /**
67 * Copies the CellSignalStrength.
68 *
69 * @return A deep copy of this class.
70 * @hide
71 */
72 public abstract CellSignalStrength copy();
73
74 @Override
75 public abstract int hashCode();
76
77 @Override
78 public abstract boolean equals (Object o);
Wink Savilleb208a242012-07-25 14:08:09 -070079}