diff --git a/Android.bp b/Android.bp index 6efaac11..9f2d303a 100644 --- a/Android.bp +++ b/Android.bp @@ -1,4 +1,5 @@ subdirs = [ + "thermal", "vr", "vibrator", "wifi_offload", diff --git a/device.mk b/device.mk index ec6c06c9..31727c3d 100755 --- a/device.mk +++ b/device.mk @@ -353,7 +353,7 @@ PRODUCT_PACKAGES += \ # Thermal packages PRODUCT_PACKAGES += \ - android.hardware.thermal@1.0-service.wahoo + android.hardware.thermal@1.0-impl-wahoo #GNSS HAL PRODUCT_PACKAGES += \ @@ -432,10 +432,6 @@ PRODUCT_COPY_FILES += \ # PRODUCT_COPY_FILES += \ # frameworks/native/data/etc/android.hardware.audio.pro.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.pro.xml -# Thermal packages -PRODUCT_PACKAGES += \ - thermal.default - ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) PRODUCT_PACKAGES += \ tinyplay \ diff --git a/thermal/Android.bp b/thermal/Android.bp new file mode 100644 index 00000000..fae9616d --- /dev/null +++ b/thermal/Android.bp @@ -0,0 +1,19 @@ +cc_library_shared { + name: "android.hardware.thermal@1.0-wahoo", + defaults: ["hidl_defaults"], + owner: "qcom", + vendor: true, + relative_install_path: "hw", + srcs: [ + "Thermal.cpp", + "thermal-helper.cpp", + ], + export_include_dirs: ["."], + shared_libs: [ + "libbase", + "libhidlbase", + "libhidltransport", + "libutils", + "android.hardware.thermal@1.0", + ], +} diff --git a/thermal/Android.mk b/thermal/Android.mk deleted file mode 100644 index a725c83e..00000000 --- a/thermal/Android.mk +++ /dev/null @@ -1,37 +0,0 @@ -# -# Copyright 2017 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. -# - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_PROPRIETARY_MODULE := true -LOCAL_MODULE_OWNER := qcom -LOCAL_MODULE_TAGS := optional - -LOCAL_MODULE := android.hardware.thermal@1.0-service.wahoo -LOCAL_INIT_RC := android.hardware.thermal@1.0-service.wahoo.rc -LOCAL_SRC_FILES := service.cpp Thermal.cpp thermal-helper.cpp - -LOCAL_SHARED_LIBRARIES := \ - libhidlbase \ - libhidltransport \ - libutils \ - libbase \ - android.hardware.thermal@1.0 \ - -include $(BUILD_EXECUTABLE) diff --git a/thermal/android.hardware.thermal@1.0-service.wahoo.rc b/thermal/android.hardware.thermal@1.0-service.wahoo.rc deleted file mode 100644 index e522cb10..00000000 --- a/thermal/android.hardware.thermal@1.0-service.wahoo.rc +++ /dev/null @@ -1,4 +0,0 @@ -service thermal-hal-1-0 /vendor/bin/hw/android.hardware.thermal@1.0-service.wahoo - class hal - user nobody - group nobody diff --git a/thermal/service.cpp b/thermal/service.cpp deleted file mode 100644 index d41953b6..00000000 --- a/thermal/service.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2017 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 -#include -#include "Thermal.h" - -using android::sp; -using android::status_t; -using android::OK; - -// libhwbinder: -using android::hardware::configureRpcThreadpool; -using android::hardware::joinRpcThreadpool; - -// Generated HIDL files -using android::hardware::thermal::V1_0::IThermal; -using android::hardware::thermal::V1_0::implementation::Thermal; - -int main() { - - status_t status; - android::sp service = nullptr; - - LOG(INFO) << "Thermal HAL Service 1.0 is starting"; - - service = new Thermal(); - if (service == nullptr) { - LOG(ERROR) << "Can not create an instance of Thermal HAL Iface, exiting"; - - goto shutdown; - } - - configureRpcThreadpool(1, true /*callerWillJoin*/); - - status = service->registerAsService(); - if (status != OK) { - LOG(ERROR) << "Could not register service for Thermal HAL Iface (" << status << ")"; - goto shutdown; - } - - LOG(INFO) << "Thermal Service is ready"; - joinRpcThreadpool(); - // Should not pass this line - -shutdown: - // In normal operation, we don't expect the thread pool to exit - LOG(ERROR) << "Thermal Service is shutting down"; - return 1; -}