Home | History | Annotate | Download | only in telephony
      1 /*
      2  * Copyright (C) 2008 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 com.android.internal.telephony;
     18 
     19 /**
     20  * The intents that the telephony services broadcast.
     21  *
     22  * <p class="warning">
     23  * THESE ARE NOT THE API!  Use the {@link android.telephony.TelephonyManager} class.
     24  * DON'T LISTEN TO THESE DIRECTLY.
     25  */
     26 public class TelephonyIntents {
     27 
     28     /**
     29      * Broadcast Action: The phone service state has changed. The intent will have the following
     30      * extra values:</p>
     31      * <ul>
     32      *   <li><em>state</em> - An int with one of the following values:
     33      *          {@link android.telephony.ServiceState#STATE_IN_SERVICE},
     34      *          {@link android.telephony.ServiceState#STATE_OUT_OF_SERVICE},
     35      *          {@link android.telephony.ServiceState#STATE_EMERGENCY_ONLY}
     36      *          or {@link android.telephony.ServiceState#STATE_POWER_OFF}
     37      *   <li><em>roaming</em> - A boolean value indicating whether the phone is roaming.</li>
     38      *   <li><em>operator-alpha-long</em> - The carrier name as a string.</li>
     39      *   <li><em>operator-alpha-short</em> - A potentially shortened version of the carrier name,
     40      *          as a string.</li>
     41      *   <li><em>operator-numeric</em> - A number representing the carrier, as a string. This is
     42      *          a five or six digit number consisting of the MCC (Mobile Country Code, 3 digits)
     43      *          and MNC (Mobile Network code, 2-3 digits).</li>
     44      *   <li><em>manual</em> - A boolean, where true indicates that the user has chosen to select
     45      *          the network manually, and false indicates that network selection is handled by the
     46      *          phone.</li>
     47      * </ul>
     48      *
     49      * <p class="note">
     50      * Requires the READ_PHONE_STATE permission.
     51      *
     52      * <p class="note">This is a protected intent that can only be sent
     53      * by the system.
     54      */
     55     public static final String ACTION_SERVICE_STATE_CHANGED = "android.intent.action.SERVICE_STATE";
     56 
     57     /**
     58      * <p>Broadcast Action: The radio technology has changed. The intent will have the following
     59      * extra values:</p>
     60      * <ul>
     61      *   <li><em>phoneName</em> - A string version of the new phone name.</li>
     62      * </ul>
     63      *
     64      * <p class="note">
     65      * You can <em>not</em> receive this through components declared
     66      * in manifests, only by explicitly registering for it with
     67      * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
     68      * android.content.IntentFilter) Context.registerReceiver()}.
     69      *
     70      * <p class="note">
     71      * Requires no permission.
     72      *
     73      * <p class="note">This is a protected intent that can only be sent
     74      * by the system.
     75      */
     76     public static final String ACTION_RADIO_TECHNOLOGY_CHANGED
     77             = "android.intent.action.RADIO_TECHNOLOGY";
     78     /**
     79      * <p>Broadcast Action: The emergency callback mode is changed.
     80      * <ul>
     81      *   <li><em>phoneinECMState</em> - A boolean value,true=phone in ECM, false=ECM off</li>
     82      * </ul>
     83      * <p class="note">
     84      * You can <em>not</em> receive this through components declared
     85      * in manifests, only by explicitly registering for it with
     86      * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
     87      * android.content.IntentFilter) Context.registerReceiver()}.
     88      *
     89      * <p class="note">
     90      * Requires no permission.
     91      *
     92      * <p class="note">This is a protected intent that can only be sent
     93      * by the system.
     94      */
     95     public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED
     96             = "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
     97     /**
     98      * Broadcast Action: The phone's signal strength has changed. The intent will have the
     99      * following extra values:</p>
    100      * <ul>
    101      *   <li><em>phoneName</em> - A string version of the phone name.</li>
    102      *   <li><em>asu</em> - A numeric value for the signal strength.
    103      *          An ASU is 0-31 or -1 if unknown (for GSM, dBm = -113 - 2 * asu).
    104      *          The following special values are defined:
    105      *          <ul><li>0 means "-113 dBm or less".</li><li>31 means "-51 dBm or greater".</li></ul>
    106      *   </li>
    107      * </ul>
    108      *
    109      * <p class="note">
    110      * You can <em>not</em> receive this through components declared
    111      * in manifests, only by exlicitly registering for it with
    112      * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
    113      * android.content.IntentFilter) Context.registerReceiver()}.
    114      *
    115      * <p class="note">
    116      * Requires the READ_PHONE_STATE permission.
    117      *
    118      * <p class="note">This is a protected intent that can only be sent
    119      * by the system.
    120      */
    121     public static final String ACTION_SIGNAL_STRENGTH_CHANGED = "android.intent.action.SIG_STR";
    122 
    123 
    124     /**
    125      * Broadcast Action: The data connection state has changed for any one of the
    126      * phone's mobile data connections (eg, default, MMS or GPS specific connection).
    127      * The intent will have the following extra values:</p>
    128      * <ul>
    129      *   <li><em>phoneName</em> - A string version of the phone name.</li>
    130      *   <li><em>state</em> - One of <code>"CONNECTED"</code>
    131      *      <code>"CONNECTING"</code> or <code>"DISCONNNECTED"</code></li>
    132      *   <li><em>apn</em> - A string that is the APN associated with this
    133      *      connection.</li>
    134      *   <li><em>apnType</em> - A string array of APN types associated with
    135      *      this connection.  The APN type <code>"*"</code> is a special
    136      *      type that means this APN services all types.</li>
    137      * </ul>
    138      *
    139      * <p class="note">
    140      * Requires the READ_PHONE_STATE permission.
    141      *
    142      * <p class="note">This is a protected intent that can only be sent
    143      * by the system.
    144      */
    145     public static final String ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
    146             = "android.intent.action.ANY_DATA_STATE";
    147 
    148     /**
    149      * Broadcast Action: Occurs when a data connection connects to a provisioning apn
    150      * and is broadcast by the low level data connection code.
    151      * The intent will have the following extra values:</p>
    152      * <ul>
    153      *   <li><em>apn</em> - A string that is the APN associated with this
    154      *      connection.</li>
    155      *   <li><em>apnType</em> - A string array of APN types associated with
    156      *      this connection.  The APN type <code>"*"</code> is a special
    157      *      type that means this APN services all types.</li>
    158      *   <li><em>linkProperties</em> - The <code>LinkProperties</code> for this APN</li>
    159      *   <li><em>linkCapabilities</em> - The <code>linkCapabilities</code> for this APN</li>
    160      *   <li><em>iface</em> - A string that is the name of the interface</li>
    161      * </ul>
    162      *
    163      * <p class="note">
    164      * Requires the READ_PHONE_STATE permission.
    165      *
    166      * <p class="note">This is a protected intent that can only be sent
    167      * by the system.
    168      */
    169     public static final String ACTION_DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN
    170             = "android.intent.action.DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN";
    171 
    172     /**
    173      * Broadcast Action: An attempt to establish a data connection has failed.
    174      * The intent will have the following extra values:</p>
    175      * <ul>
    176      *   <li><em>phoneName</em> &mdash A string version of the phone name.</li>
    177      *   <li><em>state</em> &mdash; One of <code>"CONNECTED"</code>
    178      *      <code>"CONNECTING"</code> or <code>"DISCONNNECTED"</code></li>
    179      * <li><em>reason</em> &mdash; A string indicating the reason for the failure, if available</li>
    180      * </ul>
    181      *
    182      * <p class="note">
    183      * Requires the READ_PHONE_STATE permission.
    184      *
    185      * <p class="note">This is a protected intent that can only be sent
    186      * by the system.
    187      */
    188     public static final String ACTION_DATA_CONNECTION_FAILED
    189             = "android.intent.action.DATA_CONNECTION_FAILED";
    190 
    191 
    192     /**
    193      * Broadcast Action: The sim card state has changed.
    194      * The intent will have the following extra values:</p>
    195      * <ul>
    196      *   <li><em>phoneName</em> - A string version of the phone name.</li>
    197      *   <li><em>ss</em> - The sim state.  One of
    198      *   <code>"ABSENT"</code> <code>"LOCKED"</code>
    199      *   <code>"READY"</code> <code>"ISMI"</code> <code>"LOADED"</code> </li>
    200      *   <li><em>reason</em> - The reason while ss is LOCKED, otherwise is null
    201      *   <code>"PIN"</code> locked on PIN1
    202      *   <code>"PUK"</code> locked on PUK1
    203      *   <code>"NETWORK"</code> locked on Network Personalization </li>
    204      * </ul>
    205      *
    206      * <p class="note">
    207      * Requires the READ_PHONE_STATE permission.
    208      *
    209      * <p class="note">This is a protected intent that can only be sent
    210      * by the system.
    211      */
    212     public static final String ACTION_SIM_STATE_CHANGED
    213             = "android.intent.action.SIM_STATE_CHANGED";
    214 
    215 
    216     /**
    217      * Broadcast Action: The time was set by the carrier (typically by the NITZ string).
    218      * This is a sticky broadcast.
    219      * The intent will have the following extra values:</p>
    220      * <ul>
    221      *   <li><em>time</em> - The time as a long in UTC milliseconds.</li>
    222      * </ul>
    223      *
    224      * <p class="note">
    225      * Requires the READ_PHONE_STATE permission.
    226      *
    227      * <p class="note">This is a protected intent that can only be sent
    228      * by the system.
    229      */
    230     public static final String ACTION_NETWORK_SET_TIME = "android.intent.action.NETWORK_SET_TIME";
    231 
    232 
    233     /**
    234      * Broadcast Action: The timezone was set by the carrier (typically by the NITZ string).
    235      * This is a sticky broadcast.
    236      * The intent will have the following extra values:</p>
    237      * <ul>
    238      *   <li><em>time-zone</em> - The java.util.TimeZone.getID() value identifying the new time
    239      *          zone.</li>
    240      * </ul>
    241      *
    242      * <p class="note">
    243      * Requires the READ_PHONE_STATE permission.
    244      *
    245      * <p class="note">This is a protected intent that can only be sent
    246      * by the system.
    247      */
    248     public static final String ACTION_NETWORK_SET_TIMEZONE
    249             = "android.intent.action.NETWORK_SET_TIMEZONE";
    250 
    251     /**
    252      * <p>Broadcast Action: It indicates the Emergency callback mode blocks datacall/sms
    253      * <p class="note">.
    254      * This is to pop up a notice to show user that the phone is in emergency callback mode
    255      * and atacalls and outgoing sms are blocked.
    256      *
    257      * <p class="note">This is a protected intent that can only be sent
    258      * by the system.
    259      */
    260     public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS
    261             = "android.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS";
    262 
    263     /**
    264      * Activity Action: Start this activity to invoke the carrier setup app.
    265      * To filter the intent, see {@link #CATEGORY_MCCMNC_PREFIX}.
    266      *
    267      * <p class="note">Callers of this should hold the android.permission.INVOKE_CARRIER_SETUP
    268      * permission.</p>
    269      */
    270     public static final String ACTION_CARRIER_SETUP = "android.intent.action.ACTION_CARRIER_SETUP";
    271 
    272     /**
    273      * A <em>prefix</em> for the MCC/MNC filtering used with {@link #ACTION_CARRIER_SETUP}.
    274      * The MCC/MNC will be concatenated (zero-padded to 3 digits each) to create a final
    275      * string of the form:
    276      * <br />
    277      * <code>android.intent.category.MCCMNC_310260</code>
    278      */
    279     public static final String CATEGORY_MCCMNC_PREFIX = "android.intent.category.MCCMNC_";
    280 
    281     /**
    282      * Broadcast Action: A "secret code" has been entered in the dialer. Secret codes are
    283      * of the form *#*#<code>#*#*. The intent will have the data URI:</p>
    284      *
    285      * <p><code>android_secret_code://&lt;code&gt;</code></p>
    286      */
    287     public static final String SECRET_CODE_ACTION =
    288             "android.provider.Telephony.SECRET_CODE";
    289 
    290     /**
    291      * Broadcast Action: The Service Provider string(s) have been updated.  Activities or
    292      * services that use these strings should update their display.
    293      * The intent will have the following extra values:</p>
    294      * <ul>
    295      *   <li><em>showPlmn</em> - Boolean that indicates whether the PLMN should be shown.</li>
    296      *   <li><em>plmn</em> - The operator name of the registered network, as a string.</li>
    297      *   <li><em>showSpn</em> - Boolean that indicates whether the SPN should be shown.</li>
    298      *   <li><em>spn</em> - The service provider name, as a string.</li>
    299      * </ul>
    300      * Note that <em>showPlmn</em> may indicate that <em>plmn</em> should be displayed, even
    301      * though the value for <em>plmn</em> is null.  This can happen, for example, if the phone
    302      * has not registered to a network yet.  In this case the receiver may substitute an
    303      * appropriate placeholder string (eg, "No service").
    304      *
    305      * It is recommended to display <em>plmn</em> before / above <em>spn</em> if
    306      * both are displayed.
    307      *
    308      * <p>Note this is a protected intent that can only be sent
    309      * by the system.
    310      */
    311     public static final String SPN_STRINGS_UPDATED_ACTION =
    312             "android.provider.Telephony.SPN_STRINGS_UPDATED";
    313 
    314     public static final String EXTRA_SHOW_PLMN  = "showPlmn";
    315     public static final String EXTRA_PLMN       = "plmn";
    316     public static final String EXTRA_SHOW_SPN   = "showSpn";
    317     public static final String EXTRA_SPN        = "spn";
    318 }
    319