@Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_MUTE: case KeyEvent.KEYCODE_DPAD_UP: case KeyEvent.KEYCODE_DPAD_DOWN: case KeyEvent.KEYCODE_DPAD_LEFT: case KeyEvent.KEYCODE_DPAD_RIGHT: /// M: Code analyze 010, fix bug ALPS00264030, no response for menu key @{ case KeyEvent.KEYCODE_MENU: /// @} break; case KeyEvent.KEYCODE_BACK: if ((mSmilPlayer != null) && (mSmilPlayer.isPausedState() || mSmilPlayer.isPlayingState() || mSmilPlayer.isPlayedState())) { mSmilPlayer.stop(); } break; default: if ((mSmilPlayer != null) && (mMediaController != null)) { mMediaController.show(); } } return super.onKeyDown(keyCode, event); }
@Override protected void onPause() { super.onPause(); /// M: Code analyze 008, fix bug ALPS00236567, hide the mediaControl when activity paused /// so onTouchEvent excute show @{ if (mMediaController != null) { /// M: Must do this so we don't leak a window. mMediaController.hide(); } /// @} if (mSmilDoc != null) { ((EventTarget) mSmilDoc) .removeEventListener(SmilDocumentImpl.SMIL_DOCUMENT_END_EVENT, this, false); } /// M: Code analyze 002, fix bug ALPS00111374, whether need resume @{ if ((null != mSmilPlayer)) { if (mSmilPlayer.isPlayingState()) { mSmilPlayer.pause(); bNeedResume = true; } else if (mSmilPlayer.isPausedState()) { bNeedResume = false; } } /// @} }