CellSignalStrength.java revision 6090995951c6e2e4dcf38102f01793f8a94166e1
1/* 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 19/** 20 * Abstract base class for cell phone signal strength related information. 21 */ 22public abstract class CellSignalStrength { 23 24 /** @hide */ 25 public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN = 0; 26 /** @hide */ 27 public static final int SIGNAL_STRENGTH_POOR = 1; 28 /** @hide */ 29 public static final int SIGNAL_STRENGTH_MODERATE = 2; 30 /** @hide */ 31 public static final int SIGNAL_STRENGTH_GOOD = 3; 32 /** @hide */ 33 public static final int SIGNAL_STRENGTH_GREAT = 4; 34 /** @hide */ 35 public static final int NUM_SIGNAL_STRENGTH_BINS = 5; 36 /** @hide */ 37 public static final String[] SIGNAL_STRENGTH_NAMES = { 38 "none", "poor", "moderate", "good", "great" 39 }; 40 41 /** @hide */ 42 protected CellSignalStrength() { 43 } 44 45 /** @hide */ 46 public abstract void setDefaultValues(); 47 48 /** 49 * Get signal level as an int from 0..4 50 */ 51 public abstract int getLevel(); 52 53 /** 54 * Get the signal level as an asu value between 0..31, 99 is unknown 55 */ 56 public abstract int getAsuLevel(); 57 58 /** 59 * Get the signal strength as dBm 60 */ 61 public abstract int getDbm(); 62 63 /** 64 * Copies the CellSignalStrength. 65 * 66 * @return A deep copy of this class. 67 * @hide 68 */ 69 public abstract CellSignalStrength copy(); 70 71 @Override 72 public abstract int hashCode(); 73 74 @Override 75 public abstract boolean equals (Object o); 76} 77