diff --git a/include/hardware/hardware_properties.h b/include/hardware/hardware_properties.h
deleted file mode 100644
index 7c9bd4e..0000000
--- a/include/hardware/hardware_properties.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * 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.
- */
-
-#ifndef ANDROID_INCLUDE_HARDWARE_HARDWAREPROPERTIES_H
-#define ANDROID_INCLUDE_HARDWARE_HARDWAREPROPERTIES_H
-
-#include <stdint.h>
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-#include <hardware/hardware.h>
-
-__BEGIN_DECLS
-
-#define HARDWARE_PROPERTIES_HARDWARE_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1)
-
-/**
- * The id of this module
- */
-#define HARDWARE_PROPERTIES_HARDWARE_MODULE_ID "hardware_properties"
-
-/**
- * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
- * and the fields of this data structure must begin with hw_module_t
- * followed by module specific information.
- */
-typedef struct hardware_properties_module {
-    struct hw_module_t common;
-
-    /*
-     * (*getCpuTemperatures) is called to get CPU temperatures in Celsius of
-     * each core.
-     *
-     * Returns number of cores or negative value on error.
-     *
-     */
-    ssize_t (*getCpuTemperatures)(struct hardware_properties_module *module, float **temps);
-
-    /*
-     * (*getGpuTemperatures) is called to get GPU temperatures in Celsius of
-     * each GPU.
-     *
-     * Returns number of GPUs or negative value on error.
-     *
-     */
-    ssize_t (*getGpuTemperatures)(struct hardware_properties_module *module, float **temps);
-
-    /*
-     * (*getBatteryTemperatures) is called to get battery temperatures in
-     * Celsius.
-     *
-     * Returns number of battery temperatures or negative value on error.
-     *
-     */
-    ssize_t (*getBatteryTemperatures)(struct hardware_properties_module *module, float **temps);
-
-    /*
-     * (*getCpuUsages) is called to get CPU usage information of each core:
-     * active and total times in ms since first boot.
-     *
-     * Returns number of cores or negative value on error.
-     *
-     */
-    ssize_t (*getCpuUsages)(struct hardware_properties_module *module,
-                            int64_t **active_times, int64_t **total_times);
-
-    /*
-     * (*getFanSpeeds) is called to get the fan speeds in RPM of each fan.
-     *
-     * Returns number of fans or negative value on error.
-     *
-     */
-    ssize_t (*getFanSpeeds)(struct hardware_properties_module *module,
-                        float **fan_speeds);
-} hardware_properties_module_t;
-
-__END_DECLS
-
-#endif  // ANDROID_INCLUDE_HARDWARE_HARDWAREPROPERTIES_H
diff --git a/include/hardware/thermal.h b/include/hardware/thermal.h
new file mode 100644
index 0000000..7fdf682
--- /dev/null
+++ b/include/hardware/thermal.h
@@ -0,0 +1,200 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * 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.
+ */
+
+#ifndef ANDROID_INCLUDE_HARDWARE_THERMAL_H
+#define ANDROID_INCLUDE_HARDWARE_THERMAL_H
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <hardware/hardware.h>
+
+__BEGIN_DECLS
+
+#define THERMAL_HARDWARE_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1)
+
+#define THERMAL_HARDWARE_MODULE_ID "thermal"
+
+// This value is returned if a desired temperature is not available.
+#define UNKNOWN_TEMPERATURE -FLT_MAX
+
+/** Device temperature types. Must be kept in sync with
+ * framework/base/core/java/android/os/HardwarePropertiesManager.java
+ */
+enum temperature_type {
+    DEVICE_TEMPERATURE_UNKNOWN  = -1,
+    DEVICE_TEMPERATURE_CPU      = 0,
+    DEVICE_TEMPERATURE_GPU      = 1,
+    DEVICE_TEMPERATURE_BATTERY  = 2,
+    DEVICE_TEMPERATURE_SKIN     = 3
+};
+
+enum cooling_type {
+    /** Fan cooling device speed in RPM. */
+    FAN_RPM                     = 0,
+};
+
+typedef struct {
+  /**
+   * This temperature's type.
+   */
+  enum temperature_type type;
+
+  /**
+   * Name of this temperature.
+   * All temperatures of the same "type" must have a different "name".
+   */
+  const char *name;
+
+  /**
+   * Current temperature in Celsius. If not available set by HAL to
+   * UNKNOWN_TEMPERATURE.
+   * Current temperature can be in any units if
+   * type=DEVICE_TEMPERATURE_UNKNOWN.
+   */
+  float current_value;
+
+  /**
+   * Throttling temperature constant for this temperature.
+   * If not available, set by HAL to UNKNOWN_TEMPERATURE.
+   */
+  float throttling_threshold;
+
+  /**
+   * Shutdown temperature constant for this temperature.
+   * If not available, set by HAL to UNKNOWN_TEMPERATURE.
+   */
+  float shutdown_threshold;
+} temperature_t;
+
+typedef struct {
+    /**
+     * This cooling device type.
+     */
+    enum cooling_type type;
+
+    /**
+     * Name of this cooling device.
+     * All cooling devices of the same "type" must have a different "name".
+     */
+    const char *name;
+
+    /**
+     * Current cooling device value. Units depend on cooling device "type".
+     */
+    float current_value;
+} cooling_device_t;
+
+typedef struct {
+    /**
+     * Name of this CPU.
+     * All CPUs must have a different "name".
+     */
+    const char *name;
+
+    /**
+     * Active time since the last boot in ms.
+     */
+    uint64_t active;
+
+    /**
+     * Total time since the last boot in ms.
+     */
+    uint64_t total;
+
+    /**
+     * Is set to true when a core is online.
+     * If the core is offline, all other members except |name| should be ignored.
+     */
+    bool is_online;
+} cpu_usage_t;
+
+typedef struct thermal_module {
+    struct hw_module_t common;
+
+    /*
+     * (*getTemperatures) is called to get temperatures in Celsius.
+     *
+     * @param list If NULL, this method only returns number of temperatures
+     *     and caller should allocate a temperature_t array with that number
+     *     of elements.
+     *     Caller is responsible for allocating temperature_t array |list| of
+     *     large enough size (not less than returned number of temperatures).
+     *     If |list| is not NULL and this method returns non-negative value,
+     *     it's filled with the current temperatures. If the resulting
+     *     temperature list is longer than |size| elements, the remaining
+     *     temperatures are discarded and not stored, but counted for the value
+     *     returned by this method.
+     *     The order of temperatures of built-in devices (such as CPUs, GPUs and
+     *     etc.) in the |list| is kept the same regardless the number of calls
+     *     to this method even if they go offline, if these devices exist on
+     *     boot. The method always returns and never removes such temperatures.
+     * @param size The capacity of |list|, in elements, if |list| is not NULL.
+     *
+     * @return number of temperatures or negative value -errno on error.
+     *
+     */
+    ssize_t (*getTemperatures)(struct thermal_module *module, temperature_t *list, size_t size);
+
+    /*
+     * (*getCpuUsages) is called to get CPU usage information of each core:
+     *     active and total times in ms since first boot.
+     *
+     * @param list If NULL, this method only returns number of cores and caller
+     *     should allocate a cpu_usage_t array with that number of elements.
+     *     Caller is responsible for allocating cpu_usage_t array |list| of
+     *     large enough size (not less than returned number of CPUs).
+     *     If |list| is not NULL and this method returns non-negative value,
+     *     it's filled with the current CPU usages.
+     *     The order of CPUs in the |list| is kept the same regardless the
+     *     number of calls to this method.
+     *
+     * @return constant number of CPUs or negative value -errno on error.
+     *
+     */
+    ssize_t (*getCpuUsages)(struct thermal_module *module, cpu_usage_t *list);
+
+    /*
+     * (*getCoolingDevices) is called to get the cooling devices information.
+     *
+     * @param list If NULL, this method only returns number of cooling devices
+     *     and caller should allocate a cooling_device_t array with that number
+     *     of elements.
+     *     Caller is responsible for allocating cooling_device_t array |list| of
+     *     large enough size (not less than returned number of cooling devices).
+     *     If |list| is not NULL and this method returns non-negative value,
+     *     it's filled with the current cooling device information. If the
+     *     resulting cooling device list is longer than |size| elements, the
+     *     remaining cooling device informations are discarded and not stored,
+     *     but counted for the value returned by this method.
+     *     The order of built-in coolling devices in the |list| is kept the same
+     *     regardless the number of calls to this method even if they go
+     *     offline, if these devices exist on boot. The method always returns
+     *     and never removes from the list such coolling devices.
+     * @param size The capacity of |list|, in elements, if |list| is not NULL.
+     *
+     * @return number of cooling devices or negative value -errno on error.
+     *
+     */
+    ssize_t (*getCoolingDevices)(struct thermal_module *module, cooling_device_t *list,
+                                 size_t size);
+} thermal_module_t;
+
+__END_DECLS
+
+#endif  // ANDROID_INCLUDE_HARDWARE_THERMAL_H
diff --git a/modules/Android.mk b/modules/Android.mk
index 3dc4ca6..3bd0943 100644
--- a/modules/Android.mk
+++ b/modules/Android.mk
@@ -1,4 +1,4 @@
 hardware_modules := gralloc hwcomposer audio nfc nfc-nci local_time \
 	power usbaudio audio_remote_submix camera usbcamera consumerir sensors vibrator \
