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