@Override
 public void handleMessage(Message msg) {
   switch (msg.what) {
     case MSG_ID_LOAD_ICON_DONE:
       sendCmdParams(setIcons(msg.obj));
       break;
   }
 }
  void make(BerTlv berTlv, IconLoader iconLoader) {
    if (berTlv == null) {
      return;
    }
    CatLog.d(this, "IconLoader received: " + iconLoader);
    // reset global state parameters.
    mIconLoader = iconLoader;
    mCmdParams = null;
    mIconLoadState = LOAD_NO_ICON;
    // only proactive command messages are processed.
    if (berTlv.getTag() != BerTlv.BER_PROACTIVE_COMMAND_TAG) {
      sendCmdParams(ResultCode.CMD_TYPE_NOT_UNDERSTOOD);
      return;
    }
    boolean cmdPending = false;
    List<ComprehensionTlv> ctlvs = berTlv.getComprehensionTlvs();
    // process command dtails from the tlv list.
    CommandDetails cmdDet = processCommandDetails(ctlvs);
    if (cmdDet == null) {
      sendCmdParams(ResultCode.CMD_TYPE_NOT_UNDERSTOOD);
      return;
    }

    // extract command type enumeration from the raw value stored inside
    // the Command Details object.
    AppInterface.CommandType cmdType = AppInterface.CommandType.fromInt(cmdDet.typeOfCommand);
    if (cmdType == null) {
      // This PROACTIVE COMMAND is presently not handled. Hence set
      // result code as BEYOND_TERMINAL_CAPABILITY in TR.
      mCmdParams = new CommandParams(cmdDet);
      sendCmdParams(ResultCode.BEYOND_TERMINAL_CAPABILITY);
      return;
    }

    try {
      switch (cmdType) {
        case SET_UP_MENU:
          cmdPending = processSelectItem(cmdDet, ctlvs);
          break;
        case SELECT_ITEM:
          cmdPending = processSelectItem(cmdDet, ctlvs);
          break;
        case DISPLAY_TEXT:
          cmdPending = processDisplayText(cmdDet, ctlvs);
          break;
        case SET_UP_IDLE_MODE_TEXT:
          cmdPending = processSetUpIdleModeText(cmdDet, ctlvs);
          break;
        case GET_INKEY:
          cmdPending = processGetInkey(cmdDet, ctlvs);
          break;
        case GET_INPUT:
          cmdPending = processGetInput(cmdDet, ctlvs);
          break;
        case SEND_DTMF:
        case SEND_SMS:
        case SEND_SS:
        case SEND_USSD:
          cmdPending = processEventNotify(cmdDet, ctlvs);
          break;
        case GET_CHANNEL_STATUS:
        case SET_UP_CALL:
          cmdPending = processSetupCall(cmdDet, ctlvs);
          break;
        case REFRESH:
          processRefresh(cmdDet, ctlvs);
          cmdPending = false;
          break;
        case LAUNCH_BROWSER:
          cmdPending = processLaunchBrowser(cmdDet, ctlvs);
          break;
        case PLAY_TONE:
          cmdPending = processPlayTone(cmdDet, ctlvs);
          break;
        case SET_UP_EVENT_LIST:
          cmdPending = processSetUpEventList(cmdDet, ctlvs);
          break;
        case PROVIDE_LOCAL_INFORMATION:
          cmdPending = processProvideLocalInfo(cmdDet, ctlvs);
          break;
        case OPEN_CHANNEL:
        case CLOSE_CHANNEL:
        case RECEIVE_DATA:
        case SEND_DATA:
          cmdPending = processBIPClient(cmdDet, ctlvs);
          break;
        default:
          // unsupported proactive commands
          mCmdParams = new CommandParams(cmdDet);
          sendCmdParams(ResultCode.BEYOND_TERMINAL_CAPABILITY);
          return;
      }
    } catch (ResultException e) {
      CatLog.d(this, "make: caught ResultException e=" + e);
      mCmdParams = new CommandParams(cmdDet);
      sendCmdParams(e.result());
      return;
    }
    if (!cmdPending) {
      sendCmdParams(ResultCode.OK);
    }
  }