Camera: Cancel Liveshot if stoprecording is issued.
While liveshot is in progress, if stoprecording is issued,
cancel liveshot so that liveshot related resources are properly
cleaned up and state transition happens to previewing state.
CRs-Fixed: 588698
Change-Id: I7c64ab537c92265a2df7503bcd75ac6d8fea9c2c
diff --git a/QCamera2/HAL/QCameraStateMachine.cpp b/QCamera2/HAL/QCameraStateMachine.cpp
index 94ea485..7aaa202 100644
--- a/QCamera2/HAL/QCameraStateMachine.cpp
+++ b/QCamera2/HAL/QCameraStateMachine.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2013, The Linux Foundataion. All rights reserved.
+/* Copyright (c) 2012-2014, The Linux Foundataion. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -2288,8 +2288,12 @@
break;
case QCAMERA_SM_EVT_STOP_RECORDING:
{
+ rc = m_parent->cancelLiveSnapshot();
+ m_state = QCAMERA_SM_STATE_RECORDING;
+
rc = m_parent->stopRecording();
- m_state = QCAMERA_SM_STATE_PREVIEW_PIC_TAKING;
+ m_state = QCAMERA_SM_STATE_PREVIEWING;
+
result.status = rc;
result.request_api = evt;
result.result_type = QCAMERA_API_RESULT_TYPE_DEF;