-	tv_input fingerprint input vehicle hardware_properties vr
+	tv_input fingerprint input vehicle thermal vr
 include $(call all-named-subdir-makefiles,$(hardware_modules))
diff --git a/modules/hardware_properties/hardware_properties.c b/modules/hardware_properties/hardware_properties.c
deleted file mode 100644
index 89ef423..0000000
--- a/modules/hardware_properties/hardware_properties.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * 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 <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define LOG_TAG "HardwarePropertiesHAL"
-#include <utils/Log.h>
-
-#include <hardware/hardware.h>
-#include <hardware/hardware_properties.h>
-
-static ssize_t get_device_temperatures(
-    struct hardware_properties_module *module, float **temps) {
-    *temps = NULL;
-    errno = ENOSYS;
-    ALOGE("getDeviceTemperatures: %s", strerror(errno));
-    return -1;
-}
-
-static ssize_t get_cpu_usages(struct hardware_properties_module *module,
-                              int64_t **active_times, int64_t **total_times) {
-    *active_times = NULL;
-    *total_times = NULL;
-    errno = ENOSYS;
-    ALOGE("getCpuUsages: %s", strerror(errno));
-    return -1;
-}
-
-static ssize_t get_fan_speeds(struct hardware_properties_module *module,
-                              float **fan_speeds) {
-    *fan_speeds = NULL;
-    errno = ENOSYS;
-    ALOGE("getFanSpeeds: %s", strerror(errno));
-    return -1;
-}
-
-static struct hw_module_methods_t hardware_properties_module_methods = {
-    .open = NULL,
-};
-
-struct hardware_properties_module HAL_MODULE_INFO_SYM = {
-    .common = {
-        .tag = HARDWARE_MODULE_TAG,
-        .module_api_version = HARDWARE_PROPERTIES_HARDWARE_MODULE_API_VERSION_0_1,
-        .hal_api_version = HARDWARE_HAL_API_VERSION,
-        .id = HARDWARE_PROPERTIES_HARDWARE_MODULE_ID,
-        .name = "Default Hardware Properties HAL",
-        .author = "The Android Open Source Project",
-        .methods = &hardware_properties_module_methods,
-    },
-
-    .getCpuTemperatures = get_device_temperatures,
-    .getGpuTemperatures = get_device_temperatures,
-    .getBatteryTemperatures = get_device_temperatures,
-    .getCpuUsages = get_cpu_usages,
-    .getFanSpeeds = get_fan_speeds,
-};
diff --git a/modules/hardware_properties/Android.mk b/modules/thermal/Android.mk
similarity index 83%
rename from modules/hardware_properties/Android.mk
rename to modules/thermal/Android.mk
index 41c02ea..80ad78a 100644
--- a/modules/hardware_properties/Android.mk
+++ b/modules/thermal/Android.mk
@@ -16,10 +16,11 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_MODULE := hardware_properties.default
+LOCAL_MODULE := thermal.default
 LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_SRC_FILES := hardware_properties.c
