alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Android example source code file (TelephonyIntents.java)

This example Android source code file (TelephonyIntents.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Android by Example" TM.

Java - Android tags/keywords

action_any_data_connection_state_changed, action_data_connection_failed, action_emergency_callback_mode_changed, action_network_set_timezone, action_radio_technology_changed, action_service_state_changed, action_show_notice_ecm_block_others, action_signal_strength_changed, action_sim_state_changed, string, telephonyintents

The TelephonyIntents.java Android example source code

/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.internal.telephony;

/**
 * The intents that the telephony services broadcast.
 *
 * <p class="warning">
 * THESE ARE NOT THE API!  Use the {@link android.telephony.TelephonyManager} class.
 * DON'T LISTEN TO THESE DIRECTLY.
 */
public class TelephonyIntents {

    /**
     * Broadcast Action: The phone service state has changed. The intent will have the following
     * extra values:</p>
     * <ul>
     *   <li>state - An int with one of the following values:
     *          {@link android.telephony.ServiceState#STATE_IN_SERVICE},
     *          {@link android.telephony.ServiceState#STATE_OUT_OF_SERVICE},
     *          {@link android.telephony.ServiceState#STATE_EMERGENCY_ONLY}
     *          or {@link android.telephony.ServiceState#STATE_POWER_OFF}
     *   <li>roaming - A boolean value indicating whether the phone is roaming.
     *   <li>operator-alpha-long - The carrier name as a string.
     *   <li>operator-alpha-short - A potentially shortened version of the carrier name,
     *          as a string.</li>
     *   <li>operator-numeric - A number representing the carrier, as a string. This is
     *          a five or six digit number consisting of the MCC (Mobile Country Code, 3 digits)
     *          and MNC (Mobile Network code, 2-3 digits).</li>
     *   <li>manual - A boolean, where true indicates that the user has chosen to select
     *          the network manually, and false indicates that network selection is handled by the
     *          phone.</li>
     * </ul>
     *
     * <p class="note">
     * Requires the READ_PHONE_STATE permission.
     * 
     * <p class="note">This is a protected intent that can only be sent
     * by the system.
     */
    public static final String ACTION_SERVICE_STATE_CHANGED = "android.intent.action.SERVICE_STATE";

    /**
     * <p>Broadcast Action: The radio technology has changed. The intent will have the following
     * extra values:</p>
     * <ul>
     *   <li>phoneName - A string version of the new phone name.
     * </ul>
     *
     * <p class="note">
     * You can <em>not receive this through components declared
     * in manifests, only by explicitly registering for it with
     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
     * android.content.IntentFilter) Context.registerReceiver()}.
     *
     * <p class="note">
     * Requires no permission.
     * 
     * <p class="note">This is a protected intent that can only be sent
     * by the system.
     */
    public static final String ACTION_RADIO_TECHNOLOGY_CHANGED
            = "android.intent.action.RADIO_TECHNOLOGY";
    /**
     * <p>Broadcast Action: The emergency callback mode is changed.
     * <ul>
     *   <li>phoneinECMState - A boolean value,true=phone in ECM, false=ECM off
     * </ul>
     * <p class="note">
     * You can <em>not receive this through components declared
     * in manifests, only by explicitly registering for it with
     * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver,
     * android.content.IntentFilter) Context.registerReceiver()}.
     *
     * <p class="note">
     * Requires no permission.
     * 
     * <p class="note">This is a protected intent that can only be sent
     * by the system.
     */
    public static final String ACTION_EMERGENCY_CALLBACK_MODE_CHANGED
            = "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED";
    /**
     * Broadcast Action: The phone's signal strength has changed. The intent will have the
     * following extra values:</p>
     * <ul>
     *   <li>phoneName - A string version of the phone name.
     *   <li>asu - A numeric value for the signal strength.
     *          An ASU is 0-31 or -1 if unknown (for GSM, dBm = -113 - 2 * asu).
     *          The following special values are defined:
     *          <ul>
  • 0 means "-113 dBm or less".
  • 31 means "-51 dBm or greater".
  • * </li> * </ul> * * <p class="note"> * You can <em>not receive this through components declared * in manifests, only by exlicitly registering for it with * {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver, * android.content.IntentFilter) Context.registerReceiver()}. * * <p class="note"> * Requires the READ_PHONE_STATE permission. * * <p class="note">This is a protected intent that can only be sent * by the system. */ public static final String ACTION_SIGNAL_STRENGTH_CHANGED = "android.intent.action.SIG_STR"; /** * Broadcast Action: The data connection state has changed for any one of the * phone's mobile data connections (eg, default, MMS or GPS specific connection). * The intent will have the following extra values:</p> * <ul> * <li>phoneName - A string version of the phone name. * <li>state - One of "CONNECTED" * <code>"CONNECTING" or "DISCONNNECTED" * <li>apn - A string that is the APN associated with this * connection.</li> * <li>apnType - A string array of APN types associated with * this connection. The APN type <code>"*" is a special * type that means this APN services all types.</li> * </ul> * * <p class="note"> * Requires the READ_PHONE_STATE permission. * * <p class="note">This is a protected intent that can only be sent * by the system. */ public static final String ACTION_ANY_DATA_CONNECTION_STATE_CHANGED = "android.intent.action.ANY_DATA_STATE"; /** * Broadcast Action: An attempt to establish a data connection has failed. * The intent will have the following extra values:</p> * <ul> * <li>phoneName &mdash A string version of the phone name. * <li>state — One of "CONNECTED" * <code>"CONNECTING" or "DISCONNNECTED" * <li>reason — A string indicating the reason for the failure, if available * </ul> * * <p class="note"> * Requires the READ_PHONE_STATE permission. * * <p class="note">This is a protected intent that can only be sent * by the system. */ public static final String ACTION_DATA_CONNECTION_FAILED = "android.intent.action.DATA_CONNECTION_FAILED"; /** * Broadcast Action: The sim card state has changed. * The intent will have the following extra values:</p> * <ul> * <li>phoneName - A string version of the phone name. * <li>ss - The sim state. One of * <code>"ABSENT" "LOCKED" * <code>"READY" "ISMI" "LOADED" * <li>reason - The reason while ss is LOCKED, otherwise is null * <code>"PIN" locked on PIN1 * <code>"PUK" locked on PUK1 * <code>"NETWORK" locked on Network Personalization * </ul> * * <p class="note"> * Requires the READ_PHONE_STATE permission. * * <p class="note">This is a protected intent that can only be sent * by the system. */ public static final String ACTION_SIM_STATE_CHANGED = "android.intent.action.SIM_STATE_CHANGED"; /** * Broadcast Action: The time was set by the carrier (typically by the NITZ string). * This is a sticky broadcast. * The intent will have the following extra values:</p> * <ul> * <li>time - The time as a long in UTC milliseconds. * </ul> * * <p class="note"> * Requires the READ_PHONE_STATE permission. * * <p class="note">This is a protected intent that can only be sent * by the system. */ public static final String ACTION_NETWORK_SET_TIME = "android.intent.action.NETWORK_SET_TIME"; /** * Broadcast Action: The timezone was set by the carrier (typically by the NITZ string). * This is a sticky broadcast. * The intent will have the following extra values:</p> * <ul> * <li>time-zone - The java.util.TimeZone.getID() value identifying the new time * zone.</li> * </ul> * * <p class="note"> * Requires the READ_PHONE_STATE permission. * * <p class="note">This is a protected intent that can only be sent * by the system. */ public static final String ACTION_NETWORK_SET_TIMEZONE = "android.intent.action.NETWORK_SET_TIMEZONE"; /** * <p>Broadcast Action: It indicates the Emergency callback mode blocks datacall/sms * <p class="note">. * This is to pop up a notice to show user that the phone is in emergency callback mode * and atacalls and outgoing sms are blocked. * * <p class="note">This is a protected intent that can only be sent * by the system. */ public static final String ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS = "android.intent.action.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS"; }

    Other Android examples (source code examples)

    Here is a short list of links related to this Android TelephonyIntents.java source code file:

    ... this post is sponsored by my books ...

    #1 New Release!

    FP Best Seller

     

    new blog posts

     

    Copyright 1998-2021 Alvin Alexander, alvinalexander.com
    All Rights Reserved.

    A percentage of advertising revenue from
    pages under the /java/jwarehouse URI on this website is
    paid back to open source projects.