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 17 package android.telephony; 18 19 import android.os.Parcel; 20 import android.os.Parcelable; 21 22 /** 23 * Abstract base class for cell phone signal strength related information. 24 */ 25 public abstract class CellSignalStrength { 26 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 */ CellSignalStrength()45 protected CellSignalStrength() { 46 } 47 48 /** @hide */ setDefaultValues()49 public abstract void setDefaultValues(); 50 51 /** 52 * Get signal level as an int from 0..4 53 */ getLevel()54 public abstract int getLevel(); 55 56 /** 57 * Get the signal level as an asu value between 0..31, 99 is unknown 58 */ getAsuLevel()59 public abstract int getAsuLevel(); 60 61 /** 62 * Get the signal strength as dBm 63 */ getDbm()64 public abstract int getDbm(); 65 66 /** 67 * Copies the CellSignalStrength. 68 * 69 * @return A deep copy of this class. 70 * @hide 71 */ copy()72 public abstract CellSignalStrength copy(); 73 74 @Override hashCode()75 public abstract int hashCode(); 76 77 @Override equals(Object o)78 public abstract boolean equals (Object o); 79 } 80