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