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 import android.content.Intent;
20 import android.telephony.SubscriptionManager;
21 import android.telephony.ims.ImsManager;
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  */
30 public 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     @Deprecated
61     public static final String ACTION_SERVICE_STATE_CHANGED = Intent.ACTION_SERVICE_STATE;
62 
63     /**
64      * <p>Broadcast Action: The radio technology has changed. The intent will have the following
65      * extra values:</p>
66      * <ul>
67      *   <li><em>phoneName</em> - A string version of the new phone name.</li>
68      * </ul>
69      *
70      * <p class="note">
71      * You can <em>not</em> receive this through components declared
72      * in manifests, only by explicitly registering for it with
73      * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
74      * android.content.IntentFilter) Context.registerReceiver()}.
75      *
76      * <p class="note">
77      * Requires no permission.
78      *
79      * <p class="note">This is a protected intent that can only be sent
80      * by the system.
81      */
82     public static final String ACTION_RADIO_TECHNOLOGY_CHANGED
83             = "android.intent.action.RADIO_TECHNOLOGY";
84 
85     /**
86      * <p>Broadcast Action: The emergency callback mode is changed.
87      * <ul>
88      *   <li><em>phoneinECMState</em> - A boolean value,true=phone in ECM, false=ECM off</li>
89      * </ul>
90      * <p class="note">
91      * You can <em>not</em> receive this through components declared
92      * in manifests, only by explicitly registering for it with
93      * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
94      * android.content.IntentFilter) Context.registerReceiver()}.
95      *
96      * <p class="note">
97      * Requires no permission.
98      *
99      * <p class="note">This is a protected intent that can only be sent
100      * by the system.
101      */
102     public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED
103             = "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
104 
105     /**
106      * <p>Broadcast Action: The emergency call state is changed.
107      * <ul>
108      *   <li><em>phoneInEmergencyCall</em> - A boolean value, true if phone in emergency call,
109      *   false otherwise</li>
110      * </ul>
111      * <p class="note">
112      * You can <em>not</em> receive this through components declared
113      * in manifests, only by explicitly 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 no 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_EMERGENCY_CALL_STATE_CHANGED
124             = "android.intent.action.EMERGENCY_CALL_STATE_CHANGED";
125 
126     /**
127      * Broadcast Action: The phone's signal strength has changed. The intent will have the
128      * following extra values:</p>
129      * <ul>
130      *   <li><em>phoneName</em> - A string version of the phone name.</li>
131      *   <li><em>asu</em> - A numeric value for the signal strength.
132      *          An ASU is 0-31 or -1 if unknown (for GSM, dBm = -113 - 2 * asu).
133      *          The following special values are defined:
134      *          <ul><li>0 means "-113 dBm or less".</li><li>31 means "-51 dBm or greater".</li></ul>
135      *   </li>
136      * </ul>
137      *
138      * <p class="note">
139      * You can <em>not</em> receive this through components declared
140      * in manifests, only by exlicitly registering for it with
141      * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
142      * android.content.IntentFilter) Context.registerReceiver()}.
143      *
144      * <p class="note">
145      * Requires the READ_PHONE_STATE permission.
146      *
147      * <p class="note">This is a protected intent that can only be sent
148      * by the system.
149      */
150     public static final String ACTION_SIGNAL_STRENGTH_CHANGED = "android.intent.action.SIG_STR";
151 
152 
153     /**
154      * Broadcast Action: The data connection state has changed for any one of the
155      * phone's mobile data connections (eg, default, MMS or GPS specific connection).
156      * The intent will have the following extra values:</p>
157      * <dl>
158      *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
159      *   <dt>state</dt><dd>One of {@code CONNECTED}, {@code CONNECTING},
160      *      or {@code DISCONNECTED}.</dd>
161      *   <dt>apn</dt><dd>A string that is the APN associated with this connection.</dd>
162      *   <dt>apnType</dt><dd>A string array of APN types associated with this connection.
163      *      The APN type {@code *} is a special type that means this APN services all types.</dd>
164      * </dl>
165      *
166      * <p class="note">
167      * Requires the READ_PHONE_STATE permission.
168      *
169      * <p class="note">This is a protected intent that can only be sent
170      * by the system.
171      */
172     public static final String ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
173             = "android.intent.action.ANY_DATA_STATE";
174 
175     /**
176      * Broadcast Action: The sim card state has changed.
177      * The intent will have the following extra values:</p>
178      * <dl>
179      *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
180      *   <dt>ss</dt><dd>The sim state. One of:
181      *     <dl>
182      *       <dt>{@code ABSENT}</dt><dd>SIM card not found</dd>
183      *       <dt>{@code LOCKED}</dt><dd>SIM card locked (see {@code reason})</dd>
184      *       <dt>{@code READY}</dt><dd>SIM card ready</dd>
185      *       <dt>{@code IMSI}</dt><dd>FIXME: what is this state?</dd>
186      *       <dt>{@code LOADED}</dt><dd>SIM card data loaded</dd>
187      *     </dl></dd>
188      *   <dt>reason</dt><dd>The reason why ss is {@code LOCKED}; null otherwise.</dd>
189      *   <dl>
190      *       <dt>{@code PIN}</dt><dd>locked on PIN1</dd>
191      *       <dt>{@code PUK}</dt><dd>locked on PUK1</dd>
192      *       <dt>{@code NETWORK}</dt><dd>locked on network personalization</dd>
193      *   </dl>
194      *   <dt>rebroadcastOnUnlock</dt>
195      *   <dd>A boolean indicates a rebroadcast on unlock. optional extra, defaults to {@code false}
196      *   if not specified </dd>
197      * </dl>
198      *
199      * <p class="note">
200      * Requires the READ_PHONE_STATE permission.
201      *
202      * <p class="note">This is a protected intent that can only be sent
203      * by the system.
204      */
205     public static final String ACTION_SIM_STATE_CHANGED
206             = Intent.ACTION_SIM_STATE_CHANGED;
207 
208     /**
209      * <p>Broadcast Action: It indicates the Emergency callback mode blocks datacall/sms
210      * <p class="note">.
211      * This is to pop up a notice to show user that the phone is in emergency callback mode
212      * and atacalls and outgoing sms are blocked.
213      *
214      * <p class="note">This is a protected intent that can only be sent
215      * by the system.
216      */
217     public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS
218             = "com.android.internal.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS";
219 
220     /**
221      * <p>Broadcast Action: Indicates that the action is forbidden by network.
222      * <p class="note">
223      * This is for the OEM applications to understand about possible provisioning issues.
224      * Used in OMA-DM applications.
225      * @deprecated Use {@link ImsManager#ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION} instead.
226      */
227     @Deprecated
228     public static final String ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION =
229             ImsManager.ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION;
230 
231     /**
232      * Broadcast Action: A "secret code" has been entered in the dialer. Secret codes are
233      * of the form {@code *#*#<code>#*#*}. The intent will have the data URI:
234      *
235      * {@code android_secret_code://<code>}
236      */
237     public static final String SECRET_CODE_ACTION = "android.provider.Telephony.SECRET_CODE";
238 
239     /**
240      * Broadcast Action: The Service Provider string(s) have been updated.  Activities or
241      * services that use these strings should update their display.
242      * The intent will have the following extra values:</p>
243      *
244      * <dl>
245      *   <dt>showPlmn</dt><dd>Boolean that indicates whether the PLMN should be shown.</dd>
246      *   <dt>plmn</dt><dd>The operator name of the registered network, as a string.</dd>
247      *   <dt>showSpn</dt><dd>Boolean that indicates whether the SPN should be shown.</dd>
248      *   <dt>spn</dt><dd>The service provider name, as a string.</dd>
249      * </dl>
250      *
251      * Note that <em>showPlmn</em> may indicate that <em>plmn</em> should be displayed, even
252      * though the value for <em>plmn</em> is null.  This can happen, for example, if the phone
253      * has not registered to a network yet.  In this case the receiver may substitute an
254      * appropriate placeholder string (eg, "No service").
255      *
256      * It is recommended to display <em>plmn</em> before / above <em>spn</em> if
257      * both are displayed.
258      *
259      * <p>Note: this is a protected intent that can only be sent by the system.
260      */
261     public static final String SPN_STRINGS_UPDATED_ACTION =
262             "android.provider.Telephony.SPN_STRINGS_UPDATED";
263 
264     public static final String EXTRA_SHOW_PLMN  = "showPlmn";
265     public static final String EXTRA_PLMN       = "plmn";
266     public static final String EXTRA_SHOW_SPN   = "showSpn";
267     public static final String EXTRA_SPN        = "spn";
268     public static final String EXTRA_DATA_SPN   = "spnData";
269 
270     /**
271      * <p>Broadcast Action: It indicates one column of a subinfo record has been changed
272      * <p class="note">This is a protected intent that can only be sent
273      * by the system.
274      */
275     public static final String ACTION_SUBINFO_CONTENT_CHANGE
276             = "android.intent.action.ACTION_SUBINFO_CONTENT_CHANGE";
277 
278     /**
279      * <p>Broadcast Action: It indicates subinfo record update is completed
280      * when SIM inserted state change
281      * <p class="note">This is a protected intent that can only be sent
282      * by the system.
283      */
284     public static final String ACTION_SUBINFO_RECORD_UPDATED
285             = "android.intent.action.ACTION_SUBINFO_RECORD_UPDATED";
286 
287     /**
288      * Broadcast Action: The default subscription has changed.  This has the following
289      * extra values:</p>
290      * <ul>
291      *   <li><em>subscription</em> - A int, the current default subscription.</li>
292      * </ul>
293      * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SUBSCRIPTION_CHANGED}
294      */
295     @Deprecated
296     public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED
297             = SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED;
298 
299     /**
300      * Broadcast Action: The default data subscription has changed.  This has the following
301      * extra values:</p>
302      * <ul>
303      *   <li><em>subscription</em> - A int, the current data default subscription.</li>
304      * </ul>
305      */
306     public static final String ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED
307             = "android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED";
308 
309     /**
310      * Broadcast Action: The default voice subscription has changed.  This has the following
311      * extra values:</p>
312      * <ul>
313      *   <li><em>subscription</em> - A int, the current voice default subscription.</li>
314      * </ul>
315      */
316     public static final String ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED
317             = "android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED";
318 
319     /**
320      * Broadcast Action: The default sms subscription has changed.  This has the following
321      * extra values:</p>
322      * <ul>
323      *   <li><em>subscription</em> - A int, the current sms default subscription.</li>
324      * </ul>
325      * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED}
326      */
327     @Deprecated
328     public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED
329             = SubscriptionManager.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED;
330 
331     /*
332      * Broadcast Action: An attempt to set phone radio type and access technology has changed.
333      * This has the following extra values:
334      * <ul>
335      *   <li><em>phones radio access family </em> - A RadioAccessFamily
336      *   array, contain phone ID and new radio access family for each phone.</li>
337      * </ul>
338      *
339      * <p class="note">
340      * Requires the READ_PHONE_STATE permission.
341      */
342     public static final String ACTION_SET_RADIO_CAPABILITY_DONE =
343             "android.intent.action.ACTION_SET_RADIO_CAPABILITY_DONE";
344 
345     public static final String EXTRA_RADIO_ACCESS_FAMILY = "rafs";
346 
347     /*
348      * Broadcast Action: An attempt to set phone radio access family has failed.
349      */
350     public static final String ACTION_SET_RADIO_CAPABILITY_FAILED =
351             "android.intent.action.ACTION_SET_RADIO_CAPABILITY_FAILED";
352 
353     /**
354      * Broadcast action to trigger CI OMA-DM Session.
355      */
356     public static final String ACTION_REQUEST_OMADM_CONFIGURATION_UPDATE =
357             "com.android.omadm.service.CONFIGURATION_UPDATE";
358 
359     /**
360      * Broadcast action to trigger the Carrier Certificate download.
361      */
362     public static final String ACTION_CARRIER_CERTIFICATE_DOWNLOAD =
363             "com.android.internal.telephony.ACTION_CARRIER_CERTIFICATE_DOWNLOAD";
364 
365     /**
366      * Broadcast action to indicate an error related to Line1Number has been detected.
367      *
368      * Requires the READ_PRIVILEGED_PHONE_STATE permission.
369      *
370      * @hide
371      */
372     public static final String ACTION_LINE1_NUMBER_ERROR_DETECTED =
373             "com.android.internal.telephony.ACTION_LINE1_NUMBER_ERROR_DETECTED";
374 
375     /**
376      * Broadcast action to notify radio bug.
377      *
378      * Requires the READ_PRIVILEGED_PHONE_STATE permission.
379      *
380      * @hide
381      */
382     public static final String ACTION_REPORT_RADIO_BUG =
383             "com.android.internal.telephony.ACTION_REPORT_RADIO_BUG";
384 
385     // ACTION_REPORT_RADIO_BUG extra keys
386     public static final String EXTRA_SLOT_ID = "slotId";
387     public static final String EXTRA_RADIO_BUG_TYPE = "radioBugType";
388 }
389