STK

SIM Card Tool Kit

Android 去掉运营商STK对话框提示_第1张图片

Android 去掉运营商STK对话框提示_第2张图片

相关代码位置:

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. Android产生一个提示框
  2. Android 编译提示R文件找不到
  3. android studio更新提示网络连接失败的解决办法
  4. Android 对话框(Dialog)大全 建立你自己的对话框
  5. Android 代码自动提示功能
  6. Android:常见错误提示
  7. android 自定义对话框
  8. android 对话框集合
  9. android通知栏提示

随机推荐

  1. Android的UI组件复选框控件CheckBox
  2. 移动应用平台首选iOS还是Android?
  3. UI控件之菜单(Menu)
  4. 安卓学习路径 从入门到精通到项目实战教
  5. Android使用Volley请求网络
  6. Android官方开发文档Training系列课程中
  7. 【Android(安卓)修炼手册】常用技术篇 --
  8. Android触摸事件的应用
  9. 记事:ubuntu 9.10(WUBI,windows安装)环境下
  10. 用kotlin方式打开《第一行代码:Android》