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      * <dl>
129      *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
130      *   <dt>state</dt><dd>One of {@code CONNECTED}, {@code CONNECTING},
131      *      or {@code DISCONNECTED}.</dd>
132      *   <dt>apn</dt><dd>A string that is the APN associated with this connection.</dd>
133      *   <dt>apnType</dt><dd>A string array of APN types associated with this connection.
134      *      The APN type {@code *} is a special type that means this APN services all types.</dd>
135      * </dl>
136      *
137      * <p class="note">
138      * Requires the READ_PHONE_STATE permission.
139      *
140      * <p class="note">This is a protected intent that can only be sent
141      * by the system.
142      */
143     public static final String ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
144             = "android.intent.action.ANY_DATA_STATE";
145 
146     /**
147      * Broadcast Action: Occurs when a data connection connects to a provisioning apn
148      * and is broadcast by the low level data connection code.
149      * The intent will have the following extra values:</p>
150      * <dl>
151      *   <dt>apn</dt><dd>A string that is the APN associated with this connection.</dd>
152      *   <dt>apnType</dt><dd>A string array of APN types associated with this connection.
153      *      The APN type {@code *} is a special type that means this APN services all types.</dd>
154      *   <dt>linkProperties</dt><dd>{@code LinkProperties} for this APN.</dd>
155      *   <dt>linkCapabilities</dt><dd>The {@code LinkCapabilities} for this APN.</dd>
156      *   <dt>iface</dt><dd>A string that is the name of the interface.</dd>
157      * </dl>
158      *
159      * <p class="note">
160      * Requires the READ_PHONE_STATE permission.
161      *
162      * <p class="note">This is a protected intent that can only be sent
163      * by the system.
164      */
165     public static final String ACTION_DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN
166             = "android.intent.action.DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN";
167 
168     /**
169      * Broadcast Action: An attempt to establish a data connection has failed.
170      * The intent will have the following extra values:</p>
171      * <dl>
172      *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
173      *   <dt>state</dt><dd>One of {@code CONNECTED}, {@code CONNECTING}, or {code DISCONNECTED}.</dd>
174      *   <dt>reason</dt><dd>A string indicating the reason for the failure, if available.</dd>
175      * </dl>
176      *
177      * <p class="note">
178      * Requires the READ_PHONE_STATE permission.
179      *
180      * <p class="note">This is a protected intent that can only be sent
181      * by the system.
182      */
183     public static final String ACTION_DATA_CONNECTION_FAILED
184             = "android.intent.action.DATA_CONNECTION_FAILED";
185 
186 
187     /**
188      * Broadcast Action: The sim card state has changed.
189      * The intent will have the following extra values:</p>
190      * <dl>
191      *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
192      *   <dt>ss</dt><dd>The sim state. One of:
193      *     <dl>
194      *       <dt>{@code ABSENT}</dt><dd>SIM card not found</dd>
195      *       <dt>{@code LOCKED}</dt><dd>SIM card locked (see {@code reason})</dd>
196      *       <dt>{@code READY}</dt><dd>SIM card ready</dd>
197      *       <dt>{@code IMSI}</dt><dd>FIXME: what is this state?</dd>
198      *       <dt>{@code LOADED}</dt><dd>SIM card data loaded</dd>
199      *     </dl></dd>
200      *   <dt>reason</dt><dd>The reason why ss is {@code LOCKED}; null otherwise.</dd>
201      *   <dl>
202      *       <dt>{@code PIN}</dt><dd>locked on PIN1</dd>
203      *       <dt>{@code PUK}</dt><dd>locked on PUK1</dd>
204      *       <dt>{@code NETWORK}</dt><dd>locked on network personalization</dd>
205      *   </dl>
206      * </dl>
207      *
208      * <p class="note">
209      * Requires the READ_PHONE_STATE permission.
210      *
211      * <p class="note">This is a protected intent that can only be sent
212      * by the system.
213      */
214     public static final String ACTION_SIM_STATE_CHANGED
215             = "android.intent.action.SIM_STATE_CHANGED";
216 
217 
218     /**
219      * Broadcast Action: The time was set by the carrier (typically by the NITZ string).
220      * This is a sticky broadcast.
221      * The intent will have the following extra values:</p>
222      * <ul>
223      *   <li><em>time</em> - The time as a long in UTC milliseconds.</li>
224      * </ul>
225      *
226      * <p class="note">
227      * Requires the READ_PHONE_STATE permission.
228      *
229      * <p class="note">This is a protected intent that can only be sent
230      * by the system.
231      */
232     public static final String ACTION_NETWORK_SET_TIME = "android.intent.action.NETWORK_SET_TIME";
233 
234 
235     /**
236      * Broadcast Action: The timezone was set by the carrier (typically by the NITZ string).
237      * This is a sticky broadcast.
238      * The intent will have the following extra values:</p>
239      * <ul>
240      *   <li><em>time-zone</em> - The java.util.TimeZone.getID() value identifying the new time
241      *          zone.</li>
242      * </ul>
243      *
244      * <p class="note">
245      * Requires the READ_PHONE_STATE permission.
246      *
247      * <p class="note">This is a protected intent that can only be sent
248      * by the system.
249      */
250     public static final String ACTION_NETWORK_SET_TIMEZONE
251             = "android.intent.action.NETWORK_SET_TIMEZONE";
252 
253     /**
254      * <p>Broadcast Action: It indicates the Emergency callback mode blocks datacall/sms
255      * <p class="note">.
256      * This is to pop up a notice to show user that the phone is in emergency callback mode
257      * and atacalls and outgoing sms are blocked.
258      *
259      * <p class="note">This is a protected intent that can only be sent
260      * by the system.
261      */
262     public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS
263             = "android.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS";
264 
265     /**
266      * Activity Action: Start this activity to invoke the carrier setup app.
267      * The carrier app must be signed using a certificate that matches the UICC access rules.
268      *
269      * <p class="note">Callers of this should hold the android.permission.INVOKE_CARRIER_SETUP
270      * permission.</p>
271      */
272     public static final String ACTION_CARRIER_SETUP = "android.intent.action.ACTION_CARRIER_SETUP";
273 
274     /**
275      * <p>Broadcast Action: Indicates that the action is forbidden by network.
276      * <p class="note">
277      * This is for the OEM applications to understand about possible provisioning issues.
278      * Used in OMA-DM applications.
279      */
280     public static final String ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION
281             = "android.intent.action.ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION";
282 
283     /**
284      * Broadcast Action: A "secret code" has been entered in the dialer. Secret codes are
285      * of the form {@code *#*#<code>#*#*}. The intent will have the data URI:
286      *
287      * {@code android_secret_code://<code>}
288      */
289     public static final String SECRET_CODE_ACTION = "android.provider.Telephony.SECRET_CODE";
290 
291     /**
292      * Broadcast Action: The Service Provider string(s) have been updated.  Activities or
293      * services that use these strings should update their display.
294      * The intent will have the following extra values:</p>
295      *
296      * <dl>
297      *   <dt>showPlmn</dt><dd>Boolean that indicates whether the PLMN should be shown.</dd>
298      *   <dt>plmn</dt><dd>The operator name of the registered network, as a string.</dd>
299      *   <dt>showSpn</dt><dd>Boolean that indicates whether the SPN should be shown.</dd>
300      *   <dt>spn</dt><dd>The service provider name, as a string.</dd>
301      * </dl>
302      *
303      * Note that <em>showPlmn</em> may indicate that <em>plmn</em> should be displayed, even
304      * though the value for <em>plmn</em> is null.  This can happen, for example, if the phone
305      * has not registered to a network yet.  In this case the receiver may substitute an
306      * appropriate placeholder string (eg, "No service").
307      *
308      * It is recommended to display <em>plmn</em> before / above <em>spn</em> if
309      * both are displayed.
310      *
311      * <p>Note: this is a protected intent that can only be sent by the system.
312      */
313     public static final String SPN_STRINGS_UPDATED_ACTION =
314             "android.provider.Telephony.SPN_STRINGS_UPDATED";
315 
316     public static final String EXTRA_SHOW_PLMN  = "showPlmn";
317     public static final String EXTRA_PLMN       = "plmn";
318     public static final String EXTRA_SHOW_SPN   = "showSpn";
319     public static final String EXTRA_SPN        = "spn";
320     public static final String EXTRA_DATA_SPN   = "spnData";
321 
322     /**
323      * <p>Broadcast Action: It indicates one column of a subinfo record has been changed
324      * <p class="note">This is a protected intent that can only be sent
325      * by the system.
326      */
327     public static final String ACTION_SUBINFO_CONTENT_CHANGE
328             = "android.intent.action.ACTION_SUBINFO_CONTENT_CHANGE";
329 
330     /**
331      * <p>Broadcast Action: It indicates subinfo record update is completed
332      * when SIM inserted state change
333      * <p class="note">This is a protected intent that can only be sent
334      * by the system.
335      */
336     public static final String ACTION_SUBINFO_RECORD_UPDATED
337             = "android.intent.action.ACTION_SUBINFO_RECORD_UPDATED";
338 
339     /**
340      * Broadcast Action: The default subscription has changed.  This has the following
341      * extra values:</p>
342      * <ul>
343      *   <li><em>subscription</em> - A int, the current default subscription.</li>
344      * </ul>
345      */
346     public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED
347             = "android.intent.action.ACTION_DEFAULT_SUBSCRIPTION_CHANGED";
348 
349     /**
350      * Broadcast Action: The default data subscription has changed.  This has the following
351      * extra values:</p>
352      * <ul>
353      *   <li><em>subscription</em> - A int, the current data default subscription.</li>
354      * </ul>
355      */
356     public static final String ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED
357             = "android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED";
358 
359     /**
360      * Broadcast Action: The default voice subscription has changed.  This has the following
361      * extra values:</p>
362      * <ul>
363      *   <li><em>subscription</em> - A int, the current voice default subscription.</li>
364      * </ul>
365      */
366     public static final String ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED
367             = "android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED";
368 
369     /**
370      * Broadcast Action: The default sms subscription has changed.  This has the following
371      * extra values:</p>
372      * <ul>
373      *   <li><em>subscription</em> - A int, the current sms default subscription.</li>
374      * </ul>
375      */
376     public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED
377             = "android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED";
378 
379     /*
380      * Broadcast Action: An attempt to set phone radio type and access technology has changed.
381      * This has the following extra values:
382      * <ul>
383      *   <li><em>phones radio access family </em> - A RadioAccessFamily
384      *   array, contain phone ID and new radio access family for each phone.</li>
385      * </ul>
386      */
387     public static final String ACTION_SET_RADIO_CAPABILITY_DONE =
388             "android.intent.action.ACTION_SET_RADIO_CAPABILITY_DONE";
389 
390     public static final String EXTRA_RADIO_ACCESS_FAMILY = "rafs";
391 
392     /*
393      * Broadcast Action: An attempt to set phone radio access family has failed.
394      */
395     public static final String ACTION_SET_RADIO_CAPABILITY_FAILED =
396             "android.intent.action.ACTION_SET_RADIO_CAPABILITY_FAILED";
397 }
398