TelephonyIntents.java revision 54b6cfa9a9e5b861a9930af873580d6dc20f773c
1package com.android.internal.telephony;
2
3/**
4 * The intents that the telephony services broadcast.
5 *
6 * <p class="warning">
7 * THESE ARE NOT THE API!  Use the {@link android.telephony.TelephonyManager} class.
8 * DON'T LISTEN TO THESE DIRECTLY.
9 */
10public class TelephonyIntents {
11
12    /**
13     * <p>Broadcast Action: The phone state has changed. The intent will have the following
14     * extra values:</p>
15     * <ul>
16     *   <li><em>phoneName</em> - A string version of the phone name.</li>
17     *   <li><em>state</em> - A string version of the new phone state.</li>
18     * </ul>
19     *
20     * <p class="note">
21     * You can <em>not</em> receive this through components declared
22     * in manifests, only by exlicitly registering for it with
23     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
24     * android.content.IntentFilter) Context.registerReceiver()}.
25     *
26     * <p class="note">
27     * Requires the READ_PHONE_STATE permission.
28     */
29    public static final String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE";
30
31
32    /**
33     * Broadcast Action: The phone service state has changed. The intent will have the following
34     * extra values:</p>
35     * <ul>
36     *   <li><em>state</em> - An int with one of the following values:
37     *          {@link android.telephony.ServiceState#STATE_IN_SERVICE},
38     *          {@link android.telephony.ServiceState#STATE_OUT_OF_SERVICE},
39     *          {@link android.telephony.ServiceState#STATE_EMERGENCY_ONLY}
40     *          or {@link android.telephony.ServiceState#STATE_POWER_OFF}
41     *   <li><em>roaming</em> - A boolean value indicating whether the phone is roaming.</li>
42     *   <li><em>operator-alpha-long</em> - The carrier name as a string.</li>
43     *   <li><em>operator-alpha-short</em> - A potentially shortened version of the carrier name,
44     *          as a string.</li>
45     *   <li><em>operator-numeric</em> - A number representing the carrier, as a string. This is
46     *          a five or six digit number consisting of the MCC (Mobile Country Code, 3 digits)
47     *          and MNC (Mobile Network code, 2-3 digits).</li>
48     *   <li><em>manual</em> - A boolean, where true indicates that the user has chosen to select
49     *          the network manually, and false indicates that network selection is handled by the
50     *          phone.</li>
51     * </ul>
52     *
53     * <p class="note">
54     * Requires the READ_PHONE_STATE permission.
55     */
56    public static final String ACTION_SERVICE_STATE_CHANGED = "android.intent.action.SERVICE_STATE";
57
58
59    /**
60     * Broadcast Action: The phone's signal strength has changed. The intent will have the
61     * following extra values:</p>
62     * <ul>
63     *   <li><em>phoneName</em> - A string version of the phone name.</li>
64     *   <li><em>asu</em> - A numeric value for the signal strength.
65     *          An ASU is 0-31 or -1 if unknown (for GSM, dBm = -113 - 2 * asu).
66     *          The following special values are defined:
67     *          <ul><li>0 means "-113 dBm or less".</li><li>31 means "-51 dBm or greater".</li></ul>
68     *   </li>
69     * </ul>
70     *
71     * <p class="note">
72     * You can <em>not</em> receive this through components declared
73     * in manifests, only by exlicitly registering for it with
74     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
75     * android.content.IntentFilter) Context.registerReceiver()}.
76     *
77     * <p class="note">
78     * Requires the READ_PHONE_STATE permission.
79     */
80    public static final String ACTION_SIGNAL_STRENGTH_CHANGED = "android.intent.action.SIG_STR";
81
82
83    /**
84     * Broadcast Action: The data connection state has changed for any one of the
85     * phone's mobile data connections (eg, default, MMS or GPS specific connection).
86     * The intent will have the following extra values:</p>
87     * <ul>
88     *   <li><em>phoneName</em> - A string version of the phone name.</li>
89     *   <li><em>state</em> - One of <code>"CONNECTED"</code>
90     *      <code>"CONNECTING"</code> or <code>"DISCONNNECTED"</code></li>
91     *   <li><em>apn</em> - A string that is the APN associated with this
92     *      connection.</li>
93     *   <li><em>apnType</em> - A string array of APN types associated with
94     *      this connection.  The APN type <code>"*"</code> is a special
95     *      type that means this APN services all types.</li>
96     * </ul>
97     *
98     * <p class="note">
99     * Requires the READ_PHONE_STATE permission.
100     */
101    public static final String ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
102            = "android.intent.action.ANY_DATA_STATE";
103
104
105    /**
106     * Broadcast Action: An attempt to establish a data connection has failed.
107     * The intent will have the following extra values:</p>
108     * <ul>
109     *   <li><em>phoneName</em> &mdash A string version of the phone name.</li>
110     *   <li><em>state</em> &mdash; One of <code>"CONNECTED"</code>
111     *      <code>"CONNECTING"</code> or <code>"DISCONNNECTED"</code></li>
112     * <li><em>reason</em> &mdash; A string indicating the reason for the failure, if available</li>
113     * </ul>
114     *
115     * <p class="note">
116     * Requires the READ_PHONE_STATE permission.
117     */
118    public static final String ACTION_DATA_CONNECTION_FAILED
119            = "android.intent.action.DATA_CONNECTION_FAILED";
120
121
122    /**
123     * Broadcast Action: The sim card state has changed.
124     * The intent will have the following extra values:</p>
125     * <ul>
126     *   <li><em>phoneName</em> - A string version of the phone name.</li>
127     *   <li><em>ss</em> - The sim state.  One of
128     *   <code>"ABSENT"</code> <code>"LOCKED"</code>
129     *   <code>"READY"</code> <code>"ISMI"</code> <code>"LOADED"</code> </li>
130     *   <li><em>reason</em> - The reason while ss is LOCKED, otherwise is null
131     *   <code>"PIN"</code> locked on PIN1
132     *   <code>"PUK"</code> locked on PUK1
133     *   <code>"NETWORK"</code> locked on Network Personalization </li>
134     * </ul>
135     *
136     * <p class="note">
137     * Requires the READ_PHONE_STATE permission.
138     */
139    public static final String ACTION_SIM_STATE_CHANGED
140            = "android.intent.action.SIM_STATE_CHANGED";
141
142
143    /**
144     * Broadcast Action: The time was set by the carrier (typically by the NITZ string).
145     * This is a sticky broadcast.
146     * The intent will have the following extra values:</p>
147     * <ul>
148     *   <li><em>time</em> - The time as a long in UTC milliseconds.</li>
149     * </ul>
150     *
151     * <p class="note">
152     * Requires the READ_PHONE_STATE permission.
153     */
154    public static final String ACTION_NETWORK_SET_TIME = "android.intent.action.NETWORK_SET_TIME";
155
156
157    /**
158     * Broadcast Action: The timezone was set by the carrier (typically by the NITZ string).
159     * This is a sticky broadcast.
160     * The intent will have the following extra values:</p>
161     * <ul>
162     *   <li><em>time-zone</em> - The java.util.TimeZone.getID() value identifying the new time
163     *          zone.</li>
164     * </ul>
165     *
166     * <p class="note">
167     * Requires the READ_PHONE_STATE permission.
168     */
169    public static final String ACTION_NETWORK_SET_TIMEZONE
170            = "android.intent.action.NETWORK_SET_TIMEZONE";
171}
172