• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.TelephonyManager;
22 import android.telephony.ims.ImsManager;
23 
24 /**
25  * The intents that the telephony services broadcast.
26  *
27  * <p class="warning">
28  * THESE ARE NOT THE API!  Use the {@link android.telephony.TelephonyManager} class.
29  * DON'T LISTEN TO THESE DIRECTLY.
30  */
31 public class TelephonyIntents {
32 
33     /**
34      * Broadcast Action: The phone service state has changed. The intent will have the following
35      * extra values:</p>
36      * <ul>
37      *   <li><em>state</em> - An int with one of the following values:
38      *          {@link android.telephony.ServiceState#STATE_IN_SERVICE},
39      *          {@link android.telephony.ServiceState#STATE_OUT_OF_SERVICE},
40      *          {@link android.telephony.ServiceState#STATE_EMERGENCY_ONLY}
41      *          or {@link android.telephony.ServiceState#STATE_POWER_OFF}
42      *   <li><em>roaming</em> - A boolean value indicating whether the phone is roaming.</li>
43      *   <li><em>operator-alpha-long</em> - The carrier name as a string.</li>
44      *   <li><em>operator-alpha-short</em> - A potentially shortened version of the carrier name,
45      *          as a string.</li>
46      *   <li><em>operator-numeric</em> - A number representing the carrier, as a string. This is
47      *          a five or six digit number consisting of the MCC (Mobile Country Code, 3 digits)
48      *          and MNC (Mobile Network code, 2-3 digits).</li>
49      *   <li><em>manual</em> - A boolean, where true indicates that the user has chosen to select
50      *          the network manually, and false indicates that network selection is handled by the
51      *          phone.</li>
52      * </ul>
53      *
54      * <p class="note">
55      * Requires the READ_PHONE_STATE permission.
56      *
57      * <p class="note">This is a protected intent that can only be sent
58      * by the system.
59      * @deprecated use {@link Intent#ACTION_SERVICE_STATE}
60      */
61     @Deprecated
62     public static final String ACTION_SERVICE_STATE_CHANGED = Intent.ACTION_SERVICE_STATE;
63 
64     /**
65      * <p>Broadcast Action: The radio technology has changed. The intent will have the following
66      * extra values:</p>
67      * <ul>
68      *   <li><em>phoneName</em> - A string version of the new phone name.</li>
69      * </ul>
70      *
71      * <p class="note">
72      * You can <em>not</em> receive this through components declared
73      * in manifests, only by explicitly registering for it with
74      * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
75      * android.content.IntentFilter) Context.registerReceiver()}.
76      *
77      * <p class="note">
78      * Requires no permission.
79      *
80      * <p class="note">This is a protected intent that can only be sent
81      * by the system.
82      */
83     public static final String ACTION_RADIO_TECHNOLOGY_CHANGED
84             = "android.intent.action.RADIO_TECHNOLOGY";
85 
86     /**
87      * <p>Broadcast Action: The emergency callback mode is changed.
88      * <ul>
89      *   <li><em>phoneinECMState</em> - A boolean value,true=phone in ECM, false=ECM off</li>
90      * </ul>
91      * <p class="note">
92      * You can <em>not</em> receive this through components declared
93      * in manifests, only by explicitly registering for it with
94      * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
95      * android.content.IntentFilter) Context.registerReceiver()}.
96      *
97      * <p class="note">
98      * Requires no permission.
99      *
100      * <p class="note">This is a protected intent that can only be sent
101      * by the system.
102      */
103     public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED
104             = TelephonyManager.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED;
105 
106     /**
107      * <p>Broadcast Action: The emergency call state is changed.
108      * <ul>
109      *   <li><em>phoneInEmergencyCall</em> - A boolean value, true if phone in emergency call,
110      *   false otherwise</li>
111      * </ul>
112      * <p class="note">
113      * You can <em>not</em> receive this through components declared
114      * in manifests, only by explicitly registering for it with
115      * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
116      * android.content.IntentFilter) Context.registerReceiver()}.
117      *
118      * <p class="note">
119      * Requires no permission.
120      *
121      * <p class="note">This is a protected intent that can only be sent
122      * by the system.
123      */
124     public static final String ACTION_EMERGENCY_CALL_STATE_CHANGED
125             = TelephonyManager.ACTION_EMERGENCY_CALL_STATE_CHANGED;
126 
127 
128     /**
129      * Broadcast Action: The data connection state has changed for any one of the
130      * phone's mobile data connections (eg, default, MMS or GPS specific connection).
131      * The intent will have the following extra values:</p>
132      * <dl>
133      *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
134      *   <dt>state</dt><dd>One of {@code CONNECTED}, {@code CONNECTING},
135      *      or {@code DISCONNECTED}.</dd>
136      *   <dt>apn</dt><dd>A string that is the APN associated with this connection.</dd>
137      *   <dt>apnType</dt><dd>A string array of APN types associated with this connection.
138      *      The APN type {@code *} is a special type that means this APN services all types.</dd>
139      * </dl>
140      *
141      * <p class="note">
142      * Requires the READ_PHONE_STATE permission.
143      *
144      * <p class="note">This is a protected intent that can only be sent
145      * by the system.
146      */
147     public static final String ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
148             = "android.intent.action.ANY_DATA_STATE";
149 
150     /**
151      * Broadcast Action: The sim card state has changed.
152      * The intent will have the following extra values:</p>
153      * <dl>
154      *   <dt>phoneName</dt><dd>A string version of the phone name.</dd>
155      *   <dt>ss</dt><dd>The sim state. One of:
156      *     <dl>
157      *       <dt>{@code ABSENT}</dt><dd>SIM card not found</dd>
158      *       <dt>{@code LOCKED}</dt><dd>SIM card locked (see {@code reason})</dd>
159      *       <dt>{@code READY}</dt><dd>SIM card ready</dd>
160      *       <dt>{@code IMSI}</dt><dd>FIXME: what is this state?</dd>
161      *       <dt>{@code LOADED}</dt><dd>SIM card data loaded</dd>
162      *     </dl></dd>
163      *   <dt>reason</dt><dd>The reason why ss is {@code LOCKED}; null otherwise.</dd>
164      *   <dl>
165      *       <dt>{@code PIN}</dt><dd>locked on PIN1</dd>
166      *       <dt>{@code PUK}</dt><dd>locked on PUK1</dd>
167      *       <dt>{@code NETWORK}</dt><dd>locked on network personalization</dd>
168      *   </dl>
169      *   <dt>rebroadcastOnUnlock</dt>
170      *   <dd>A boolean indicates a rebroadcast on unlock. optional extra, defaults to {@code false}
171      *   if not specified </dd>
172      * </dl>
173      *
174      * <p class="note">This is a sticky broadcast, and therefore requires no permissions to listen
175      * to. Do not add any additional information to this broadcast.
176      *
177      * <p class="note">This is a protected intent that can only be sent
178      * by the system.
179      */
180     public static final String ACTION_SIM_STATE_CHANGED
181             = Intent.ACTION_SIM_STATE_CHANGED;
182 
183     /**
184      * <p>Broadcast Action: It indicates the Emergency callback mode blocks datacall/sms
185      * <p class="note">.
186      * This is to pop up a notice to show user that the phone is in emergency callback mode
187      * and atacalls and outgoing sms are blocked.
188      *
189      * <p class="note">This is a protected intent that can only be sent
190      * by the system.
191      */
192     public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS
193             = TelephonyManager.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS;
194 
195     /**
196      * <p>Broadcast Action: Indicates that the action is forbidden by network.
197      * <p class="note">
198      * This is for the OEM applications to understand about possible provisioning issues.
199      * Used in OMA-DM applications.
200      * @deprecated Use {@link ImsManager#ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION} instead.
201      */
202     @Deprecated
203     public static final String ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION =
204             ImsManager.ACTION_FORBIDDEN_NO_SERVICE_AUTHORIZATION;
205 
206     /**
207      * Broadcast Action: A "secret code" has been entered in the dialer. Secret codes are
208      * of the form {@code *#*#<code>#*#*}. The intent will have the data URI:
209      *
210      * {@code android_secret_code://<code>}
211      */
212     public static final String SECRET_CODE_ACTION = "android.provider.Telephony.SECRET_CODE";
213 
214     /**
215      * <p>Broadcast Action: It indicates one column of a subinfo record has been changed
216      * <p class="note">This is a protected intent that can only be sent
217      * by the system.
218      */
219     public static final String ACTION_SUBINFO_CONTENT_CHANGE
220             = "android.intent.action.ACTION_SUBINFO_CONTENT_CHANGE";
221 
222     /**
223      * <p>Broadcast Action: It indicates subinfo record update is completed
224      * when SIM inserted state change
225      * <p class="note">This is a protected intent that can only be sent
226      * by the system.
227      */
228     public static final String ACTION_SUBINFO_RECORD_UPDATED
229             = "android.intent.action.ACTION_SUBINFO_RECORD_UPDATED";
230 
231     /**
232      * Broadcast Action: The default subscription has changed.  This has the following
233      * extra values:</p>
234      * <ul>
235      *   <li><em>subscription</em> - A int, the current default subscription.</li>
236      * </ul>
237      * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SUBSCRIPTION_CHANGED}
238      */
239     @Deprecated
240     public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED
241             = SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED;
242 
243     /**
244      * Broadcast Action: The default data subscription has changed.  This has the following
245      * extra values:</p>
246      * <ul>
247      *   <li><em>subscription</em> - A int, the current data default subscription.</li>
248      * </ul>
249      */
250     public static final String ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED
251             = TelephonyManager.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED;
252 
253     /**
254      * Broadcast Action: The default voice subscription has changed.  This has the following
255      * extra values:</p>
256      * <ul>
257      *   <li><em>subscription</em> - A int, the current voice default subscription.</li>
258      * </ul>
259      */
260     public static final String ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED
261             = TelephonyManager.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED;
262 
263     /**
264      * Broadcast Action: The default sms subscription has changed.  This has the following
265      * extra values:</p>
266      * <ul>
267      *   <li><em>subscription</em> - A int, the current sms default subscription.</li>
268      * </ul>
269      * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED}
270      */
271     @Deprecated
272     public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED
273             = SubscriptionManager.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED;
274 
275     /*
276      * Broadcast Action: An attempt to set phone radio type and access technology has changed.
277      * This has the following extra values:
278      * <ul>
279      *   <li><em>phones radio access family </em> - A RadioAccessFamily
280      *   array, contain phone ID and new radio access family for each phone.</li>
281      * </ul>
282      *
283      * <p class="note">
284      * Requires the READ_PHONE_STATE permission.
285      */
286     public static final String ACTION_SET_RADIO_CAPABILITY_DONE =
287             "android.intent.action.ACTION_SET_RADIO_CAPABILITY_DONE";
288 
289     public static final String EXTRA_RADIO_ACCESS_FAMILY = "rafs";
290 
291     /*
292      * Broadcast Action: An attempt to set phone radio access family has failed.
293      */
294     public static final String ACTION_SET_RADIO_CAPABILITY_FAILED =
295             "android.intent.action.ACTION_SET_RADIO_CAPABILITY_FAILED";
296 
297     /**
298      * Broadcast action to trigger CI OMA-DM Session.
299      */
300     public static final String ACTION_REQUEST_OMADM_CONFIGURATION_UPDATE =
301             TelephonyManager.ACTION_REQUEST_OMADM_CONFIGURATION_UPDATE;
302 
303     /**
304      * Broadcast action to trigger the Carrier Certificate download.
305      */
306     public static final String ACTION_CARRIER_CERTIFICATE_DOWNLOAD =
307             "com.android.internal.telephony.ACTION_CARRIER_CERTIFICATE_DOWNLOAD";
308 
309     /**
310      * Broadcast action to indicate an error related to Line1Number has been detected.
311      *
312      * Requires the READ_PRIVILEGED_PHONE_STATE permission.
313      *
314      * @hide
315      */
316     public static final String ACTION_LINE1_NUMBER_ERROR_DETECTED =
317             "com.android.internal.telephony.ACTION_LINE1_NUMBER_ERROR_DETECTED";
318 
319     /**
320      * Broadcast sent when a user activity is detected.
321      */
322     public static final String ACTION_USER_ACTIVITY_NOTIFICATION =
323             "android.intent.action.USER_ACTIVITY_NOTIFICATION";
324 
325     /**
326      * Kept for backwards compatibility.
327      * @deprecated @see TelephonyManager#ACTION_CARRIER_SIGNAL_REDIRECTED
328      */
329     @Deprecated
330     public static final String ACTION_CARRIER_SIGNAL_REDIRECTED =
331             "com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED";
332 
333     /**
334      * Kept for backwards compatibility.
335      * @deprecated @see TelephonyManager#ACTION_CARRIER_SIGNAL_REQUEST_NETWORK_FAILED
336      */
337     @Deprecated
338     public static final String ACTION_CARRIER_SIGNAL_REQUEST_NETWORK_FAILED =
339             "com.android.internal.telephony.CARRIER_SIGNAL_REQUEST_NETWORK_FAILED";
340 
341     /**
342      * Kept for backwards compatibility.
343      * @deprecated @see TelephonyManager#ACTION_CARRIER_SIGNAL_PCO_VALUE
344      */
345     @Deprecated
346     public static final String ACTION_CARRIER_SIGNAL_PCO_VALUE =
347             "com.android.internal.telephony.CARRIER_SIGNAL_PCO_VALUE";
348 
349     /**
350      * Kept for backwards compatibility.
351      * @deprecated @see TelephonyManager#ACTION_CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE
352      */
353     @Deprecated
354     public static final String ACTION_CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE =
355             "com.android.internal.telephony.CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE";
356 
357     /**
358      * Kept for backwards compatibility.
359      * @deprecated @see TelephonyManager#ACTION_CARRIER_SIGNAL_RESET
360      */
361     @Deprecated
362     public static final String ACTION_CARRIER_SIGNAL_RESET =
363             "com.android.internal.telephony.CARRIER_SIGNAL_RESET";
364 
365     /**
366      * Kept for backwards compatibility.
367      * @deprecated @see TelephonyManager#EXTRA_REDIRECTION_URL
368      */
369     @Deprecated
370     public static final String EXTRA_REDIRECTION_URL = "redirectionUrl";
371 
372     /**
373      * Kept for backwards compatibility.
374      * @deprecated @see TelephonyManager#EXTRA_DATA_FAIL_CAUSE
375      */
376     @Deprecated
377     public static final String EXTRA_ERROR_CODE = "errorCode";
378 
379     /**
380      * Kept for backwards compatibility.
381      * @deprecated @see TelephonyManager#EXTRA_APN_TYPE
382      */
383     @Deprecated
384     public static final String EXTRA_APN_TYPE = "apnType";
385 
386     /**
387      * Kept for backwards compatibility.
388      * @deprecated @see TelephonyManager#EXTRA_APN_TYPE
389      */
390     @Deprecated
391     public static final String EXTRA_APN_TYPE_INT = "apnTypeInt";
392 
393     /**
394      * Kept for backwards compatibility.
395      * @deprecated @see TelephonyManager#EXTRA_APN_PROTOCOL
396      */
397     @Deprecated
398     public static final String EXTRA_APN_PROTOCOL = "apnProto";
399 
400     /**
401      * Kept for backwards compatibility.
402      * @deprecated @see TelephonyManager#EXTRA_APN_PROTOCOL
403      */
404     @Deprecated
405     public static final String EXTRA_APN_PROTOCOL_INT = "apnProtoInt";
406 
407     /**
408      * Kept for backwards compatibility.
409      * @deprecated @see TelephonyManager#EXTRA_PCO_ID
410      */
411     @Deprecated
412     public static final String EXTRA_PCO_ID = "pcoId";
413 
414     /**
415      * Kept for backwards compatibility.
416      * @deprecated @see TelephonyManager#EXTRA_PCO_VALUE
417      */
418     @Deprecated
419     public static final String EXTRA_PCO_VALUE = "pcoValue";
420 
421     /**
422      * Kept for backwards compatibility.
423      * @deprecated @see TelephonyManager#EXTRA_DEFAULT_NETWORK_AVAILABLE
424      */
425     @Deprecated
426     public static final String EXTRA_DEFAULT_NETWORK_AVAILABLE = "defaultNetworkAvailable";
427 }
428