首页 > 代码库 > [FAQ10059] 在连拍过程中松开拍照键连拍不停止 Download
[FAQ10059] 在连拍过程中松开拍照键连拍不停止 Download
[FAQ10059] 在连拍过程中松开拍照键连拍不停止 Download
Platform:MT6589MT6572MT6582
Branch:JB2JB3JB5
FAQ Content
[DESCRIPTION]
进入camera长按拍照进行连拍,概率性出现松开拍照键连拍不停止的问题,可以按以下方法修改。
此问题属于performance问题,eng版本比user版本会多做一些mtklog等其他的操作,本身loading就比较重,所以performance相对来讲会差一些,建议修改后在user版本上进行测试。
[SOLUTION]
1、在InputDispatcher.cpp中做如下修改:
void InputDispatcher::notifyMotion(const NotifyMotionArgs* args) {
#if DEBUG_INBOUND_EVENT_DETAILS
ALOGD("notifyMotion - eventTime=%lld, deviceId=%d, source=0x%x, policyFlags=0x%x, "
"action=0x%x, flags=0x%x, metaState=0x%x, buttonState=0x%x, edgeFlags=0x%x, "
"xPrecision=%f, yPrecision=%f, downTime=%lld",
args->eventTime, args->deviceId, args->source, args->policyFlags,
args->action, args->flags, args->metaState, args->buttonState,
args->edgeFlags, args->xPrecision, args->yPrecision, args->downTime);
for (uint32_t i = 0; i < args->pointerCount; i++) {
ALOGD(" Pointer %d: id=%d, toolType=%d, "
"x=%f, y=%f, pressure=%f, size=%f, "
"touchMajor=%f, touchMinor=%f, toolMajor=%f, toolMinor=%f, "
"orientation=%f",
i, args->pointerProperties[i].id,
args->pointerProperties[i].toolType,
args->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_X),
args->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_Y),
args->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_PRESSURE),
args->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_SIZE),
args->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MAJOR),
args->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MINOR),
args->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_TOOL_MAJOR),
args->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_TOOL_MINOR),
args->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_ORIENTATION));
}
#endif
//add start
bool isEmpty = mInboundQueue.isEmpty();
if (!isEmpty)
{
EventEntry *tail = static_cast<MotionEntry*>(mInboundQueue.tail);
if (tail != NULL && tail->type == EventEntry::TYPE_MOTION )
{
MotionEntry* tailEntry = static_cast<MotionEntry*>(tail);
if (tailEntry->action == args->action
&& tailEntry->downTime == args->downTime
&& tailEntry->pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_X) == args->pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_X)
&& tailEntry->pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_Y) == args->pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_Y)
)
{
ALOGD("MTK debug notifyMotion drop motion event because of same x and y, action =0x%x ",args->action);
return;
}
}
}
ALOGD("MTK debug notifyMotion not drop ");
//add end
if (!validateMotionEvent(args->action, args->pointerCount, args->pointerProperties)) {
return;
}
。。。。
}
2、 在orientationManager.java中添加以下两个函数:
public void enableOrientationManager(){
mOrientationListener.enable();
}
public void disableOrientationManager(){
mOrientationListener.disable();
}
3、 在AbstractGalleryActivity.java中添加以下两个函数:
public void enableOrientationManager(){
mOrientationManager.enableOrientationManager();
}
public void disableOrientationManager(){
mOrientationManager.disableOrientationManager();
}
4、在apps/Camera/src/com/android/camera/Camera.java中添加如下代码:
public void enableOrientationListener() {
mOrientationListener.enable();
}
public void disableOrientationListener() {
mOrientationListener.disable();
}
@Override
public void enableOrientationManager(){
super.enableOrientationManager();
}
@Override
public void disableOrientationManager(){
super.disableOrientationManager();
}
5、在apps/Camera/src/com/android/camera/actor/PhotoActor.java中:
5.1、在onBurstSaveDone()中做如下修改:
public void onBurstSaveDone() {
if (!mCameraClosed && !mCamera.isImageCaptureIntent()) {
mCamera.cancelContinuousShot();
restartPreview(false);
}
//add start
mCamera.enableOrientationListener();
mCamera.enableOrientationManager();
//add end
mSavingPictures = false;
}
5.2、在onShutterButtonLongPressed()中做如下修改:
mMemoryManager.initMemory();
mContinuousShotPerformed = true;
mCurrentShotsNum = 0;
//add start
mCamera.disableOrientationListener();
mCamera.disableOrientationManager();
//add end
mCamera.applyContinousShot();
mCamera.getThumbnailManager().setRefreshInterval(THUMBNAIL_REFRESH_CONTINUOUS);
mCamera.getFocusManager().clearFocusOnContinuous();
mCamera.getFocusManager().doSnap();
[FAQ10059] 在连拍过程中松开拍照键连拍不停止 Download