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;
20import android.telephony.SubscriptionManager;
21
22/**
23 * The intents that the telephony services broadcast.
24 *
25 * <p class="warning">
26 * THESE ARE NOT THE API!  Use the {@link android.telephony.TelephonyManager} class.
27 * DON'T LISTEN TO THESE DIRECTLY.
28 */
29public class TelephonyIntents {
30
31    /**
32     * Broadcast Action: The phone service state has changed. The intent will have the following
33     * extra values:</p>
34     * <ul>
35     *   <li><em>state</em> - An int with one of the following values:
36     *          {@link android.telephony.ServiceState#STATE_IN_SERVICE},
37     *          {@link android.telephony.ServiceState#STATE_OUT_OF_SERVICE},
38     *          {@link android.telephony.ServiceState#STATE_EMERGENCY_ONLY}
39     *          or {@link android.telephony.ServiceState#STATE_POWER_OFF}
40     *   <li><em>roaming</em> - A boolean value indicating whether the phone is roaming.</li>
41     *   <li><em>operator-alpha-long</em> - The carrier name as a string.</li>
42     *   <li><em>operator-alpha-short</em> - A potentially shortened version of the carrier name,
43     *          as a string.</li>
44     *   <li><em>operator-numeric</em> - A number representing the carrier, as a string. This is
45     *          a five or six digit number consisting of the MCC (Mobile Country Code, 3 digits)
46     *          and MNC (Mobile Network code, 2-3 digits).</li>
47     *   <li><em>manual</em> - A boolean, where true indicates that the user has chosen to select
48     *          the network manually, and false indicates that network selection is handled by the
49     *          phone.</li>
50     * </ul>
51     *
52     * <p class="note">
53     * Requires the READ_PHONE_STATE permission.
54     *
55     * <p class="note">This is a protected intent that can only be sent
56     * by the system.
57     * @deprecated use {@link Intent#ACTION_SERVICE_STATE}
58     */
59    public static final String ACTION_SERVICE_STATE_CHANGED = Intent.ACTION_SERVICE_STATE;
60
61    /**
62     * <p>Broadcast Action: The radio technology has changed. The intent will have the following
63     * extra values:</p>
64     * <ul>
65     *   <li><em>phoneName</em> - A string version of the new phone name.</li>
66     * </ul>
67     *
68     * <p class="note">
69     * You can <em>not</em> receive this through components declared
70     * in manifests, only by explicitly registering for it with
71     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
72     * android.content.IntentFilter) Context.registerReceiver()}.
73     *
74     * <p class="note">
75     * Requires no permission.
76     *
77     * <p class="note">This is a protected intent that can only be sent
78     * by the system.
79     */
80    public static final String ACTION_RADIO_TECHNOLOGY_CHANGED
81            = "android.intent.action.RADIO_TECHNOLOGY";
82
83    /**
84     * <p>Broadcast Action: The emergency callback mode is changed.
85     * <ul>
86     *   <li><em>phoneinECMState</em> - A boolean value,true=phone in ECM, false=ECM off</li>
87     * </ul>
88     * <p class="note">
89     * You can <em>not</em> receive this through components declared
90     * in manifests, only by explicitly registering for it with
91     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
92     * android.content.IntentFilter) Context.registerReceiver()}.
93     *
94     * <p class="note">
95     * Requires no permission.
96     *
97     * <p class="note">This is a protected intent that can only be sent
98     * by the system.
99     */
100    public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED
101            = "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
102
103    /**
104     * <p>Broadcast Action: The emergency call state is changed.
105     * <ul>
106     *   <li><em>phoneInEmergencyCall</em> - A boolean value, true if phone in emergency call,
107     *   false otherwise</li>
108     * </ul>
109     * <p class="note">
110     * You can <em>not</em> receive this through components declared
111     * in manifests, only by explicitly 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 no 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_EMERGENCY_CALL_STATE_CHANGED
122            = "android.intent.action.EMERGENCY_CALL_STATE_CHANGED";
123
124    /**
125     * Broadcast Action: The phone's signal strength has changed. The intent will have the
126     * following extra values:</p>
127     * <ul>
128     *   <li><em>phoneName</em> - A string version of the phone name.</li>
129     *   <li><em>asu</em> - A numeric value for the signal strength.
130     *          An ASU is 0-31 or -1 if unknown (for GSM, dBm = -113 - 2 * asu).
131     *          The following special values are defined:
132     *          <ul><li>0 means "-113 dBm or less".</li><li>31 means "-51 dBm or greater".</li></ul>
133     *   </li>
134     * </ul>
135     *
136     * <p class="note">
137     * You can <em>not</em> receive this through components declared
138     * in manifests, only by exlicitly registering for it with
139     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
140     * android.content.IntentFilter) Context.registerReceiver()}.
141     *
142     * <p class="note">
143     * Requires the READ_PHONE_STATE permission.
144     *
145     * <p class="note">This is a protected intent that can only be sent
146     * by the system.
147     */
148    public static final String ACTION_SIGNAL_STRENGTH_CHANGED = "android.intent.action.SIG_STR";
149
150
151    /**
152     * Broadcast Action: The data connection state has changed for any one of the
153     * phone's mobile data connections (eg, default, MMS or GPS specific connection).
154     * The intent will have the following extra values:</p>
155     * <dl>
156     *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
157     *   <dt>state</dt><dd>One of {@code CONNECTED}, {@code CONNECTING},
158     *      or {@code DISCONNECTED}.</dd>
159     *   <dt>apn</dt><dd>A string that is the APN associated with this connection.</dd>
160     *   <dt>apnType</dt><dd>A string array of APN types associated with this connection.
161     *      The APN type {@code *} is a special type that means this APN services all types.</dd>
162     * </dl>
163     *
164     * <p class="note">
165     * Requires the READ_PHONE_STATE permission.
166     *
167     * <p class="note">This is a protected intent that can only be sent
168     * by the system.
169     */
170    public static final String ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
171            = "android.intent.action.ANY_DATA_STATE";
172
173    /**
174     * Broadcast Action: An attempt to establish a data connection has failed.
175     * The intent will have the following extra values:</p>
176     * <dl>
177     *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
178     *   <dt>state</dt><dd>One of {@code CONNECTED}, {@code CONNECTING}, or {code DISCONNECTED}.</dd>
179     *   <dt>reason</dt><dd>A string indicating the reason for the failure, if available.</dd>
180     * </dl>
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     * Broadcast Action: The sim card state has changed.
193     * The intent will have the following extra values:</p>
194     * <dl>
195     *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
196     *   <dt>ss</dt><dd>The sim state. One of:
197     *     <dl>
198     *       <dt>{@code ABSENT}</dt><dd>SIM card not found</dd>
199     *       <dt>{@code LOCKED}</dt><dd>SIM card locked (see {@code reason})</dd>
200     *       <dt>{@code READY}</dt><dd>SIM card ready</dd>
201     *       <dt>{@code IMSI}</dt><dd>FIXME: what is this state?</dd>
202     *       <dt>{@code LOADED}</dt><dd>SIM card data loaded</dd>
203     *     </dl></dd>
204     *   <dt>reason</dt><dd>The reason why ss is {@code LOCKED}; null otherwise.</dd>
205     *   <dl>
206     *       <dt>{@code PIN}</dt><dd>locked on PIN1</dd>
207     *       <dt>{@code PUK}</dt><dd>locked on PUK1</dd>
208     *       <dt>{@code NETWORK}</dt><dd>locked on network personalization</dd>
209     *   </dl>
210     *   <dt>rebroadcastOnUnlock</dt>
211     *   <dd>A boolean indicates a rebroadcast on unlock. optional extra, defaults to {@code false}
212     *   if not specified </dd>
213     * </dl>
214     *
215     * <p class="note">
216     * Requires the READ_PHONE_STATE permission.
217     *
218     * <p class="note">This is a protected intent that can only be sent
219     * by the system.
220     */
221    public static final String ACTION_SIM_STATE_CHANGED
222            = Intent.ACTION_SIM_STATE_CHANGED;
223
224    public static final String EXTRA_REBROADCAST_ON_UNLOCK= "rebroadcastOnUnlock";
225
226    /**
227     * Broadcast Action: The time was set by the carrier (typically by the NITZ string).
228     * This is a sticky broadcast.
229     * The intent will have the following extra values:</p>
230     * <ul>
231     *   <li><em>time</em> - The time as a long in UTC milliseconds.</li>
232     * </ul>
233     *
234     * <p class="note">
235     * Requires the READ_PHONE_STATE permission.
236     *
237     * <p class="note">This is a protected intent that can only be sent
238     * by the system.
239     */
240    public static final String ACTION_NETWORK_SET_TIME = "android.intent.action.NETWORK_SET_TIME";
241
242
243    /**
244     * Broadcast Action: The timezone was set by the carrier (typically by the NITZ string).
245     * This is a sticky broadcast.
246     * The intent will have the following extra values:</p>
247     * <ul>
248     *   <li><em>time-zone</em> - The java.util.TimeZone.getID() value identifying the new time
249     *          zone.</li>
250     * </ul>
251     *
252     * <p class="note">
253     * Requires the READ_PHONE_STATE permission.
254     *
255     * <p class="note">This is a protected intent that can only be sent
256     * by the system.
257     */
258    public static final String ACTION_NETWORK_SET_TIMEZONE
259            = "android.intent.action.NETWORK_SET_TIMEZONE";
260
261    /**
262     * <p>Broadcast Action: It indicates the Emergency callback mode blocks datacall/sms
263     * <p class="note">.
264     * This is to pop up a notice to show user that the phone is in emergency callback mode
265     * and atacalls and outgoing sms are blocked.
266     *
267     * <p class="note">This is a protected intent that can only be sent
268     * by the system.
269     */
270    public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS
271            = "com.android.internal.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS";
272
273    /**
274     * <p>Broadcast Action: Indicates that the action is forbidden by network.
275     * <p class="note">
276     * This is for the OEM applications to understand about possible provisioning issues.
277     * Used in OMA-DM applications.
278     */
279    public static final String ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION
280            = "com.android.internal.intent.action.ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION";
281
282    /**
283     * Broadcast Action: A "secret code" has been entered in the dialer. Secret codes are
284     * of the form {@code *#*#<code>#*#*}. The intent will have the data URI:
285     *
286     * {@code android_secret_code://<code>}
287     */
288    public static final String SECRET_CODE_ACTION = "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     *
295     * <dl>
296     *   <dt>showPlmn</dt><dd>Boolean that indicates whether the PLMN should be shown.</dd>
297     *   <dt>plmn</dt><dd>The operator name of the registered network, as a string.</dd>
298     *   <dt>showSpn</dt><dd>Boolean that indicates whether the SPN should be shown.</dd>
299     *   <dt>spn</dt><dd>The service provider name, as a string.</dd>
300     * </dl>
301     *
302     * Note that <em>showPlmn</em> may indicate that <em>plmn</em> should be displayed, even
303     * though the value for <em>plmn</em> is null.  This can happen, for example, if the phone
304     * has not registered to a network yet.  In this case the receiver may substitute an
305     * appropriate placeholder string (eg, "No service").
306     *
307     * It is recommended to display <em>plmn</em> before / above <em>spn</em> if
308     * both are displayed.
309     *
310     * <p>Note: this is a protected intent that can only be sent by the system.
311     */
312    public static final String SPN_STRINGS_UPDATED_ACTION =
313            "android.provider.Telephony.SPN_STRINGS_UPDATED";
314
315    public static final String EXTRA_SHOW_PLMN  = "showPlmn";
316    public static final String EXTRA_PLMN       = "plmn";
317    public static final String EXTRA_SHOW_SPN   = "showSpn";
318    public static final String EXTRA_SPN        = "spn";
319    public static final String EXTRA_DATA_SPN   = "spnData";
320
321    /**
322     * <p>Broadcast Action: It indicates one column of a subinfo record has been changed
323     * <p class="note">This is a protected intent that can only be sent
324     * by the system.
325     */
326    public static final String ACTION_SUBINFO_CONTENT_CHANGE
327            = "android.intent.action.ACTION_SUBINFO_CONTENT_CHANGE";
328
329    /**
330     * <p>Broadcast Action: It indicates subinfo record update is completed
331     * when SIM inserted state change
332     * <p class="note">This is a protected intent that can only be sent
333     * by the system.
334     */
335    public static final String ACTION_SUBINFO_RECORD_UPDATED
336            = "android.intent.action.ACTION_SUBINFO_RECORD_UPDATED";
337
338    /**
339     * Broadcast Action: The default subscription has changed.  This has the following
340     * extra values:</p>
341     * <ul>
342     *   <li><em>subscription</em> - A int, the current default subscription.</li>
343     * </ul>
344     * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SUBSCRIPTION_CHANGED}
345     */
346    @Deprecated
347    public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED
348            = SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED;
349
350    /**
351     * Broadcast Action: The default data subscription has changed.  This has the following
352     * extra values:</p>
353     * <ul>
354     *   <li><em>subscription</em> - A int, the current data default subscription.</li>
355     * </ul>
356     */
357    public static final String ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED
358            = "android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED";
359
360    /**
361     * Broadcast Action: The default voice subscription has changed.  This has the following
362     * extra values:</p>
363     * <ul>
364     *   <li><em>subscription</em> - A int, the current voice default subscription.</li>
365     * </ul>
366     */
367    public static final String ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED
368            = "android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED";
369
370    /**
371     * Broadcast Action: The default sms subscription has changed.  This has the following
372     * extra values:</p>
373     * <ul>
374     *   <li><em>subscription</em> - A int, the current sms default subscription.</li>
375     * </ul>
376     * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED}
377     */
378    @Deprecated
379    public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED
380            = SubscriptionManager.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED;
381
382    /*
383     * Broadcast Action: An attempt to set phone radio type and access technology has changed.
384     * This has the following extra values:
385     * <ul>
386     *   <li><em>phones radio access family </em> - A RadioAccessFamily
387     *   array, contain phone ID and new radio access family for each phone.</li>
388     * </ul>
389     *
390     * <p class="note">
391     * Requires the READ_PHONE_STATE permission.
392     */
393    public static final String ACTION_SET_RADIO_CAPABILITY_DONE =
394            "android.intent.action.ACTION_SET_RADIO_CAPABILITY_DONE";
395
396    public static final String EXTRA_RADIO_ACCESS_FAMILY = "rafs";
397
398    /*
399     * Broadcast Action: An attempt to set phone radio access family has failed.
400     */
401    public static final String ACTION_SET_RADIO_CAPABILITY_FAILED =
402            "android.intent.action.ACTION_SET_RADIO_CAPABILITY_FAILED";
403
404    /**
405     * <p>Broadcast Action: when data connections get redirected with validation failure.
406     * intended for sim/account status checks and only sent to the specified carrier app
407     * The intent will have the following extra values:</p>
408     * <ul>
409     *   <li>apnType</li><dd>A string with the apn type.</dd>
410     *   <li>redirectionUrl</li><dd>redirection url string</dd>
411     *   <li>subId</li><dd>Sub Id which associated the data connection failure.</dd>
412     * </ul>
413     * <p class="note">This is a protected intent that can only be sent by the system.</p>
414     */
415    public static final String ACTION_CARRIER_SIGNAL_REDIRECTED =
416            "com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED";
417    /**
418     * <p>Broadcast Action: when data connections setup fails.
419     * intended for sim/account status checks and only sent to the specified carrier app
420     * The intent will have the following extra values:</p>
421     * <ul>
422     *   <li>apnType</li><dd>A string with the apn type.</dd>
423     *   <li>errorCode</li><dd>A integer with dataFailCause.</dd>
424     *   <li>subId</li><dd>Sub Id which associated the data connection failure.</dd>
425     * </ul>
426     * <p class="note">This is a protected intent that can only be sent by the system. </p>
427     */
428    public static final String ACTION_CARRIER_SIGNAL_REQUEST_NETWORK_FAILED =
429            "com.android.internal.telephony.CARRIER_SIGNAL_REQUEST_NETWORK_FAILED";
430
431    /**
432     * <p>Broadcast Action: when pco value is available.
433     * intended for sim/account status checks and only sent to the specified carrier app
434     * The intent will have the following extra values:</p>
435     * <ul>
436     *   <li>apnType</li><dd>A string with the apn type.</dd>
437     *   <li>apnProto</li><dd>A string with the protocol of the apn connection (IP,IPV6,
438     *                        IPV4V6)</dd>
439     *   <li>pcoId</li><dd>An integer indicating the pco id for the data.</dd>
440     *   <li>pcoValue</li><dd>A byte array of pco data read from modem.</dd>
441     *   <li>subId</li><dd>Sub Id which associated the data connection.</dd>
442     * </ul>
443     * <p class="note">This is a protected intent that can only be sent by the system. </p>
444     */
445    public static final String ACTION_CARRIER_SIGNAL_PCO_VALUE =
446            "com.android.internal.telephony.CARRIER_SIGNAL_PCO_VALUE";
447
448    /**
449     * <p>Broadcast Action: when framework reset all carrier actions on sim load or absent.
450     * intended for carrier apps clean up (clear UI e.g.) and only sent to the specified carrier app
451     * The intent will have the following extra values:</p>
452     * <ul>
453     *   <li>subId</li><dd>Sub Id which associated the data connection failure.</dd>
454     * </ul>
455     * <p class="note">This is a protected intent that can only be sent by the system.</p>
456     */
457    public static final String ACTION_CARRIER_SIGNAL_RESET =
458            "com.android.internal.telephony.CARRIER_SIGNAL_RESET";
459
460    // CARRIER_SIGNAL_ACTION extra keys
461    public static final String EXTRA_REDIRECTION_URL_KEY = "redirectionUrl";
462    public static final String EXTRA_ERROR_CODE_KEY = "errorCode";
463    public static final String EXTRA_APN_TYPE_KEY = "apnType";
464    public static final String EXTRA_APN_PROTO_KEY = "apnProto";
465    public static final String EXTRA_PCO_ID_KEY = "pcoId";
466    public static final String EXTRA_PCO_VALUE_KEY = "pcoValue";
467
468
469   /**
470     * Broadcast action to trigger CI OMA-DM Session.
471    */
472    public static final String ACTION_REQUEST_OMADM_CONFIGURATION_UPDATE =
473            "com.android.omadm.service.CONFIGURATION_UPDATE";
474}
475