Android 2.3.7.r1 camera recording stops when the menu menu key is pressed during recording

  • 2020-05-10 18:47:38
  • OfStack

Android 2.3.7.r1 stops recording when you press menu. Press the menu key when changing to video recording without processing. The following modifications can be made:
In packages/apps/CameraOpen/src/com/mediatek/camera/VideoCamera java
In the onKeyDown() method:
Modify the
 
case KeyEvent.KEYCODE_MENU: 
if (mHeadUpDisplay != null && mGLRootView != null 
&& !mAlertShowing && !mMediaRecorderRecording 
&& mHeadUpDisplay.getWidth() != 0) { 
mHeadUpDisplay.barsSwitch(); 
} 
if (mMediaRecorderRecording) { 
onStopVideoRecording(true); 
return true; 
} else if (event.isLongPress()) { 
return true; // consume long press to prevent soft keyboard 
} 
break; 
 To:  
case KeyEvent.KEYCODE_MENU: 
if (mHeadUpDisplay != null && mGLRootView != null 
&& !mAlertShowing && !mMediaRecorderRecording 
&& mHeadUpDisplay.getWidth() != 0) { 
mHeadUpDisplay.barsSwitch(); 
} 
if (event.isLongPress()) { 
return true; // consume long press to prevent soft keyboard 
} 
break; 

Related articles: