sensor: change als timestamp to CLOCK_BOOTTIME

CLOCK_BOOTTIME includes suspend time, so it would allow aplications
to get correct time difference between two events even when system
resumes from suspend state.

Change-Id: I6986506105aaa4220ccca49738d089b630648317
Tracked-On: https://jira.ndg.intel.com/browse/MARVIN-893
Signed-off-by: Baixing Tan <baixingx.tan@intel.com>
Reviewed-on: https://android.intel.com/422142
Reviewed-by: jenkins_ndg <jenkins_ndg@intel.com>
Reviewed-by: Yan, Like <like.yan@intel.com>
Tested-by: Yan, Like <like.yan@intel.com>
Reviewed-by: Akue, LoicX <loicx.akue@intel.com>
Reviewed-by: Tasayco Loarte, VictorX <victorx.tasayco.loarte@intel.com>
diff --git a/als/SensorBase.cpp b/als/SensorBase.cpp
index d8cfc43..5617e92 100644
--- a/als/SensorBase.cpp
+++ b/als/SensorBase.cpp
@@ -35,10 +35,18 @@
                                                 data_fd(-1)
 {
     FUNC_LOG;
+    int ret;
+    unsigned int clockId;
     ALOGV("%s(): dev_name=%s, data_name=%s ", __func__, dev_name, data_name);
 
     if (data_name) {
         data_fd = openInput(data_name);
+        if (data_fd >= 0) {
+            clockId = CLOCK_BOOTTIME;
+            ret = ioctl(data_fd, EVIOCSCLOCKID, &clockId);
+            if (ret != 0)
+               ALOGE("set timestamp to CLOCK_BOOTTIME failed!");
+        }
     }
 }