public void handleMessage(android.os.Message msg) {
   switch (msg.what) {
     case CHANGE_COLOR:
       if (mTestNo > TestColor.length - 1) {
         finishHdmiTest();
         return;
       }
       ControlButtonUtil.Hide();
       mShowTime.setVisibility(View.VISIBLE);
       mTestView.setVisibility(View.VISIBLE);
       mResult.setText(R.string.HdmiStart);
       mTestView.setBackgroundColor(TestColor[mTestNo++]);
       sendEmptyMessageDelayed(CHANGE_COLOR, 1500);
       break;
     case HDMI_SCAN:
       this.removeMessages(HDMI_SCAN);
       if (startHdmiTest()) {
         mResult.setText(R.string.HdmiPrepare);
         // setHdmiConfig(HdmiFile, true);
         mTestNo = 0;
         sendEmptyMessageDelayed(CHANGE_COLOR, 4000);
       } else {
         sendEmptyMessageDelayed(HDMI_SCAN, 500);
       }
       break;
     default:
       break;
   }
 }
 public void finishHdmiTest() {
   ((Button) findViewById(R.id.btn_Pass)).setVisibility(View.VISIBLE);
   ControlButtonUtil.Show();
   isStart = false;
   mShowTime.setVisibility(View.GONE);
   mTestView.setVisibility(View.GONE);
   mResult.setText(R.string.HdmiResult);
   //        setHdmiConfig(HdmiFile, false);
 }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // DeviceTest.lockScreenOrientation(this);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().addFlags(FLAG_FULLSCREEN | FLAG_KEEP_SCREEN_ON);
    setContentView(R.layout.hdmitest);

    mTestView = (LcdTestView) findViewById(R.id.lcdtestview);
    mResult = (TextView) findViewById(R.id.result);
    mShowTime = (TextView) findViewById(R.id.TimeShow);
    mTestNo = 0;

    ControlButtonUtil.initControlButtonView(this);
    ((Button) findViewById(R.id.btn_Pass)).setVisibility(View.INVISIBLE);

    if (mReceiver == null) {
      mReceiver = new HDMIServiceReceiver();
    }
    IntentFilter filter = new IntentFilter();
    filter.addAction(Intent.ACTION_HDMI_PLUG);
    filter.addAction(Intent.ACTION_HEADSET_PLUG);
    filter.addAction(ACTION_IPO_BOOTUP);
    filter.addAction(ACTION_IPO_SHUTDOWN);
    registerReceiver(mReceiver, filter);
    mTestView.setOnTouchListener(
        new View.OnTouchListener() {
          public boolean onTouch(View arg0, MotionEvent arg1) {
            final int action = arg1.getAction();
            if (!isHdmiConnected) {
              switch (action) {
                case MotionEvent.ACTION_DOWN:
                  Intent mintent = new Intent();
                  mintent.setComponent(
                      new ComponentName(
                          "com.android.settings", "com.android.settings.HDMISettings"));
                  startActivity(mintent);
                  break;
                case MotionEvent.ACTION_MOVE:
                case MotionEvent.ACTION_UP:
                  break;
              }
            }
            return true;
          }
        });
  }
  protected void onCreate(Bundle savedInstanceState) {
    Log.d(TAG, "=========onCreate============");
    super.onCreate(savedInstanceState);
    // DeviceTest.lockScreenOrientation(this);
    setTitle(
        getTitle() + "----(" + getIntent().getStringExtra(DeviceTest.EXTRA_TEST_PROGRESS) + ")");
    // requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().addFlags(FLAG_FULLSCREEN | FLAG_KEEP_SCREEN_ON);

    setContentView(R.layout.mriousbtest);
    ControlButtonUtil.initControlButtonView(this);

    mUsbStateReceiver = new UsbConnectedBroadcastReceiver();

    mUsbPluginText = (TextView) findViewById(R.id.pluginTest);

    mUsbUnplugText = (TextView) findViewById(R.id.unplugTest);
    findViewById(R.id.btn_Pass).setVisibility(View.INVISIBLE);
  }