Пример #1
0
  public void switchOutputMode() {
    if (TurnkeyUiMainActivity.isResume) {
      MtkLog.i(TAG, "tk ui is running, can't change output mode.");
      return;
    }

    GetCurrentTask ctask = GetCurrentTask.getInstance(mContext);

    if (ctask.isCurActivtyMeidaMainActivity()) {
      toastNofunction();
      return;
    }

    if (!ctask.isCurTaskTKUI() && null != mtv) {
      try {
        int currentOutputMode = mtv.getCurrentOutputMode();
        if (ITVCommon.OUTPUT_MODE_NORMAL == currentOutputMode) {
          pipOn = false;
        }
      } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

      //			 if (isCurrentModePIP()) {
      //			 DestroyApp.getTVDialogView(mContext.getApplicationContext())
      //			 .hide();
      //			 // changeModeToNormal();
      //			 TVOutputCommon common = TVOutputCommon.getInstance(mContext);
      //			 common.stop("sub");
      //			 } else {
      //			 changeModeToPip();
      //			 DestroyApp.getTVDialogView(mContext.getApplicationContext())
      //			 .show(mContext);
      //			 }
      if (pipOn) {
        DestroyApp.getTVDialogView(mContext.getApplicationContext()).hide();
        // changeModeToNormal();
        TVOutputCommon common = TVOutputCommon.getInstance(mContext);
        mTvContent.setScreenPosition("sub", 0, 0, 0, 0);
        // common.stop("sub");
        common.stopEx("sub", true);
        pipOn = false;
      } else {
        changeModeToPip();
        DestroyApp.getTVDialogView(mContext.getApplicationContext()).show(mContext);
        //				DestroyApp.getTVDialogView(mContext.getApplicationContext())
        //						.startCheckPosition();
        pipOn = true;
      }
    }
  }
Пример #2
0
  public void resumeMainOutputWithNoConnect() {
    setTvNormal(true);
    MtkLog.i(TAG, "~~~~~~~~~~~~~~~~~enter resumeMainOutputWithNoConnect");

    mTvContent.enterTV();

    mTvInputManager.enterOutputMode(TVInputCommon.OUTPUT_MODE_NORMAL);
    DestroyApp.getTVDialogView(mContext.getApplicationContext()).hide();
  }
Пример #3
0
 /** for user to set sub screen to appropriate size. */
 public void changePipSize() {
   if (isCurrentModePIP()) {
     currentSize++;
     if (currentSize > PIP_SIZE_LARGE) {
       currentSize = PIP_SIZE_SMALL;
     }
     setScreenPos();
     setTvViewPosition();
     DestroyApp.getTVDialogView(mContext.getApplicationContext()).hide();
     mTvContent.setScreenPosition("sub", x, y, w, h);
     myHandler.removeMessages(MessageType.MESSAGE_FOR_PIPSIZE_DELAY);
     myHandler.sendEmptyMessageDelayed(
         MessageType.MESSAGE_FOR_PIPSIZE_DELAY, MessageType.FOR_PIPSIZE_DELAY_TIME);
   }
 }
Пример #4
0
 public void handleMessage(Message msg) {
   switch (msg.what) {
     case MessageType.MESSAGE_FOR_PIPSIZE_DELAY:
       //				setTvViewPosition();
       DestroyApp.getTVDialogView(mContext.getApplicationContext()).show(mContext);
       break;
     case MessageType.MESSAGE_FOR_CHECK_SWAP:
       MtkLog.d(TAG, "come in myHandler MESSAGE_FOR_CHECK_SWAP");
       GetCurrentTask currentTask = GetCurrentTask.getInstance(mContext);
       if (currentTask.isCurActivityTkuiMainActivity() && !isTvNormal()) {
         MtkLog.d(TAG, "come in myHandler MESSAGE_FOR_CHECK_SWAP to resume TV");
         resumeMainOutput();
       } else {
         MtkLog.i(TAG, "~~~~~~~~~~~~" + currentTask.getCurRunningClass());
       }
       break;
     default:
       break;
   }
 }
Пример #5
0
  public void resumeMainOutput() {
    setTvNormal(true);
    MtkLog.i(TAG, "~~~~~~~~~~~~~~~~~enter resumeMainOutput");

    mTvContent.enterTV();

    //		mTvInputManager.enterOutputMode(TVInputCommon.OUTPUT_MODE_NORMAL);
    try {
      if (null != mtv) {
        mtv.enterOutputMode(ITVCommon.OUTPUT_MODE_NORMAL);
      }

    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    TVOutput output = mTvInputManager.getOutput("main");
    if (null != output) {
      output.connect(output.getInput());
    }
    DestroyApp.getTVDialogView(mContext.getApplicationContext()).hide();
  }
Пример #6
0
 private void setTvViewPosition() {
   DestroyApp.getTVDialogView(mContext.getApplicationContext()).setTvViewPosition(x, y, w, h);
   DestroyApp.getTVDialogView(mContext.getApplicationContext()).show(mContext);
 }