梦书之家(移动开发)

你有一个苹果,我有一个苹果,我们交换一下,一人还是一个苹果;你有一个思想,我有一个思想,我们交换一下,一人就有两个思想。 ——肖伯纳

导航

MMI Codes from android

以前只知道Symbian的手机,可以在待机界面下 输入 *#06# 可以看到本机的IMEI号,其实理论上任何的手机都可以按照这样的操作来查看IMEI号。

Android的相关代码:

GSMMmiCode.java(platform\framework\base\telephony\java\com\android\internal\telephony\gsm)

CDMAMmiCode.jafa(platform\framework\base\telephony\java\com\android\internal\telephony\cdma)

处理:GSMPhone.java, 搜索 mmicode

以下摘自:GSMMmiCode.java

 

代码
/**
* The motto for this file is:
*
* "NOTE: By using the # as a separator, most cases are expected to be unambiguous."
* -- TS 22.030 6.5.2
*
* {@hide}
*
*/
public final class GsmMmiCode extends Handler implements MmiCode {
static final String LOG_TAG = "GSM";

//***** Constants

// Max Size of the Short Code (aka Short String from TS 22.030 6.5.2)
static final int MAX_LENGTH_SHORT_CODE = 2;

// TS 22.030 6.5.2 Every Short String USSD command will end with #-key
// (known as #-String)
static final char END_OF_USSD_COMMAND = '#';

// From TS 22.030 6.5.2
static final String ACTION_ACTIVATE = "*";
static final String ACTION_DEACTIVATE = "#";
static final String ACTION_INTERROGATE = "*#";
static final String ACTION_REGISTER = "**";
static final String ACTION_ERASURE = "##";

// Supp Service codes from TS 22.030 Annex B

//Called line presentation
static final String SC_CLIP = "30";
static final String SC_CLIR = "31";

// Call Forwarding
static final String SC_CFU = "21";
static final String SC_CFB = "67";
static final String SC_CFNRy = "61";
static final String SC_CFNR = "62";

static final String SC_CF_All = "002";
static final String SC_CF_All_Conditional = "004";

// Call Waiting
static final String SC_WAIT = "43";

// Call Barring
static final String SC_BAOC = "33";
static final String SC_BAOIC = "331";
static final String SC_BAOICxH = "332";
static final String SC_BAIC = "35";
static final String SC_BAICr = "351";

static final String SC_BA_ALL = "330";
static final String SC_BA_MO = "333";
static final String SC_BA_MT = "353";

// Supp Service Password registration
static final String SC_PWD = "03";

// PIN/PIN2/PUK/PUK2
static final String SC_PIN = "04";
static final String SC_PIN2 = "042";
static final String SC_PUK = "05";
static final String SC_PUK2 = "052";

//***** Event Constants

static final int EVENT_SET_COMPLETE = 1;
static final int EVENT_GET_CLIR_COMPLETE = 2;
static final int EVENT_QUERY_CF_COMPLETE = 3;
static final int EVENT_USSD_COMPLETE = 4;
static final int EVENT_QUERY_COMPLETE = 5;
static final int EVENT_SET_CFF_COMPLETE = 6;
static final int EVENT_USSD_CANCEL_COMPLETE = 7;


 


//***** Class Variables


// See TS 22.030 6.5.2 "Structure of the MMI"

static Pattern sPatternSuppService = Pattern.compile(
"((\\*|#|\\*#|\\*\\*|##)(\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*))?)?)?)?#)(.*)");
/* 1 2 3 4 5 6 7 8 9 10 11 12

1 = Full string up to and including #
2 = action (activation/interrogation/registration/erasure)
3 = service code
5 = SIA
7 = SIB
9 = SIC
10 = dialing number
*/

static final int MATCH_GROUP_POUND_STRING = 1;

static final int MATCH_GROUP_ACTION = 2;
//(activation/interrogation/registration/erasure)

static final int MATCH_GROUP_SERVICE_CODE = 3;
static final int MATCH_GROUP_SIA = 5;
static final int MATCH_GROUP_SIB = 7;
static final int MATCH_GROUP_SIC = 9;
static final int MATCH_GROUP_PWD_CONFIRM = 11;
static final int MATCH_GROUP_DIALING_NUMBER = 12;

 

 


posted on 2010-12-14 19:04  梦书  阅读(1953)  评论(0编辑  收藏  举报