QCamera2: Handle thermal events in additional states

- Currently thermal events will be discarded in picture
  taking and preview stopped state. If the camera user
  does continuously press the shutter button we could
  depending on timing receive thermal events in these
  states as well.

Change-Id: Iec83b7cab4857dafe174fef26b926c3ffbc83bd9
diff --git a/QCamera2/HAL/QCameraStateMachine.cpp b/QCamera2/HAL/QCameraStateMachine.cpp
index cf828e5..a072adb 100644
--- a/QCamera2/HAL/QCameraStateMachine.cpp
+++ b/QCamera2/HAL/QCameraStateMachine.cpp
@@ -534,6 +534,12 @@
             m_parent->signalAPIResult(&result);
         }
         break;
+    case QCAMERA_SM_EVT_THERMAL_NOTIFY:
+        {
+            rc = m_parent->updateThermalLevel(
+                    *(qcamera_thermal_level_enum_t *)&payload);
+        }
+        break;
     case QCAMERA_SM_EVT_EVT_NOTIFY:
         {
             mm_camera_event_t *cam_evt = (mm_camera_event_t *)payload;
@@ -556,7 +562,6 @@
     case QCAMERA_SM_EVT_EVT_INTERNAL:
     case QCAMERA_SM_EVT_JPEG_EVT_NOTIFY:
     case QCAMERA_SM_EVT_SNAPSHOT_DONE:
-    case QCAMERA_SM_EVT_THERMAL_NOTIFY:
     default:
         ALOGE("%s: cannot handle evt(%d) in state(%d)", __func__, evt, m_state);
         break;
@@ -1590,6 +1595,11 @@
         }
         break;
     case QCAMERA_SM_EVT_THERMAL_NOTIFY:
+        {
+            rc = m_parent->updateThermalLevel(
+                    *(qcamera_thermal_level_enum_t *)&payload);
+        }
+        break;
     default:
         ALOGE("%s: cannot handle evt(%d) in state(%d)", __func__, evt, m_state);
         break;