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;
18import android.content.Intent;
19
20import android.content.Intent;
21import android.telephony.SubscriptionManager;
22
23/**
24 * The intents that the telephony services broadcast.
25 *
26 * <p class="warning">
27 * THESE ARE NOT THE API!  Use the {@link android.telephony.TelephonyManager} class.
28 * DON'T LISTEN TO THESE DIRECTLY.
29 */
30public class TelephonyIntents {
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     * <p class="note">This is a protected intent that can only be sent
57     * by the system.
58     * @deprecated use {@link Intent#ACTION_SERVICE_STATE}
59     */
60    public static final String ACTION_SERVICE_STATE_CHANGED = Intent.ACTION_SERVICE_STATE;
61
62    /**
63     * <p>Broadcast Action: The radio technology has changed. The intent will have the following
64     * extra values:</p>
65     * <ul>
66     *   <li><em>phoneName</em> - A string version of the new phone name.</li>
67     * </ul>
68     *
69     * <p class="note">
70     * You can <em>not</em> receive this through components declared
71     * in manifests, only by explicitly registering for it with
72     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
73     * android.content.IntentFilter) Context.registerReceiver()}.
74     *
75     * <p class="note">
76     * Requires no permission.
77     *
78     * <p class="note">This is a protected intent that can only be sent
79     * by the system.
80     */
81    public static final String ACTION_RADIO_TECHNOLOGY_CHANGED
82            = "android.intent.action.RADIO_TECHNOLOGY";
83
84    /**
85     * <p>Broadcast Action: The emergency callback mode is changed.
86     * <ul>
87     *   <li><em>phoneinECMState</em> - A boolean value,true=phone in ECM, false=ECM off</li>
88     * </ul>
89     * <p class="note">
90     * You can <em>not</em> receive this through components declared
91     * in manifests, only by explicitly registering for it with
92     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
93     * android.content.IntentFilter) Context.registerReceiver()}.
94     *
95     * <p class="note">
96     * Requires no permission.
97     *
98     * <p class="note">This is a protected intent that can only be sent
99     * by the system.
100     */
101    public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED
102            = "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
103
104    /**
105     * <p>Broadcast Action: The emergency call state is changed.
106     * <ul>
107     *   <li><em>phoneInEmergencyCall</em> - A boolean value, true if phone in emergency call,
108     *   false otherwise</li>
109     * </ul>
110     * <p class="note">
111     * You can <em>not</em> receive this through components declared
112     * in manifests, only by explicitly registering for it with
113     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
114     * android.content.IntentFilter) Context.registerReceiver()}.
115     *
116     * <p class="note">
117     * Requires no permission.
118     *
119     * <p class="note">This is a protected intent that can only be sent
120     * by the system.
121     */
122    public static final String ACTION_EMERGENCY_CALL_STATE_CHANGED
123            = "android.intent.action.EMERGENCY_CALL_STATE_CHANGED";
124
125    /**
126     * Broadcast Action: The phone's signal strength has changed. The intent will have the
127     * following extra values:</p>
128     * <ul>
129     *   <li><em>phoneName</em> - A string version of the phone name.</li>
130     *   <li><em>asu</em> - A numeric value for the signal strength.
131     *          An ASU is 0-31 or -1 if unknown (for GSM, dBm = -113 - 2 * asu).
132     *          The following special values are defined:
133     *          <ul><li>0 means "-113 dBm or less".</li><li>31 means "-51 dBm or greater".</li></ul>
134     *   </li>
135     * </ul>
136     *
137     * <p class="note">
138     * You can <em>not</em> receive this through components declared
139     * in manifests, only by exlicitly registering for it with
140     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
141     * android.content.IntentFilter) Context.registerReceiver()}.
142     *
143     * <p class="note">
144     * Requires the READ_PHONE_STATE permission.
145     *
146     * <p class="note">This is a protected intent that can only be sent
147     * by the system.
148     */
149    public static final String ACTION_SIGNAL_STRENGTH_CHANGED = "android.intent.action.SIG_STR";
150
151
152    /**
153     * Broadcast Action: The data connection state has changed for any one of the
154     * phone's mobile data connections (eg, default, MMS or GPS specific connection).
155     * The intent will have the following extra values:</p>
156     * <dl>
157     *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
158     *   <dt>state</dt><dd>One of {@code CONNECTED}, {@code CONNECTING},
159     *      or {@code DISCONNECTED}.</dd>
160     *   <dt>apn</dt><dd>A string that is the APN associated with this connection.</dd>
161     *   <dt>apnType</dt><dd>A string array of APN types associated with this connection.
162     *      The APN type {@code *} is a special type that means this APN services all types.</dd>
163     * </dl>
164     *
165     * <p class="note">
166     * Requires the READ_PHONE_STATE permission.
167     *
168     * <p class="note">This is a protected intent that can only be sent
169     * by the system.
170     */
171    public static final String ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
172            = "android.intent.action.ANY_DATA_STATE";
173
174    /**
175     * Broadcast Action: An attempt to establish a data connection has failed.
176     * The intent will have the following extra values:</p>
177     * <dl>
178     *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
179     *   <dt>state</dt><dd>One of {@code CONNECTED}, {@code CONNECTING}, or {code DISCONNECTED}.</dd>
180     *   <dt>reason</dt><dd>A string indicating the reason for the failure, if available.</dd>
181     * </dl>
182     *
183     * <p class="note">
184     * Requires the READ_PHONE_STATE permission.
185     *
186     * <p class="note">This is a protected intent that can only be sent
187     * by the system.
188     */
189    public static final String ACTION_DATA_CONNECTION_FAILED
190            = "android.intent.action.DATA_CONNECTION_FAILED";
191
192    /**
193     * Broadcast Action: The sim card state has changed.
194     * The intent will have the following extra values:</p>
195     * <dl>
196     *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
197     *   <dt>ss</dt><dd>The sim state. One of:
198     *     <dl>
199     *       <dt>{@code ABSENT}</dt><dd>SIM card not found</dd>
200     *       <dt>{@code LOCKED}</dt><dd>SIM card locked (see {@code reason})</dd>
201     *       <dt>{@code READY}</dt><dd>SIM card ready</dd>
202     *       <dt>{@code IMSI}</dt><dd>FIXME: what is this state?</dd>
203     *       <dt>{@code LOADED}</dt><dd>SIM card data loaded</dd>
204     *     </dl></dd>
205     *   <dt>reason</dt><dd>The reason why ss is {@code LOCKED}; null otherwise.</dd>
206     *   <dl>
207     *       <dt>{@code PIN}</dt><dd>locked on PIN1</dd>
208     *       <dt>{@code PUK}</dt><dd>locked on PUK1</dd>
209     *       <dt>{@code NETWORK}</dt><dd>locked on network personalization</dd>
210     *   </dl>
211     *   <dt>rebroadcastOnUnlock</dt>
212     *   <dd>A boolean indicates a rebroadcast on unlock. optional extra, defaults to {@code false}
213     *   if not specified </dd>
214     * </dl>
215     *
216     * <p class="note">
217     * Requires the READ_PHONE_STATE permission.
218     *
219     * <p class="note">This is a protected intent that can only be sent
220     * by the system.
221     */
222    public static final String ACTION_SIM_STATE_CHANGED
223            = Intent.ACTION_SIM_STATE_CHANGED;
224
225    public static final String EXTRA_REBROADCAST_ON_UNLOCK= "rebroadcastOnUnlock";
226
227    /**
228     * Broadcast Action: The time was set by the carrier (typically by the NITZ string).
229     * This is a sticky broadcast.
230     * The intent will have the following extra values:</p>
231     * <ul>
232     *   <li><em>time</em> - The time as a long in UTC milliseconds.</li>
233     * </ul>
234     *
235     * <p class="note">
236     * Requires the READ_PHONE_STATE permission.
237     *
238     * <p class="note">This is a protected intent that can only be sent
239     * by the system.
240     */
241    public static final String ACTION_NETWORK_SET_TIME = "android.intent.action.NETWORK_SET_TIME";
242
243
244    /**
245     * Broadcast Action: The timezone was set by the carrier (typically by the NITZ string).
246     * This is a sticky broadcast.
247     * The intent will have the following extra values:</p>
248     * <ul>
249     *   <li><em>time-zone</em> - The java.util.TimeZone.getID() value identifying the new time
250     *          zone.</li>
251     * </ul>
252     *
253     * <p class="note">
254     * Requires the READ_PHONE_STATE permission.
255     *
256     * <p class="note">This is a protected intent that can only be sent
257     * by the system.
258     */
259    public static final String ACTION_NETWORK_SET_TIMEZONE
260            = "android.intent.action.NETWORK_SET_TIMEZONE";
261
262    /**
263     * <p>Broadcast Action: It indicates the Emergency callback mode blocks datacall/sms
264     * <p class="note">.
265     * This is to pop up a notice to show user that the phone is in emergency callback mode
266     * and atacalls and outgoing sms are blocked.
267     *
268     * <p class="note">This is a protected intent that can only be sent
269     * by the system.
270     */
271    public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS
272            = "com.android.internal.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS";
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            = "com.android.internal.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     * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SUBSCRIPTION_CHANGED}
346     */
347    @Deprecated
348    public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED
349            = SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED;
350
351    /**
352     * Broadcast Action: The default data subscription has changed.  This has the following
353     * extra values:</p>
354     * <ul>
355     *   <li><em>subscription</em> - A int, the current data default subscription.</li>
356     * </ul>
357     */
358    public static final String ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED
359            = "android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED";
360
361    /**
362     * Broadcast Action: The default voice subscription has changed.  This has the following
363     * extra values:</p>
364     * <ul>
365     *   <li><em>subscription</em> - A int, the current voice default subscription.</li>
366     * </ul>
367     */
368    public static final String ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED
369            = "android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED";
370
371    /**
372     * Broadcast Action: The default sms subscription has changed.  This has the following
373     * extra values:</p>
374     * <ul>
375     *   <li><em>subscription</em> - A int, the current sms default subscription.</li>
376     * </ul>
377     * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED}
378     */
379    @Deprecated
380    public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED
381            = SubscriptionManager.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED;
382
383    /*
384     * Broadcast Action: An attempt to set phone radio type and access technology has changed.
385     * This has the following extra values:
386     * <ul>
387     *   <li><em>phones radio access family </em> - A RadioAccessFamily
388     *   array, contain phone ID and new radio access family for each phone.</li>
389     * </ul>
390     *
391     * <p class="note">
392     * Requires the READ_PHONE_STATE permission.
393     */
394    public static final String ACTION_SET_RADIO_CAPABILITY_DONE =
395            "android.intent.action.ACTION_SET_RADIO_CAPABILITY_DONE";
396
397    public static final String EXTRA_RADIO_ACCESS_FAMILY = "rafs";
398
399    /*
400     * Broadcast Action: An attempt to set phone radio access family has failed.
401     */
402    public static final String ACTION_SET_RADIO_CAPABILITY_FAILED =
403            "android.intent.action.ACTION_SET_RADIO_CAPABILITY_FAILED";
404
405    /**
406     * <p>Broadcast Action: when data connections get redirected with validation failure.
407     * intended for sim/account status checks and only sent to the specified carrier app
408     * The intent will have the following extra values:</p>
409     * <ul>
410     *   <li>apnType</li><dd>A string with the apn type.</dd>
411     *   <li>redirectionUrl</li><dd>redirection url string</dd>
412     *   <li>subId</li><dd>Sub Id which associated the data connection failure.</dd>
413     * </ul>
414     * <p class="note">This is a protected intent that can only be sent by the system.</p>
415     */
416    public static final String ACTION_CARRIER_SIGNAL_REDIRECTED =
417            "com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED";
418    /**
419     * <p>Broadcast Action: when data connections setup fails.
420     * intended for sim/account status checks and only sent to the specified carrier app
421     * The intent will have the following extra values:</p>
422     * <ul>
423     *   <li>apnType</li><dd>A string with the apn type.</dd>
424     *   <li>errorCode</li><dd>A integer with dataFailCause.</dd>
425     *   <li>subId</li><dd>Sub Id which associated the data connection failure.</dd>
426     * </ul>
427     * <p class="note">This is a protected intent that can only be sent by the system. </p>
428     */
429    public static final String ACTION_CARRIER_SIGNAL_REQUEST_NETWORK_FAILED =
430            "com.android.internal.telephony.CARRIER_SIGNAL_REQUEST_NETWORK_FAILED";
431
432    /**
433     * <p>Broadcast Action: when pco value is available.
434     * intended for sim/account status checks and only sent to the specified carrier app
435     * The intent will have the following extra values:</p>
436     * <ul>
437     *   <li>apnType</li><dd>A string with the apn type.</dd>
438     *   <li>apnProto</li><dd>A string with the protocol of the apn connection (IP,IPV6,
439     *                        IPV4V6)</dd>
440     *   <li>pcoId</li><dd>An integer indicating the pco id for the data.</dd>
441     *   <li>pcoValue</li><dd>A byte array of pco data read from modem.</dd>
442     *   <li>subId</li><dd>Sub Id which associated the data connection.</dd>
443     * </ul>
444     * <p class="note">This is a protected intent that can only be sent by the system. </p>
445     */
446    public static final String ACTION_CARRIER_SIGNAL_PCO_VALUE =
447            "com.android.internal.telephony.CARRIER_SIGNAL_PCO_VALUE";
448
449    /**
450     * <p>Broadcast Action: when system default network available/unavailable with
451     * carrier-disabled mobile data. Intended for carrier apps to set/reset carrier actions when
452     * other network becomes system default network, Wi-Fi for example.
453     * The intent will have the following extra values:</p>
454     * <ul>
455     *   <li>defaultNetworkAvailable</li><dd>A boolean indicates default network available.</dd>
456     *   <li>subId</li><dd>Sub Id which associated the default data.</dd>
457     * </ul>
458     * <p class="note">This is a protected intent that can only be sent by the system. </p>
459     */
460    public static final String ACTION_CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE =
461            "com.android.internal.telephony.CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE";
462
463    /**
464     * <p>Broadcast Action: when framework reset all carrier actions on sim load or absent.
465     * intended for carrier apps clean up (clear UI e.g.) and only sent to the specified carrier app
466     * The intent will have the following extra values:</p>
467     * <ul>
468     *   <li>subId</li><dd>Sub Id which associated the data connection failure.</dd>
469     * </ul>
470     * <p class="note">This is a protected intent that can only be sent by the system.</p>
471     */
472    public static final String ACTION_CARRIER_SIGNAL_RESET =
473            "com.android.internal.telephony.CARRIER_SIGNAL_RESET";
474
475    // CARRIER_SIGNAL_ACTION extra keys
476    public static final String EXTRA_REDIRECTION_URL_KEY = "redirectionUrl";
477    public static final String EXTRA_ERROR_CODE_KEY = "errorCode";
478    public static final String EXTRA_APN_TYPE_KEY = "apnType";
479    public static final String EXTRA_APN_PROTO_KEY = "apnProto";
480    public static final String EXTRA_PCO_ID_KEY = "pcoId";
481    public static final String EXTRA_PCO_VALUE_KEY = "pcoValue";
482    public static final String EXTRA_DEFAULT_NETWORK_AVAILABLE_KEY = "defaultNetworkAvailable";
483
484   /**
485     * Broadcast action to trigger CI OMA-DM Session.
486    */
487    public static final String ACTION_REQUEST_OMADM_CONFIGURATION_UPDATE =
488            "com.android.omadm.service.CONFIGURATION_UPDATE";
489}
490