对IccCardStatus 的认识

    IccCardStatus 用于描述手机所插入的手机卡的信息,包括卡的状态,PIN码锁定的状态,所包含的应用的状态信息。RIL.java 中获取得到SIM卡的信息后,将信息封装成IccCardStatus返回给UiccController.
    具体的成员变量如下
    CardState ,描述SIM卡的状态,
    public enum CardState {
        CARDSTATE_ABSENT,  //表示掉卡
        CARDSTATE_PRESENT, //表示卡正常
        CARDSTATE_ERROR; //表示卡出现了错误

        boolean isCardPresent() {
            return this == CARDSTATE_PRESENT;
        }

        boolean isCardFaulty() {
            return this == CARDSTATE_ERROR;
        }
    };
    PinState ,描述 PIN码锁定信息
    public enum PinState {
        PINSTATE_UNKNOWN,// PIN码状态不确定
        PINSTATE_ENABLED_NOT_VERIFIED, // PIN码锁定,用户输入的PIN码错误,无法进入手机
        PINSTATE_ENABLED_VERIFIED,// PINM码锁定,用户输入正确的PIN码,进入手机
        PINSTATE_DISABLED,// 没有进行PIN码锁定
        PINSTATE_ENABLED_BLOCKED,//PIN码解锁失败,提示输入PUK码
        PINSTATE_ENABLED_PERM_BLOCKED;// PUK码解锁失败后,永久锁定

        boolean isPermBlocked() {
            return this == PINSTATE_ENABLED_PERM_BLOCKED;
        }

        boolean isPinRequired() {
            return this == PINSTATE_ENABLED_NOT_VERIFIED;
        }

        boolean isPukRequired() {
            return this == PINSTATE_ENABLED_BLOCKED;
        }
    }
    IccCardApplicationStatus,描述UiccCardApplication的信息,每一个IccCardApplicationStatus,对应于一个 UiccCardApplication.
    IccCardStatus用于创建UiccCard,一个UiccCard 中可能包含多个UiccCardApplication.
    public class IccCardApplicationStatus {
    //描述UiccCardApplication的类型,和卡的类型对应
    public enum AppType{
        APPTYPE_UNKNOWN,
        APPTYPE_SIM,  //GSM 卡
        APPTYPE_USIM, // WCDMA 卡
        APPTYPE_RUIM, // CDMA 卡
        APPTYPE_CSIM,
        APPTYPE_ISIM
    };
    //描述UiccCardApplication的状态,和卡的状态对应
    public enum AppState{
        APPSTATE_UNKNOWN, //卡不存在
        APPSTATE_DETECTED,// 卡已经检测到
        APPSTATE_PIN,// 卡已经被PIN码锁定
        APPSTATE_PUK,// 卡已经被PUK码锁定
        APPSTATE_SUBSCRIPTION_PERSO, //卡已经被网络锁定
        APPSTATE_READY;//卡已经准备好了

        boolean isPinRequired() {
            return this == APPSTATE_PIN;
        }

        boolean isPukRequired() {
            return this == APPSTATE_PUK;
        }

        boolean isSubscriptionPersoEnabled() {
            return this == APPSTATE_SUBSCRIPTION_PERSO;
        }

        boolean isAppReady() {
            return this == APPSTATE_READY;
        }

        boolean isAppNotReady() {
            return this == APPSTATE_UNKNOWN  ||
                   this == APPSTATE_DETECTED;
        }
    };
    //描述卡被网络锁定的信息,对国内用户来说意义不大
    public enum PersoSubState{
        PERSOSUBSTATE_UNKNOWN,
        PERSOSUBSTATE_IN_PROGRESS,
        PERSOSUBSTATE_READY,
        PERSOSUBSTATE_SIM_NETWORK,
        PERSOSUBSTATE_SIM_NETWORK_SUBSET,
        PERSOSUBSTATE_SIM_CORPORATE,
        PERSOSUBSTATE_SIM_SERVICE_PROVIDER,
        PERSOSUBSTATE_SIM_SIM,
        PERSOSUBSTATE_SIM_NETWORK_PUK,
        PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK,
        PERSOSUBSTATE_SIM_CORPORATE_PUK,
        PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK,
        PERSOSUBSTATE_SIM_SIM_PUK,
        PERSOSUBSTATE_RUIM_NETWORK1,
        PERSOSUBSTATE_RUIM_NETWORK2,
        PERSOSUBSTATE_RUIM_HRPD,
        PERSOSUBSTATE_RUIM_CORPORATE,
        PERSOSUBSTATE_RUIM_SERVICE_PROVIDER,
        PERSOSUBSTATE_RUIM_RUIM,
        PERSOSUBSTATE_RUIM_NETWORK1_PUK,
        PERSOSUBSTATE_RUIM_NETWORK2_PUK,
        PERSOSUBSTATE_RUIM_HRPD_PUK,
        PERSOSUBSTATE_RUIM_CORPORATE_PUK,
        PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK,
        PERSOSUBSTATE_RUIM_RUIM_PUK;

        boolean isPersoSubStateUnknown() {
            return this == PERSOSUBSTATE_UNKNOWN;
        }
    };

    public AppType        app_type;
    public AppState       app_state;
    // applicable only if app_state == RIL_APPSTATE_SUBSCRIPTION_PERSO
    public PersoSubState  perso_substate;
    // null terminated string, e.g., from 0xA0, 0x00 -> 0x41, 0x30, 0x30, 0x30 */
    public String         aid;
    // null terminated string
    public String         app_label;
    // applicable to USIM and CSIM
    public int            pin1_replaced;
    public PinState            pin1;//卡的pin1码
    public PinState            pin2;//卡的pin2 码
    ....
    }
   

你可能感兴趣的:(对IccCardStatus 的认识)