本文方法在以下环境中测试过并证实可行:
软件:安卓MTK系统, 版本4.4.2
硬件:双卡双待
方法:在mtk系统某个provider中存有sim卡相关信息,可以通过provider直接获取,无需权限。内容如下:
/** @internal */
public static final Uri CONTENT_URI =
Uri.parse("content://telephony/siminfo");
/** @internal */
public static final String DEFAULT_SORT_ORDER = "name ASC";
/**
* <P>Type: TEXT</P>
*/
public static final String ICC_ID = "icc_id";
/**
* <P>Type: TEXT</P>
* @internal
*/
public static final String DISPLAY_NAME = "display_name";
/** @internal */
public static final int DEFAULT_NAME_MIN_INDEX = 01;
/** @internal */
public static final int DEFAULT_NAME_MAX_INDEX= 99;
/** @internal */
public static final int DEFAULT_NAME_RES = com.mediatek.internal.R.string.new_sim;
/**
* <P>Type: INT</P>
*/
public static final String NAME_SOURCE = "name_source";
/** @internal */
public static final int DEFAULT_SOURCE = 0;
public static final int SIM_SOURCE = 1;
/** @internal */
public static final int USER_INPUT = 2;
/**
* <P>Type: TEXT</P>
*/
public static final String NUMBER = "number";
/**
* 0:none, 1:the first four digits, 2:the last four digits.
* <P>Type: INTEGER</P>
* @internal
*/
public static final String DISPLAY_NUMBER_FORMAT = "display_number_format";
/** @internal */
public static final int DISPALY_NUMBER_NONE = 0;
/** @internal */
public static final int DISPLAY_NUMBER_FIRST = 1;
public static final int DISPLAY_NUMBER_LAST = 2;
/** @internal */
public static final int DISLPAY_NUMBER_DEFAULT = DISPLAY_NUMBER_FIRST;
/**
* Eight kinds of colors. 0-3 will represent the eight colors.
* Default value: any color that is not in-use.
* <P>Type: INTEGER</P>
* @internal
*/
public static final String COLOR = "color";
/** @internal */
public static final int COLOR_1 = 0;
/** @internal */
public static final int COLOR_2 = 1;
/** @internal */
public static final int COLOR_3 = 2;
/** @internal */
public static final int COLOR_4 = 3;
/** @internal */
public static final int COLOR_DEFAULT = COLOR_1;
/**
* 0: Don't allow data when roaming, 1:Allow data when roaming
* <P>Type: INTEGER</P>
* @internal
*/
public static final String DATA_ROAMING = "data_roaming";
/** @internal */
public static final int DATA_ROAMING_ENABLE = 1;
/** @internal */
public static final int DATA_ROAMING_DISABLE = 0;
/** @internal */
public static final int DATA_ROAMING_DEFAULT = DATA_ROAMING_DISABLE;
/**
* <P>Type: INTEGER</P>
*/
public static final String SLOT = "slot";
/** @internal */
public static final int SLOT_NONE = -1;
public static final int ERROR_GENERAL = -1;
public static final int ERROR_NAME_EXIST = -2;
/**
* <P>Type: TEXT</P>
*/
public static final String OPERATOR = "operator";
/// add by mtk80601 for CT Dual SIM Indicator Feature start
/** @internal */
static final int typeBackground = 0;
/** @internal */
static final int typeBackgroundDark = 1;
/** @internal */
static final int typeBackgroundLight = 2;
/** @internal */
static final int typeBackgroundDarkSmall = 3;
/** @internal */
static final int typeBackgroundLightSmall = 4;
本文介绍了一种在安卓MTK系统环境下无需特殊权限即可读取SIM卡信息的方法。通过特定provider可以直接获取包括ICCID、显示名称等在内的多项SIM卡数据。此方法适用于双卡双待设备。
1052

被折叠的 条评论
为什么被折叠?



