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 package com.android.internal.telephony;
     17 
     18 /**
     19  * @hide
     20  */
     21 public class PhoneConstants {
     22 
     23     /**
     24      * The phone state. One of the following:<p>
     25      * <ul>
     26      * <li>IDLE = no phone activity</li>
     27      * <li>RINGING = a phone call is ringing or call waiting.
     28      *  In the latter case, another call is active as well</li>
     29      * <li>OFFHOOK = The phone is off hook. At least one call
     30      * exists that is dialing, active or holding and no calls are
     31      * ringing or waiting.</li>
     32      * </ul>
     33      */
     34     public enum State {
     35         IDLE, RINGING, OFFHOOK;
     36     };
     37 
     38    /**
     39      * The state of a data connection.
     40      * <ul>
     41      * <li>CONNECTED = IP traffic should be available</li>
     42      * <li>CONNECTING = Currently setting up data connection</li>
     43      * <li>DISCONNECTED = IP not available</li>
     44      * <li>SUSPENDED = connection is created but IP traffic is
     45      *                 temperately not available. i.e. voice call is in place
     46      *                 in 2G network</li>
     47      * </ul>
     48      */
     49     public enum DataState {
     50         CONNECTED, CONNECTING, DISCONNECTED, SUSPENDED;
     51     };
     52 
     53     public static final String STATE_KEY = "state";
     54 
     55     // Radio Type
     56     public static final int PHONE_TYPE_NONE = RILConstants.NO_PHONE;
     57     public static final int PHONE_TYPE_GSM = RILConstants.GSM_PHONE;
     58     public static final int PHONE_TYPE_CDMA = RILConstants.CDMA_PHONE;
     59     public static final int PHONE_TYPE_SIP = RILConstants.SIP_PHONE;
     60 
     61     // Modes for LTE_ON_CDMA
     62     public static final int LTE_ON_CDMA_UNKNOWN = RILConstants.LTE_ON_CDMA_UNKNOWN;
     63     public static final int LTE_ON_CDMA_FALSE = RILConstants.LTE_ON_CDMA_FALSE;
     64     public static final int LTE_ON_CDMA_TRUE = RILConstants.LTE_ON_CDMA_TRUE;
     65 
     66     // Number presentation type for caller id display (From internal/Conneciton.java)
     67     public static int PRESENTATION_ALLOWED = 1;    // normal
     68     public static int PRESENTATION_RESTRICTED = 2; // block by user
     69     public static int PRESENTATION_UNKNOWN = 3;    // no specified or unknown by network
     70     public static int PRESENTATION_PAYPHONE = 4;   // show pay phone info
     71 
     72 
     73     public static final String PHONE_NAME_KEY = "phoneName";
     74     public static final String FAILURE_REASON_KEY = "reason";
     75     public static final String STATE_CHANGE_REASON_KEY = "reason";
     76     public static final String DATA_APN_TYPE_KEY = "apnType";
     77     public static final String DATA_APN_KEY = "apn";
     78     public static final String DATA_LINK_PROPERTIES_KEY = "linkProperties";
     79     public static final String DATA_LINK_CAPABILITIES_KEY = "linkCapabilities";
     80 
     81     public static final String DATA_IFACE_NAME_KEY = "iface";
     82     public static final String NETWORK_UNAVAILABLE_KEY = "networkUnvailable";
     83     public static final String DATA_NETWORK_ROAMING_KEY = "networkRoaming";
     84     public static final String PHONE_IN_ECM_STATE = "phoneinECMState";
     85 
     86     public static final String REASON_LINK_PROPERTIES_CHANGED = "linkPropertiesChanged";
     87 
     88     /**
     89      * Return codes for supplyPinReturnResult and
     90      * supplyPukReturnResult APIs
     91      */
     92     public static final int PIN_RESULT_SUCCESS = 0;
     93     public static final int PIN_PASSWORD_INCORRECT = 1;
     94     public static final int PIN_GENERAL_FAILURE = 2;
     95 
     96     /**
     97      * Return codes for <code>enableApnType()</code>
     98      */
     99     public static final int APN_ALREADY_ACTIVE     = 0;
    100     public static final int APN_REQUEST_STARTED    = 1;
    101     public static final int APN_TYPE_NOT_AVAILABLE = 2;
    102     public static final int APN_REQUEST_FAILED     = 3;
    103     public static final int APN_ALREADY_INACTIVE   = 4;
    104 
    105     /**
    106      * APN types for data connections.  These are usage categories for an APN
    107      * entry.  One APN entry may support multiple APN types, eg, a single APN
    108      * may service regular internet traffic ("default") as well as MMS-specific
    109      * connections.<br/>
    110      * APN_TYPE_ALL is a special type to indicate that this APN entry can
    111      * service all data connections.
    112      */
    113     public static final String APN_TYPE_ALL = "*";
    114     /** APN type for default data traffic */
    115     public static final String APN_TYPE_DEFAULT = "default";
    116     /** APN type for MMS traffic */
    117     public static final String APN_TYPE_MMS = "mms";
    118     /** APN type for SUPL assisted GPS */
    119     public static final String APN_TYPE_SUPL = "supl";
    120     /** APN type for DUN traffic */
    121     public static final String APN_TYPE_DUN = "dun";
    122     /** APN type for HiPri traffic */
    123     public static final String APN_TYPE_HIPRI = "hipri";
    124     /** APN type for FOTA */
    125     public static final String APN_TYPE_FOTA = "fota";
    126     /** APN type for IMS */
    127     public static final String APN_TYPE_IMS = "ims";
    128     /** APN type for CBS */
    129     public static final String APN_TYPE_CBS = "cbs";
    130     /** APN type for IA Initial Attach APN */
    131     public static final String APN_TYPE_IA = "ia";
    132 
    133 }
    134