-LOCAL_SHARED_LIBRARIES := liblog
+LOCAL_SRC_FILES := thermal.c
+LOCAL_SHARED_LIBRARIES := liblog libcutils
 LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -Wno-unused-parameter
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/modules/thermal/thermal.c b/modules/thermal/thermal.c
new file mode 100644
index 0000000..c45d87a
--- /dev/null
+++ b/modules/thermal/thermal.c
@@ -0,0 +1,181 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * 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 <errno.h>
+#include <ctype.h>
+#include <dirent.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define LOG_TAG "ThermalHAL"
+#include <utils/Log.h>
+
+#include <hardware/hardware.h>
+#include <hardware/thermal.h>
+
+#define CPU_LABEL               "CPU"
+#define MAX_LENGTH              50
+
+#define CPU_USAGE_FILE          "/proc/stat"
+#define TEMPERATURE_DIR         "/sys/class/thermal"
+#define THERMAL_DIR             "thermal_zone"
+#define CPU_ONLINE_FILE_FORMAT  "/sys/devices/system/cpu/cpu%d/online"
+#define UNKNOWN_LABEL           "UNKNOWN"
+
+static ssize_t get_temperatures(thermal_module_t *module, temperature_t *list, size_t size) {
+    char file_name[MAX_LENGTH];
+    FILE *file;
+    float temp;
+    size_t idx = 0;
+    DIR *dir;
+    struct dirent *de;
+
+    /** Read all available temperatures from
+     * /sys/class/thermal/thermal_zone[0-9]+/temp files.
+     * Don't guarantee that all temperatures are in Celsius. */
+    dir = opendir(TEMPERATURE_DIR);
+    if (dir == 0) {
+        ALOGE("%s: failed to open directory %s: %s", __func__, TEMPERATURE_DIR, strerror(-errno));
+        return -errno;
+    }
+
+    while ((de = readdir(dir))) {
+        if (!strncmp(de->d_name, THERMAL_DIR, strlen(THERMAL_DIR))) {
+            snprintf(file_name, MAX_LENGTH, "%s/%s/temp", TEMPERATURE_DIR, de->d_name);
+            file = fopen(file_name, "r");
+            if (file == NULL) {
+                continue;
+            }
+            if (1 != fscanf(file, "%f", &temp)) {
+                fclose(file);
+                continue;
+            }
+
+            if (list != NULL && idx < size) {
+                list[idx] = (temperature_t) {
+                    .name = UNKNOWN_LABEL,
+                    .type = DEVICE_TEMPERATURE_UNKNOWN,
+                    .current_value = temp,
+                    .throttling_threshold = UNKNOWN_TEMPERATURE,
+                    .shutdown_threshold = UNKNOWN_TEMPERATURE,
+                };
+            }
+            fclose(file);
+            idx++;
+        }
+    }
+    closedir(dir);
+    return idx;
+}
+
+static ssize_t get_cpu_usages(thermal_module_t *module, cpu_usage_t *list) {
+    int vals, cpu_num, online;
+    ssize_t read;
+    uint64_t user, nice, system, idle, active, total;
+    char *line = NULL;
+    size_t len = 0;
+    size_t size = 0;
+    char file_name[MAX_LENGTH];
+    FILE *cpu_file;
+    FILE *file = fopen(CPU_USAGE_FILE, "r");
+
+    if (file == NULL) {
+        ALOGE("%s: failed to open: %s", __func__, strerror(errno));
+        return -errno;
+    }
+
+    while ((read = getline(&line, &len, file)) != -1) {
+        // Skip non "cpu[0-9]" lines.
+        if (strnlen(line, read) < 4 || strncmp(line, "cpu", 3) != 0 || !isdigit(line[3])) {
+            free(line);
+            line = NULL;
+            len = 0;
+            continue;
+        }
+        vals = sscanf(line, "cpu%d %" SCNu64 " %" SCNu64 " %" SCNu64 " %" SCNu64, &cpu_num, &user,
+                &nice, &system, &idle);
+
+        free(line);
+        line = NULL;
+        len = 0;
+
+        if (vals != 5) {
+            ALOGE("%s: failed to read CPU information from file: %s", __func__, strerror(errno));
+            fclose(file);
+            return errno ? -errno : -EIO;
+        }
+
+        active = user + nice + system;
+        total = active + idle;
+
+        // Read online CPU information.
+        snprintf(file_name, MAX_LENGTH, CPU_ONLINE_FILE_FORMAT, cpu_num);
+        cpu_file = fopen(file_name, "r");
+        online = 0;
+        if (cpu_file == NULL) {
+            ALOGE("%s: failed to open file: %s (%s)", __func__, file_name, strerror(errno));
+            // /sys/devices/system/cpu/cpu0/online is missing on some systems, because cpu0 can't
+            // be offline.
+            online = cpu_num == 0;
+        } else if (1 != fscanf(cpu_file, "%d", &online)) {
+            ALOGE("%s: failed to read CPU online information from file: %s (%s)", __func__,
+                    file_name, strerror(errno));
+            fclose(file);
+            fclose(cpu_file);
+            return errno ? -errno : -EIO;
+        }
+        fclose(cpu_file);
+
+        if (list != NULL) {
+            list[size] = (cpu_usage_t) {
+                .name = CPU_LABEL,
+                .active = active,
+                .total = total,
+                .is_online = online
+            };
+        }
+
+        size++;
+    }
+
+    fclose(file);
+    return size;
+}
+
+static ssize_t get_cooling_devices(thermal_module_t *module, cooling_device_t *list, size_t size) {
+    return 0;
+}
+
+static struct hw_module_methods_t thermal_module_methods = {
+    .open = NULL,
+};
+
+thermal_module_t HAL_MODULE_INFO_SYM = {
+    .common = {
+        .tag = HARDWARE_MODULE_TAG,
+        .module_api_version = THERMAL_HARDWARE_MODULE_API_VERSION_0_1,
+        .hal_api_version = HARDWARE_HAL_API_VERSION,
+        .id = THERMAL_HARDWARE_MODULE_ID,
+        .name = "Default Thermal HAL",
+        .author = "The Android Open Source Project",
+        .methods = &thermal_module_methods,
+    },
+
+    .getTemperatures = get_temperatures,
+    .getCpuUsages = get_cpu_usages,
+    .getCoolingDevices = get_cooling_devices,
+};
