TelephonyIntents.java revision 2af2d57d578e0c3a2740628e7c6336b19961cc49
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
17package com.android.internal.telephony;
18
19import android.content.Intent;
20
21/**
22 * The intents that the telephony services broadcast.
23 *
24 * <p class="warning">
25 * THESE ARE NOT THE API!  Use the {@link android.telephony.TelephonyManager} class.
26 * DON'T LISTEN TO THESE DIRECTLY.
27 */
28public class TelephonyIntents {
29
30    /**
31     * Broadcast Action: The phone service state has changed. The intent will have the following
32     * extra values:</p>
33     * <ul>
34     *   <li><em>state</em> - An int with one of the following values:
35     *          {@link android.telephony.ServiceState#STATE_IN_SERVICE},
36     *          {@link android.telephony.ServiceState#STATE_OUT_OF_SERVICE},
37     *          {@link android.telephony.ServiceState#STATE_EMERGENCY_ONLY}
38     *          or {@link android.telephony.ServiceState#STATE_POWER_OFF}
39     *   <li><em>roaming</em> - A boolean value indicating whether the phone is roaming.</li>
40     *   <li><em>operator-alpha-long</em> - The carrier name as a string.</li>
41     *   <li><em>operator-alpha-short</em> - A potentially shortened version of the carrier name,
42     *          as a string.</li>
43     *   <li><em>operator-numeric</em> - A number representing the carrier, as a string. This is
44     *          a five or six digit number consisting of the MCC (Mobile Country Code, 3 digits)
45     *          and MNC (Mobile Network code, 2-3 digits).</li>
46     *   <li><em>manual</em> - A boolean, where true indicates that the user has chosen to select
47     *          the network manually, and false indicates that network selection is handled by the
48     *          phone.</li>
49     * </ul>
50     *
51     * <p class="note">
52     * Requires the READ_PHONE_STATE permission.
53     *
54     * <p class="note">This is a protected intent that can only be sent
55     * by the system.
56     */
57    public static final String ACTION_SERVICE_STATE_CHANGED = "android.intent.action.SERVICE_STATE";
58
59    /**
60     * <p>Broadcast Action: The radio technology has changed. The intent will have the following
61     * extra values:</p>
62     * <ul>
63     *   <li><em>phoneName</em> - A string version of the new phone name.</li>
64     * </ul>
65     *
66     * <p class="note">
67     * You can <em>not</em> receive this through components declared
68     * in manifests, only by explicitly registering for it with
69     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
70     * android.content.IntentFilter) Context.registerReceiver()}.
71     *
72     * <p class="note">
73     * Requires no permission.
74     *
75     * <p class="note">This is a protected intent that can only be sent
76     * by the system.
77     */
78    public static final String ACTION_RADIO_TECHNOLOGY_CHANGED
79            = "android.intent.action.RADIO_TECHNOLOGY";
80    /**
81     * <p>Broadcast Action: The emergency callback mode is changed.
82     * <ul>
83     *   <li><em>phoneinECMState</em> - A boolean value,true=phone in ECM, false=ECM off</li>
84     * </ul>
85     * <p class="note">
86     * You can <em>not</em> receive this through components declared
87     * in manifests, only by explicitly registering for it with
88     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
89     * android.content.IntentFilter) Context.registerReceiver()}.
90     *
91     * <p class="note">
92     * Requires no permission.
93     *
94     * <p class="note">This is a protected intent that can only be sent
95     * by the system.
96     */
97    public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED
98            = "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
99    /**
100     * Broadcast Action: The phone's signal strength has changed. The intent will have the
101     * following extra values:</p>
102     * <ul>
103     *   <li><em>phoneName</em> - A string version of the phone name.</li>
104     *   <li><em>asu</em> - A numeric value for the signal strength.
105     *          An ASU is 0-31 or -1 if unknown (for GSM, dBm = -113 - 2 * asu).
106     *          The following special values are defined:
107     *          <ul><li>0 means "-113 dBm or less".</li><li>31 means "-51 dBm or greater".</li></ul>
108     *   </li>
109     * </ul>
110     *
111     * <p class="note">
112     * You can <em>not</em> receive this through components declared
113     * in manifests, only by exlicitly registering for it with
114     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
115     * android.content.IntentFilter) Context.registerReceiver()}.
116     *
117     * <p class="note">
118     * Requires the READ_PHONE_STATE permission.
119     *
120     * <p class="note">This is a protected intent that can only be sent
121     * by the system.
122     */
123    public static final String ACTION_SIGNAL_STRENGTH_CHANGED = "android.intent.action.SIG_STR";
124
125
126    /**
127     * Broadcast Action: The data connection state has changed for any one of the
128     * phone's mobile data connections (eg, default, MMS or GPS specific connection).
129     * The intent will have the following extra values:</p>
130     * <dl>
131     *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
132     *   <dt>state</dt><dd>One of {@code CONNECTED}, {@code CONNECTING},
133     *      or {@code DISCONNECTED}.</dd>
134     *   <dt>apn</dt><dd>A string that is the APN associated with this connection.</dd>
135     *   <dt>apnType</dt><dd>A string array of APN types associated with this connection.
136     *      The APN type {@code *} is a special type that means this APN services all types.</dd>
137     * </dl>
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     * <dl>
153     *   <dt>apn</dt><dd>A string that is the APN associated with this connection.</dd>
154     *   <dt>apnType</dt><dd>A string array of APN types associated with this connection.
155     *      The APN type {@code *} is a special type that means this APN services all types.</dd>
156     *   <dt>linkProperties</dt><dd>{@code LinkProperties} for this APN.</dd>
157     *   <dt>linkCapabilities</dt><dd>The {@code LinkCapabilities} for this APN.</dd>
158     *   <dt>iface</dt><dd>A string that is the name of the interface.</dd>
159     * </dl>
160     *
161     * <p class="note">
162     * Requires the READ_PHONE_STATE permission.
163     *
164     * <p class="note">This is a protected intent that can only be sent
165     * by the system.
166     */
167    public static final String ACTION_DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN
168            = "android.intent.action.DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN";
169
170    /**
171     * Broadcast Action: An attempt to establish a data connection has failed.
172     * The intent will have the following extra values:</p>
173     * <dl>
174     *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
175     *   <dt>state</dt><dd>One of {@code CONNECTED}, {@code CONNECTING}, or {code DISCONNECTED}.</dd>
176     *   <dt>reason</dt><dd>A string indicating the reason for the failure, if available.</dd>
177     * </dl>
178     *
179     * <p class="note">
180     * Requires the READ_PHONE_STATE permission.
181     *
182     * <p class="note">This is a protected intent that can only be sent
183     * by the system.
184     */
185    public static final String ACTION_DATA_CONNECTION_FAILED
186            = "android.intent.action.DATA_CONNECTION_FAILED";
187
188
189    /**
190     * Broadcast Action: The sim card state has changed.
191     * The intent will have the following extra values:</p>
192     * <dl>
193     *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
194     *   <dt>ss</dt><dd>The sim state. One of:
195     *     <dl>
196     *       <dt>{@code ABSENT}</dt><dd>SIM card not found</dd>
197     *       <dt>{@code LOCKED}</dt><dd>SIM card locked (see {@code reason})</dd>
198     *       <dt>{@code READY}</dt><dd>SIM card ready</dd>
199     *       <dt>{@code IMSI}</dt><dd>FIXME: what is this state?</dd>
200     *       <dt>{@code LOADED}</dt><dd>SIM card data loaded</dd>
201     *     </dl></dd>
202     *   <dt>reason</dt><dd>The reason why ss is {@code LOCKED}; null otherwise.</dd>
203     *   <dl>
204     *       <dt>{@code PIN}</dt><dd>locked on PIN1</dd>
205     *       <dt>{@code PUK}</dt><dd>locked on PUK1</dd>
206     *       <dt>{@code NETWORK}</dt><dd>locked on network personalization</dd>
207     *   </dl>
208     * </dl>
209     *
210     * <p class="note">
211     * Requires the READ_PHONE_STATE permission.
212     *
213     * <p class="note">This is a protected intent that can only be sent
214     * by the system.
215     */
216    public static final String ACTION_SIM_STATE_CHANGED
217            = "android.intent.action.SIM_STATE_CHANGED";
218
219
220    /**
221     * Broadcast Action: The time was set by the carrier (typically by the NITZ string).
222     * This is a sticky broadcast.
223     * The intent will have the following extra values:</p>
224     * <ul>
225     *   <li><em>time</em> - The time as a long in UTC milliseconds.</li>
226     * </ul>
227     *
228     * <p class="note">
229     * Requires the READ_PHONE_STATE permission.
230     *
231     * <p class="note">This is a protected intent that can only be sent
232     * by the system.
233     */
234    public static final String ACTION_NETWORK_SET_TIME = "android.intent.action.NETWORK_SET_TIME";
235
236
237    /**
238     * Broadcast Action: The timezone was set by the carrier (typically by the NITZ string).
239     * This is a sticky broadcast.
240     * The intent will have the following extra values:</p>
241     * <ul>
242     *   <li><em>time-zone</em> - The java.util.TimeZone.getID() value identifying the new time
243     *          zone.</li>
244     * </ul>
245     *
246     * <p class="note">
247     * Requires the READ_PHONE_STATE permission.
248     *
249     * <p class="note">This is a protected intent that can only be sent
250     * by the system.
251     */
252    public static final String ACTION_NETWORK_SET_TIMEZONE
253            = "android.intent.action.NETWORK_SET_TIMEZONE";
254
255    /**
256     * <p>Broadcast Action: It indicates the Emergency callback mode blocks datacall/sms
257     * <p class="note">.
258     * This is to pop up a notice to show user that the phone is in emergency callback mode
259     * and atacalls and outgoing sms are blocked.
260     *
261     * <p class="note">This is a protected intent that can only be sent
262     * by the system.
263     */
264    public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS
265            = "android.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS";
266
267    /**
268     * Activity Action: Start this activity to invoke the carrier setup app.
269     * The carrier app must be signed using a certificate that matches the UICC access rules.
270     *
271     * <p class="note">Callers of this should hold the android.permission.INVOKE_CARRIER_SETUP
272     * permission.</p>
273     */
274    public static final String ACTION_CARRIER_SETUP = "android.intent.action.ACTION_CARRIER_SETUP";
275
276    /**
277     * Broadcast Action: A "secret code" has been entered in the dialer. Secret codes are
278     * of the form {@code *#*#<code>#*#*}. The intent will have the data URI:
279     *
280     * {@code android_secret_code://<code>}
281     */
282    public static final String SECRET_CODE_ACTION = "android.provider.Telephony.SECRET_CODE";
283
284    /**
285     * Broadcast Action: The Service Provider string(s) have been updated.  Activities or
286     * services that use these strings should update their display.
287     * The intent will have the following extra values:</p>
288     *
289     * <dl>
290     *   <dt>showPlmn</dt><dd>Boolean that indicates whether the PLMN should be shown.</dd>
291     *   <dt>plmn</dt><dd>The operator name of the registered network, as a string.</dd>
292     *   <dt>showSpn</dt><dd>Boolean that indicates whether the SPN should be shown.</dd>
293     *   <dt>spn</dt><dd>The service provider name, as a string.</dd>
294     * </dl>
295     *
296     * Note that <em>showPlmn</em> may indicate that <em>plmn</em> should be displayed, even
297     * though the value for <em>plmn</em> is null.  This can happen, for example, if the phone
298     * has not registered to a network yet.  In this case the receiver may substitute an
299     * appropriate placeholder string (eg, "No service").
300     *
301     * It is recommended to display <em>plmn</em> before / above <em>spn</em> if
302     * both are displayed.
303     *
304     * <p>Note: this is a protected intent that can only be sent by the system.
305     */
306    public static final String SPN_STRINGS_UPDATED_ACTION =
307            "android.provider.Telephony.SPN_STRINGS_UPDATED";
308
309    public static final String EXTRA_SHOW_PLMN  = "showPlmn";
310    public static final String EXTRA_PLMN       = "plmn";
311    public static final String EXTRA_SHOW_SPN   = "showSpn";
312    public static final String EXTRA_SPN        = "spn";
313
314    /**
315     * <p>Broadcast Action: It indicates one column of a siminfo record has been changed
316     * The intent will have the following extra values:</p>
317     * <ul>
318     *   <li><em>columnName</em> - The siminfo column that is updated.</li>
319     *   <li><em>stringContent</em> - The string value of the updated column.</li>
320     *   <li><em>intContent</em> - The int value of the updated column.</li>
321     * </ul>
322     * <p class="note">This is a protected intent that can only be sent
323     * by the system.
324     */
325    public static final String ACTION_SIMINFO_CONTENT_CHANGE
326            = "android.intent.action.ACTION_SIMINFO_CONTENT_CHANGE";
327
328    /**
329     * <p>Broadcast Action: It indicates one column of a subinfo record has been changed
330     * The intent will have the following extra values:</p>
331     * <ul>
332     *   <li><em>columnName</em> - The siminfo column that is updated.</li>
333     *   <li><em>stringContent</em> - The string value of the updated column.</li>
334     *   <li><em>intContent</em> - The int value of the updated column.</li>
335     * </ul>
336     * <p class="note">This is a protected intent that can only be sent
337     * by the system.
338     */
339    public static final String ACTION_SUBINFO_CONTENT_CHANGE
340            = "android.intent.action.ACTION_SUBINFO_CONTENT_CHANGE";
341
342    /**
343     * <p>Broadcast Action: It indicates siminfo update is completed when SIM inserted state change
344     * The intent will have the following extra values:</p>
345     * <p class="note">This is a protected intent that can only be sent
346     * by the system.
347     */
348    public static final String ACTION_SIMINFO_UPDATED
349            = "android.intent.action.ACTION_SIMINFO_UPDATED";
350
351    /**
352     * <p>Broadcast Action: It indicates subinfo record update is completed
353     * when SIM inserted state change
354     * The intent will have the following extra values:</p>
355     * <p class="note">This is a protected intent that can only be sent
356     * by the system.
357     */
358    public static final String ACTION_SUBINFO_RECORD_UPDATED
359            = "android.intent.action.ACTION_SUBINFO_RECORD_UPDATED";
360
361    public static final String EXTRA_COLUMN_NAME = "columnName";
362    public static final String EXTRA_INT_CONTENT = "intContent";
363    public static final String EXTRA_STRING_CONTENT = "stringContent";
364
365    /**
366     * Broadcast Action: The default subscription has changed.  This has the following
367     * extra values:</p>
368     * <ul>
369     *   <li><em>subscription</em> - A int, the current default subscription.</li>
370     * </ul>
371     */
372    public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED
373            = "android.intent.action.ACTION_DEFAULT_SUBSCRIPTION_CHANGED";
374
375    /**
376     * Broadcast Action: The default data subscription has changed.  This has the following
377     * extra values:</p>
378     * <ul>
379     *   <li><em>subscription</em> - A int, the current data default subscription.</li>
380     * </ul>
381     */
382    public static final String ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED
383            = "android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED";
384
385    /**
386     * Broadcast Action: The default voice subscription has changed.  This has the following
387     * extra values:</p>
388     * <ul>
389     *   <li><em>subscription</em> - A int, the current voice default subscription.</li>
390     * </ul>
391     */
392    public static final String ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED
393            = "android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED";
394
395    /**
396     * Broadcast Action: The default sms subscription has changed.  This has the following
397     * extra values:</p>
398     * <ul>
399     *   <li><em>subscription</em> - A int, the current sms default subscription.</li>
400     * </ul>
401     */
402    public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED
403            = "android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED";
404
405    /*
406     * Broadcast Action: An attempt to set phone radio type and access technology has changed.
407     * This has the following extra values:
408     * <ul>
409     *   <li><em>phones radio access family </em> - A RadioAccessFamily
410     *   array, contain phone ID and new radio access family for each phone.</li>
411     * </ul>
412     */
413    public static final String ACTION_SET_RADIO_CAPABILITY_DONE =
414            "android.intent.action.ACTION_SET_RADIO_CAPABILITY_DONE";
415
416    public static final String EXTRA_RADIO_ACCESS_FAMILY = "rafs";
417
418    /*
419     * Broadcast Action: An attempt to set phone radio access family has failed.
420     */
421    public static final String ACTION_SET_RADIO_CAPABILITY_FAILED =
422            "android.intent.action.ACTION_SET_RADIO_CAPABILITY_FAILED";
423}
424