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