当前位置: 首页 > article >正文

Android TelephonyManager 参数定义和功能 API 介绍

简介

TelephonyManager 是 Android 提供的一个类,主要用于处理与设备的电信网络相关的信息。它允许开发者访问有关电话状态、SIM 卡信息、网络连接状态等多个方面的功能。

参数定义

SIM状态 SIM_STATE_XXX

  1. SIM_STATE_UNKNOWN,
  2. SIM_STATE_ABSENT,
  3. SIM_STATE_PIN_REQUIRED,
  4. SIM_STATE_PUK_REQUIRED,
  5. SIM_STATE_NETWORK_LOCKED,
  6. SIM_STATE_READY,
  7. SIM_STATE_NOT_READY,
  8. SIM_STATE_PERM_DISABLED,
  9. SIM_STATE_CARD_IO_ERROR,
  10. SIM_STATE_CARD_RESTRICTED,
  11. SIM_STATE_LOADED,
  12. SIM_STATE_PRESENT,

TelephonyManager.java - OpenGrok cross reference for /frameworks/base/telephony/java/android/telephony/TelephonyManager.java

    //
    //
    // SIM Card
    //
    //

    /** @hide */
    @IntDef(prefix = {"SIM_STATE_"},
            value = {
                    SIM_STATE_UNKNOWN,
                    SIM_STATE_ABSENT,
                    SIM_STATE_PIN_REQUIRED,
                    SIM_STATE_PUK_REQUIRED,
                    SIM_STATE_NETWORK_LOCKED,
                    SIM_STATE_READY,
                    SIM_STATE_NOT_READY,
                    SIM_STATE_PERM_DISABLED,
                    SIM_STATE_CARD_IO_ERROR,
                    SIM_STATE_CARD_RESTRICTED,
                    SIM_STATE_LOADED,
                    SIM_STATE_PRESENT,
            })
    public @interface SimState {}

    /**
     * SIM card state: Unknown. Signifies that the SIM is in transition
     * between states. For example, when the user inputs the SIM pin
     * under PIN_REQUIRED state, a query for sim status returns
     * this state before turning to SIM_STATE_READY.
     *
     * These are the ordinal value of IccCardConstants.State.
     */

    public static final int SIM_STATE_UNKNOWN = TelephonyProtoEnums.SIM_STATE_UNKNOWN;  // 0
    /** SIM card state: no SIM card is available in the device */
    public static final int SIM_STATE_ABSENT = TelephonyProtoEnums.SIM_STATE_ABSENT;  // 1
    /** SIM card state: Locked: requires the user's SIM PIN to unlock */
    public static final int SIM_STATE_PIN_REQUIRED =
            TelephonyProtoEnums.SIM_STATE_PIN_REQUIRED;  // 2
    /** SIM card state: Locked: requires the user's SIM PUK to unlock */
    public static final int SIM_STATE_PUK_REQUIRED =
            TelephonyProtoEnums.SIM_STATE_PUK_REQUIRED;  // 3
    /** SIM card state: Locked: requires a network PIN to unlock */
    public static final int SIM_STATE_NETWORK_LOCKED =
            TelephonyProtoEnums.SIM_STATE_NETWORK_LOCKED;  // 4
    /** SIM card state: Ready */
    public static final int SIM_STATE_READY = TelephonyProtoEnums.SIM_STATE_READY;  // 5
    /** SIM card state: SIM Card is NOT READY */
    public static final int SIM_STATE_NOT_READY = TelephonyProtoEnums.SIM_STATE_NOT_READY;  // 6
    /** SIM card state: SIM Card Error, permanently disabled */
    public static final int SIM_STATE_PERM_DISABLED =
            TelephonyProtoEnums.SIM_STATE_PERM_DISABLED;  // 7
    /** SIM card state: SIM Card Error, present but faulty */
    public static final int SIM_STATE_CARD_IO_ERROR =
            TelephonyProtoEnums.SIM_STATE_CARD_IO_ERROR;  // 8
    /** SIM card state: SIM Card restricted, present but not usable due to
     * carrier restrictions.
     */
    public static final int SIM_STATE_CARD_RESTRICTED =
            TelephonyProtoEnums.SIM_STATE_CARD_RESTRICTED;  // 9
    /**
     * SIM card state: Loaded: SIM card applications have been loaded
     * @hide
     */
    @SystemApi
    public static final int SIM_STATE_LOADED = TelephonyProtoEnums.SIM_STATE_LOADED;  // 10
    /**
     * SIM card state: SIM Card is present
     * @hide
     */
    @SystemApi
    public static final int SIM_STATE_PRESENT = TelephonyProtoEnums.SIM_STATE_PRESENT;  // 11

    /**
     * Extra included in {@link #ACTION_SIM_CARD_STATE_CHANGED} and
     * {@link #ACTION_SIM_APPLICATION_STATE_CHANGED} to indicate the card/application state.
     *
     * @hide
     */
    @SystemApi
    public static final String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";

    /**
     * Broadcast Action: The sim card state has changed.
     * The intent will have the following extra values:</p>
     * <dl>
     *   <dt>{@link #EXTRA_SIM_STATE}</dt>
     *   <dd>The sim card state. One of:
     *     <dl>
     *       <dt>{@link #SIM_STATE_ABSENT}</dt>
     *       <dd>SIM card not found</dd>
     *       <dt>{@link #SIM_STATE_CARD_IO_ERROR}</dt>
     *       <dd>SIM card IO error</dd>
     *       <dt>{@link #SIM_STATE_CARD_RESTRICTED}</dt>
     *       <dd>SIM card is restricted</dd>
     *       <dt>{@link #SIM_STATE_PRESENT}</dt>
     *       <dd>SIM card is present</dd>
     *     </dl>
     *   </dd>
     * </dl>
     *
     * <p class="note">Requires the READ_PRIVILEGED_PHONE_STATE permission.
     *
     * <p class="note">The current state can also be queried using {@link #getSimCardState()}.
     *
     * <p class="note">This is a protected intent that can only be sent by the system.
     * @hide
     */
    @SystemApi
    @SdkConstant(SdkConsta

http://www.kler.cn/a/369926.html

相关文章:

  • Java中Queue集合的面试试题及答案解析
  • 计算机视觉算法实战——无人机检测
  • FTP 与 LFTP 命令的介绍及常用功能
  • 使用 `scanpy` 观察 `AnnData` 对象内部数据结构
  • 99.6 金融难点通俗解释:股息率(DV)
  • Linux中关于glibc包编译升级导致服务器死机或者linux命令无法使用的情况
  • C语言——网络编程(下)
  • Docker:容器化的革命
  • VUE组件学习 | 五、v-for组件
  • 明达云平台:赋能污水处理厂
  • STM32中的IPR,IRQ,NVCC ,EXTI,AFIO 都是什么意思?
  • elselect iphone上 要点两次
  • ES(2)(仅供自己参考)
  • rand5生成rand7
  • leetcode hot100【LeetCode 394.字符串解码】java实现
  • Shein注册不了的常见原因及解决方法
  • Java知识巩固(十二)
  • 蚁群算法(Ant Colony Optimization)详细解读
  • Flink系列之:学习理解通过状态快照实现容错
  • matlab 绘图操作
  • Rust教程
  • 初探Servlet
  • picomax的rkipc开启rtmp功能
  • Python 基础语法 - 变量
  • 快速学会C 语言基本概念和语法结构
  • 电脑技巧:如何进行磁盘测速?