Пример #1
0
 public void dispose() {
   mStateStart = null;
   mStateCmdParamsReady = null;
   mCmdParamsFactory.dispose();
   mCmdParamsFactory = null;
   mCurrentRilMessage = null;
   mCaller = null;
   sInstance = null;
 }
Пример #2
0
  private RilMessageDecoder(Handler caller, IccFileHandler fh) {
    super("RilMessageDecoder");

    addState(mStateStart);
    addState(mStateCmdParamsReady);
    setInitialState(mStateStart);

    mCaller = caller;
    mCmdParamsFactory = CommandParamsFactory.getInstance(this, fh);
  }
Пример #3
0
  private boolean decodeMessageParams(RilMessage rilMsg) {
    boolean decodingStarted;

    mCurrentRilMessage = rilMsg;
    switch (rilMsg.mId) {
      case CatService.MSG_ID_SESSION_END:
      case CatService.MSG_ID_CALL_SETUP:
        mCurrentRilMessage.mResCode = ResultCode.OK;
        sendCmdForExecution(mCurrentRilMessage);
        decodingStarted = false;
        break;
      case CatService.MSG_ID_PROACTIVE_COMMAND:
      case CatService.MSG_ID_EVENT_NOTIFY:
      case CatService.MSG_ID_REFRESH:
        byte[] rawData = null;
        try {
          rawData = IccUtils.hexStringToBytes((String) rilMsg.mData);
        } catch (Exception e) {
          // zombie messages are dropped
          CatLog.d(this, "decodeMessageParams dropping zombie messages");
          decodingStarted = false;
          break;
        }
        try {
          // Start asynch parsing of the command parameters.
          mCmdParamsFactory.make(BerTlv.decode(rawData));
          decodingStarted = true;
        } catch (ResultException e) {
          // send to Service for proper RIL communication.
          CatLog.d(this, "decodeMessageParams: caught ResultException e=" + e);
          mCurrentRilMessage.mResCode = e.result();
          sendCmdForExecution(mCurrentRilMessage);
          decodingStarted = false;
        }
        break;
      default:
        decodingStarted = false;
        break;
    }
    return decodingStarted;
  }