STK

SIM Card Tool Kit

相关代码位置:

vendor\mediatek\proprietary\packages\apps\Stk1\src\com\android\stk\StkAppService.java

case DISPLAY_TEXT:            CatLog.d(LOG_TAG, "[handleCmd][DISPLAY_TEXT] +");            if (isBusyOnCall() == true) {                CatLog.d(LOG_TAG, "[Handle Command][DISPLAY_TEXT][Can not handle currently]");                CatResponseMessage resMsg = new CatResponseMessage(mStkContext[slotId].mCurrentCmd);                resMsg.setResultCode(ResultCode.TERMINAL_CRNTLY_UNABLE_TO_PROCESS);                additionalInfo = new byte[1];                additionalInfo[0] = (byte) 0x02;                resMsg.setAdditionalInfo(additionalInfo);                mStkService[slotId].onCmdResponse(resMsg);                return;            }            TextMessage msg = cmdMsg.geTextMessage();            mStkContext[slotId].responseNeeded = msg.responseNeeded;            if (mStkContext[slotId].responseNeeded == false) {                //Immediate response                CatLog.d(LOG_TAG, "[Handle Command][DISPLAY_TEXT][Should immediatly response]");                CatResponseMessage resMsg = new CatResponseMessage(mStkContext[slotId].mCurrentCmd);                  resMsg.setResultCode(ResultCode.OK);                mStkService[slotId].onCmdResponse(resMsg);            } else {            }            // TODO: get the carrier name from the SIM            msg.title = "";            String optr = SystemProperties.get("ro.operator.optr");            if (optr != null && "OP02".equals(optr)) {                 int resId = R.string.app_name;                 if (slotId == PhoneConstants.SIM_ID_1) {                     if (SystemProperties.get("ro.mtk_gemini_support").equals("1") == true) {                         /* GEMINI or GEMINI+ project */                         resId = R.string.appI_name;                     } else {                         /* Single card project */                         resId = R.string.app_name;                     }                 } else if (slotId == PhoneConstants.SIM_ID_2){                     resId = R.string.appII_name;                 }                 msg.title = getResources().getString(resId);            }            byte[] target = {0x0d, 0x0a};            String strTarget = new String(target);            String strLine = System.getProperty("line.separator");            String strText = msg.text.replaceAll(strTarget, strLine);            msg.text = strText;            launchTextDialog(slotId);            break;

之所以显示这个对话框,是因为SIM卡上报DISPLAY TEXT命令,然后STK应用的StkAppService服务显示这个通知:

    private void launchTextDialog(int slotId) {        CatLog.d(LOG_TAG, "launchTextDialog, slotId: " + slotId +                ", mDelayToCheckTime: " + mStkContext[slotId].mDelayToCheckTime);        if (canShowTextDialog(mStkContext[slotId].mCurrentCmd.geTextMessage(), slotId) == false) {            if (0 >= DELAY_TO_CHECK_IDLE_TIME || DELAY_TO_CHECK_NUM <= mStkContext[slotId].mDelayToCheckTime) {                mStkContext[slotId].mDelayToCheckTime = 0;                CatLog.d(LOG_TAG, "launchTextDialog responseNeeded: " +                mStkContext[slotId].responseNeeded);                if (mStkContext[slotId].responseNeeded) {                    sendOkMessage(slotId);                }                // reset mStkContext[].responseNeeded                if (!mStkContext[slotId].responseNeeded) {                    mStkContext[slotId].responseNeeded = true;                }                handleDelayedCmd(slotId);            } else {                mStkContext[slotId].mDelayToCheckTime++;                delayToCheckIdle(slotId);            }            return;        }        mStkContext[slotId].mDelayToCheckTime = 0;        Intent newIntent = new Intent();        String targetActivity = STK_DIALOG_ACTIVITY_NAME;        int action = getFlagActivityNoUserAction(InitiatedByUserAction.unknown, slotId);        String uriString = STK_DIALOG_URI + System.currentTimeMillis();        //Set unique URI to create a new instance of activity for different slotId.        Uri uriData = Uri.parse(uriString);        if (newIntent != null) {            newIntent.setClassName(PACKAGE_NAME, targetActivity);            newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK                | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS                | getFlagActivityNoUserAction(InitiatedByUserAction.unknown, slotId));            newIntent.setData(uriData);            newIntent.putExtra("TEXT", mStkContext[slotId].mCurrentCmd.geTextMessage());            newIntent.putExtra(SLOT_ID, slotId);            newIntent.putExtra(STK_SOURCE_KEY, mStkAppSourceKey);            startActivity(newIntent);        }    }

找到了显示的地方,去掉也就不是难题了。

更多相关文章

  1. 设置TextView超过一定长度后显示省略号
  2. Android(安卓)WebView相关属性
  3. Android(安卓)开发中的一些小技巧
  4. android.intent.action.MAIN与android.intent.category
  5. android gif view
  6. android屏幕旋转在framework中的修改。
  7. Android搜索视媒体库视频 列表显示选择
  8. Android入门:ImageView介绍
  9. android中的Bitmap用法小结

随机推荐

  1. centos 7 安装android 模拟器genymotion
  2. 2017 Android(安卓)github上优秀开源项目
  3. Android ExpandableListView显示模板
  4. Android与Js交互获取返回值
  5. Android CTS
  6. openssl移植android
  7. Android 随手势进行3D旋转的源码
  8. Android(安卓)判断程序是否是系统程序
  9. Android:week 13总结 绑定服务、音乐播放
  10. Android中按返回键怎么退出一个用程序