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 * Broadcast Action: The default subscription has changed. This has the following 216 * extra values:</p> 217 * <ul> 218 * <li><em>subscription</em> - A int, the current default subscription.</li> 219 * </ul> 220 * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SUBSCRIPTION_CHANGED} 221 */ 222 @Deprecated 223 public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED 224 = SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED; 225 226 /** 227 * Broadcast Action: The default data subscription has changed. This has the following 228 * extra values:</p> 229 * <ul> 230 * <li><em>subscription</em> - A int, the current data default subscription.</li> 231 * </ul> 232 */ 233 public static final String ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED 234 = TelephonyManager.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED; 235 236 /** 237 * Broadcast Action: The default voice subscription has changed. This has the following 238 * extra values:</p> 239 * <ul> 240 * <li><em>subscription</em> - A int, the current voice default subscription.</li> 241 * </ul> 242 */ 243 public static final String ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED 244 = TelephonyManager.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED; 245 246 /** 247 * Broadcast Action: The default sms subscription has changed. This has the following 248 * extra values:</p> 249 * <ul> 250 * <li><em>subscription</em> - A int, the current sms default subscription.</li> 251 * </ul> 252 * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED} 253 */ 254 @Deprecated 255 public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED 256 = SubscriptionManager.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED; 257 258 /* 259 * Broadcast Action: An attempt to set phone radio type and access technology has changed. 260 * This has the following extra values: 261 * <ul> 262 * <li><em>phones radio access family </em> - A RadioAccessFamily 263 * array, contain phone ID and new radio access family for each phone.</li> 264 * </ul> 265 * 266 * <p class="note"> 267 * Requires the READ_PHONE_STATE permission. 268 */ 269 public static final String ACTION_SET_RADIO_CAPABILITY_DONE = 270 "android.intent.action.ACTION_SET_RADIO_CAPABILITY_DONE"; 271 272 public static final String EXTRA_RADIO_ACCESS_FAMILY = "rafs"; 273 274 /* 275 * Broadcast Action: An attempt to set phone radio access family has failed. 276 */ 277 public static final String ACTION_SET_RADIO_CAPABILITY_FAILED = 278 "android.intent.action.ACTION_SET_RADIO_CAPABILITY_FAILED"; 279 280 /** 281 * Broadcast action to trigger CI OMA-DM Session. 282 */ 283 public static final String ACTION_REQUEST_OMADM_CONFIGURATION_UPDATE = 284 TelephonyManager.ACTION_REQUEST_OMADM_CONFIGURATION_UPDATE; 285 286 /** 287 * Broadcast action to trigger the Carrier Certificate download. 288 */ 289 public static final String ACTION_CARRIER_CERTIFICATE_DOWNLOAD = 290 "com.android.internal.telephony.ACTION_CARRIER_CERTIFICATE_DOWNLOAD"; 291 292 /** 293 * Broadcast action to indicate an error related to Line1Number has been detected. 294 * 295 * Requires the READ_PRIVILEGED_PHONE_STATE permission. 296 * 297 * @hide 298 */ 299 public static final String ACTION_LINE1_NUMBER_ERROR_DETECTED = 300 "com.android.internal.telephony.ACTION_LINE1_NUMBER_ERROR_DETECTED"; 301 302 /** 303 * Broadcast sent when a user activity is detected. 304 */ 305 public static final String ACTION_USER_ACTIVITY_NOTIFICATION = 306 "android.intent.action.USER_ACTIVITY_NOTIFICATION"; 307 308 /** 309 * Kept for backwards compatibility. 310 * @deprecated @see TelephonyManager#ACTION_CARRIER_SIGNAL_REDIRECTED 311 */ 312 @Deprecated 313 public static final String ACTION_CARRIER_SIGNAL_REDIRECTED = 314 "com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED"; 315 316 /** 317 * Kept for backwards compatibility. 318 * @deprecated @see TelephonyManager#ACTION_CARRIER_SIGNAL_REQUEST_NETWORK_FAILED 319 */ 320 @Deprecated 321 public static final String ACTION_CARRIER_SIGNAL_REQUEST_NETWORK_FAILED = 322 "com.android.internal.telephony.CARRIER_SIGNAL_REQUEST_NETWORK_FAILED"; 323 324 /** 325 * Kept for backwards compatibility. 326 * @deprecated @see TelephonyManager#ACTION_CARRIER_SIGNAL_PCO_VALUE 327 */ 328 @Deprecated 329 public static final String ACTION_CARRIER_SIGNAL_PCO_VALUE = 330 "com.android.internal.telephony.CARRIER_SIGNAL_PCO_VALUE"; 331 332 /** 333 * Kept for backwards compatibility. 334 * @deprecated @see TelephonyManager#ACTION_CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE 335 */ 336 @Deprecated 337 public static final String ACTION_CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE = 338 "com.android.internal.telephony.CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE"; 339 340 /** 341 * Kept for backwards compatibility. 342 * @deprecated @see TelephonyManager#ACTION_CARRIER_SIGNAL_RESET 343 */ 344 @Deprecated 345 public static final String ACTION_CARRIER_SIGNAL_RESET = 346 "com.android.internal.telephony.CARRIER_SIGNAL_RESET"; 347 348 /** 349 * Kept for backwards compatibility. 350 * @deprecated @see TelephonyManager#EXTRA_REDIRECTION_URL 351 */ 352 @Deprecated 353 public static final String EXTRA_REDIRECTION_URL = "redirectionUrl"; 354 355 /** 356 * Kept for backwards compatibility. 357 * @deprecated @see TelephonyManager#EXTRA_DATA_FAIL_CAUSE 358 */ 359 @Deprecated 360 public static final String EXTRA_ERROR_CODE = "errorCode"; 361 362 /** 363 * Kept for backwards compatibility. 364 * @deprecated @see TelephonyManager#EXTRA_APN_TYPE 365 */ 366 @Deprecated 367 public static final String EXTRA_APN_TYPE = "apnType"; 368 369 /** 370 * Kept for backwards compatibility. 371 * @deprecated @see TelephonyManager#EXTRA_APN_TYPE 372 */ 373 @Deprecated 374 public static final String EXTRA_APN_TYPE_INT = "apnTypeInt"; 375 376 /** 377 * Kept for backwards compatibility. 378 * @deprecated @see TelephonyManager#EXTRA_APN_PROTOCOL 379 */ 380 @Deprecated 381 public static final String EXTRA_APN_PROTOCOL = "apnProto"; 382 383 /** 384 * Kept for backwards compatibility. 385 * @deprecated @see TelephonyManager#EXTRA_APN_PROTOCOL 386 */ 387 @Deprecated 388 public static final String EXTRA_APN_PROTOCOL_INT = "apnProtoInt"; 389 390 /** 391 * Kept for backwards compatibility. 392 * @deprecated @see TelephonyManager#EXTRA_PCO_ID 393 */ 394 @Deprecated 395 public static final String EXTRA_PCO_ID = "pcoId"; 396 397 /** 398 * Kept for backwards compatibility. 399 * @deprecated @see TelephonyManager#EXTRA_PCO_VALUE 400 */ 401 @Deprecated 402 public static final String EXTRA_PCO_VALUE = "pcoValue"; 403 404 /** 405 * Kept for backwards compatibility. 406 * @deprecated @see TelephonyManager#EXTRA_DEFAULT_NETWORK_AVAILABLE 407 */ 408 @Deprecated 409 public static final String EXTRA_DEFAULT_NETWORK_AVAILABLE = "defaultNetworkAvailable"; 410 } 411