QCamera2/HAL: Adds run-time enabling of debug logs

- replaces all ALOGV, ALOGI to CDBG
- replaces all ALOGD to CDBG_HIGH
- All [KPI Perf] logs are marked to CDBG_HIGH
- Change non-error log messages to CDBG_HIGH
- adds the property "persist.camera.logs". This chooses debug
log level and this will not affect the error logs.
- property is read when the HAL is initialized (target is reboot)
  as well as when "adb shell dumpsys media.camera" is called
- 0: turns off CDBG and CDBG_HIGH logs
- 1: turns-on CDBG_HIGH logs
- 2: turns-on CDBG_HIGH and CDBG logs
- Defualt  value set to 1(CDBG_HIGH turn on)

Conflicts:
	QCamera2/HAL/QCamera2HWI.cpp
Change-Id: Icfdcb3132c819f742eaa48760392a3c45b32be7e
diff --git a/QCamera2/HAL/QCameraStateMachine.cpp b/QCamera2/HAL/QCameraStateMachine.cpp
index 9dc67e9..2747e4b 100644
--- a/QCamera2/HAL/QCameraStateMachine.cpp
+++ b/QCamera2/HAL/QCameraStateMachine.cpp
@@ -51,7 +51,7 @@
     int running = 1, ret;
     QCameraStateMachine *pme = (QCameraStateMachine *)data;
 
-    ALOGD("%s: E", __func__);
+    CDBG_HIGH("%s: E", __func__);
     do {
         do {
             ret = cam_sem_wait(&pme->cmd_sem);
@@ -93,7 +93,7 @@
             node = NULL;
         }
     } while (running);
-    ALOGD("%s: X", __func__);
+    CDBG_HIGH("%s: X", __func__);
     return NULL;
 }
 
@@ -144,7 +144,7 @@
 
             /* wait until cmd thread exits */
             if (pthread_join(cmd_pid, NULL) != 0) {
-                ALOGD("%s: pthread dead already\n", __func__);
+                CDBG_HIGH("%s: pthread dead already\n", __func__);
             }
         }
         cmd_pid = 0;
@@ -432,7 +432,7 @@
     case QCAMERA_SM_EVT_STOP_PREVIEW:
         {
             // no op needed here
-            ALOGD("%s: already in preview stopped state, do nothing", __func__);
+            CDBG_HIGH("%s: already in preview stopped state, do nothing", __func__);
             result.status = NO_ERROR;
             result.request_api = evt;
             result.result_type = QCAMERA_API_RESULT_TYPE_DEF;
@@ -507,7 +507,7 @@
     case QCAMERA_SM_EVT_CANCEL_PICTURE:
         {
             // no op needed here
-            ALOGD("%s: No ops for evt(%d) in state(%d)", __func__, evt, m_state);
+            CDBG_HIGH("%s: No ops for evt(%d) in state(%d)", __func__, evt, m_state);
             result.status = NO_ERROR;
             result.request_api = evt;
             result.result_type = QCAMERA_API_RESULT_TYPE_DEF;
@@ -1013,7 +1013,7 @@
     case QCAMERA_SM_EVT_START_NODISPLAY_PREVIEW:
         {
             // no ops here
-            ALOGD("%s: Already in previewing, no ops here to start preview", __func__);
+            CDBG_HIGH("%s: Already in previewing, no ops here to start preview", __func__);
             rc = NO_ERROR;
             result.status = rc;
             result.request_api = evt;
@@ -1258,7 +1258,7 @@
                 }
                 break;
             default:
-                ALOGD("%s: no handling for server evt (%d) at this state",
+                CDBG_HIGH("%s: no handling for server evt (%d) at this state",
                       __func__, cam_evt->server_event_type);
                 break;
             }
@@ -1354,7 +1354,7 @@
                 rc = m_parent->processAutoFocusEvent(internal_evt->focus_data);
                 break;
             case QCAMERA_INTERNAL_EVT_PREP_SNAPSHOT_DONE:
-                ALOGI("%s: Received QCAMERA_INTERNAL_EVT_PREP_SNAPSHOT_DONE event",
+                CDBG("%s: Received QCAMERA_INTERNAL_EVT_PREP_SNAPSHOT_DONE event",
                     __func__);
                 m_parent->processPrepSnapshotDoneEvent(internal_evt->prep_snapshot_state);
                 m_state = QCAMERA_SM_STATE_PREVIEWING;
@@ -1727,7 +1727,7 @@
                 }
                 break;
             default:
-                ALOGD("%s: no handling for server evt (%d) at this state",
+                CDBG_HIGH("%s: no handling for server evt (%d) at this state",
                       __func__, cam_evt->server_event_type);
                 break;
             }
@@ -1813,7 +1813,7 @@
         {
             // WA: CTS test VideoSnapshot will try to
             //     start preview during video recording.
-            ALOGE("CTS video restart op");
+            CDBG_HIGH("CTS video restart op");
             rc = NO_ERROR;
             result.status = rc;
             result.request_api = evt;
@@ -1991,7 +1991,7 @@
     case QCAMERA_SM_EVT_START_RECORDING:
         {
             // no ops here
-            ALOGD("%s: already in recording state, no ops for start_recording", __func__);
+            CDBG_HIGH("%s: already in recording state, no ops for start_recording", __func__);
             rc = 0;
             result.status = rc;
             result.request_api = evt;