OSDN Git Service

Merge branch 'lineage-16.0' of https://github.com/me176c-dev/android_hardware_iio...
[android-x86/hardware-intel-libsensors.git] / entry.c
diff --git a/entry.c b/entry.c
index 3a4fa34..a914f44 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -1,6 +1,18 @@
 /*
- * Copyright (C) 2014-2015 Intel Corporation.
- */
+// Copyright (c) 2015 Intel Corporation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+*/
 
 #include <hardware/sensors.h>
 #include <utils/Log.h>
@@ -9,6 +21,8 @@
 #include "description.h"
 #include "utils.h"
 
+#include <errno.h>
+
 /* This is the IIO Sensors HAL module entry points file */
 
 static int init_count;
@@ -23,7 +37,7 @@ static int activate (__attribute__((unused)) struct sensors_poll_device_t* dev,
        if (init_count == 0 || handle < 0 || handle >= sensor_count)
                return -EINVAL;
 
-       entry_ts = get_timestamp_boot();
+       entry_ts = get_timestamp_thread();
 
        /*
         * The Intel sensor hub seems to have trouble enabling sensors before
@@ -47,7 +61,7 @@ static int activate (__attribute__((unused)) struct sensors_poll_device_t* dev,
 
        ret = sensor_activate(handle, enabled, 0);
 
-       elapsed_ms = (int) ((get_timestamp_boot() - entry_ts) / 1000000);
+       elapsed_ms = (int) ((get_timestamp_thread() - entry_ts) / 1000000);
 
        if (elapsed_ms) {
                if (enabled)