Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4abbaaad authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "thermal: IThermal V1.1, add methods to send thermal throttling events" into oc-mr1-dev

parents d8ffb052 8d95f2e6
Loading
Loading
Loading
Loading

thermal/1.1/Android.bp

0 → 100644
+68 −0
Original line number Diff line number Diff line
// This file is autogenerated by hidl-gen. Do not edit manually.

filegroup {
    name: "android.hardware.thermal@1.1_hal",
    srcs: [
        "IThermal.hal",
        "IThermalCallback.hal",
    ],
}

genrule {
    name: "android.hardware.thermal@1.1_genc++",
    tools: ["hidl-gen"],
    cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.thermal@1.1",
    srcs: [
        ":android.hardware.thermal@1.1_hal",
    ],
    out: [
        "android/hardware/thermal/1.1/ThermalAll.cpp",
        "android/hardware/thermal/1.1/ThermalCallbackAll.cpp",
    ],
}

genrule {
    name: "android.hardware.thermal@1.1_genc++_headers",
    tools: ["hidl-gen"],
    cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.thermal@1.1",
    srcs: [
        ":android.hardware.thermal@1.1_hal",
    ],
    out: [
        "android/hardware/thermal/1.1/IThermal.h",
        "android/hardware/thermal/1.1/IHwThermal.h",
        "android/hardware/thermal/1.1/BnHwThermal.h",
        "android/hardware/thermal/1.1/BpHwThermal.h",
        "android/hardware/thermal/1.1/BsThermal.h",
        "android/hardware/thermal/1.1/IThermalCallback.h",
        "android/hardware/thermal/1.1/IHwThermalCallback.h",
        "android/hardware/thermal/1.1/BnHwThermalCallback.h",
        "android/hardware/thermal/1.1/BpHwThermalCallback.h",
        "android/hardware/thermal/1.1/BsThermalCallback.h",
    ],
}

cc_library_shared {
    name: "android.hardware.thermal@1.1",
    defaults: ["hidl-module-defaults"],
    generated_sources: ["android.hardware.thermal@1.1_genc++"],
    generated_headers: ["android.hardware.thermal@1.1_genc++_headers"],
    export_generated_headers: ["android.hardware.thermal@1.1_genc++_headers"],
    vendor_available: true,
    shared_libs: [
        "libhidlbase",
        "libhidltransport",
        "libhwbinder",
        "liblog",
        "libutils",
        "libcutils",
        "android.hardware.thermal@1.0",
    ],
    export_shared_lib_headers: [
        "libhidlbase",
        "libhidltransport",
        "libhwbinder",
        "libutils",
        "android.hardware.thermal@1.0",
    ],
}

thermal/1.1/Android.mk

0 → 100644
+120 −0
Original line number Diff line number Diff line
# This file is autogenerated by hidl-gen. Do not edit manually.

LOCAL_PATH := $(call my-dir)

################################################################################

include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.thermal-V1.1-java
LOCAL_MODULE_CLASS := JAVA_LIBRARIES

intermediates := $(call local-generated-sources-dir, COMMON)

HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)

LOCAL_JAVA_LIBRARIES := \
    android.hardware.thermal-V1.0-java \
    android.hidl.base-V1.0-java \


#
# Build IThermal.hal
#
GEN := $(intermediates)/android/hardware/thermal/V1_1/IThermal.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IThermal.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IThermalCallback.hal
$(GEN): $(LOCAL_PATH)/IThermalCallback.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
        -Ljava \
        -randroid.hardware:hardware/interfaces \
        -randroid.hidl:system/libhidl/transport \
        android.hardware.thermal@1.1::IThermal

$(GEN): $(LOCAL_PATH)/IThermal.hal
	$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)

#
# Build IThermalCallback.hal
#
GEN := $(intermediates)/android/hardware/thermal/V1_1/IThermalCallback.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IThermalCallback.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
        -Ljava \
        -randroid.hardware:hardware/interfaces \
        -randroid.hidl:system/libhidl/transport \
        android.hardware.thermal@1.1::IThermalCallback

$(GEN): $(LOCAL_PATH)/IThermalCallback.hal
	$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_JAVA_LIBRARY)


################################################################################

include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.thermal-V1.1-java-static
LOCAL_MODULE_CLASS := JAVA_LIBRARIES

intermediates := $(call local-generated-sources-dir, COMMON)

HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)

LOCAL_STATIC_JAVA_LIBRARIES := \
    android.hardware.thermal-V1.0-java-static \
    android.hidl.base-V1.0-java-static \


#
# Build IThermal.hal
#
GEN := $(intermediates)/android/hardware/thermal/V1_1/IThermal.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IThermal.hal
$(GEN): PRIVATE_DEPS += $(LOCAL_PATH)/IThermalCallback.hal
$(GEN): $(LOCAL_PATH)/IThermalCallback.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
        -Ljava \
        -randroid.hardware:hardware/interfaces \
        -randroid.hidl:system/libhidl/transport \
        android.hardware.thermal@1.1::IThermal

$(GEN): $(LOCAL_PATH)/IThermal.hal
	$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)

#
# Build IThermalCallback.hal
#
GEN := $(intermediates)/android/hardware/thermal/V1_1/IThermalCallback.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IThermalCallback.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
        $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
        -Ljava \
        -randroid.hardware:hardware/interfaces \
        -randroid.hidl:system/libhidl/transport \
        android.hardware.thermal@1.1::IThermalCallback

$(GEN): $(LOCAL_PATH)/IThermalCallback.hal
	$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_STATIC_JAVA_LIBRARY)



include $(call all-makefiles-under,$(LOCAL_PATH))
+31 −0
Original line number Diff line number Diff line
/*
 * 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.
 */

package android.hardware.thermal@1.1;

import android.hardware.thermal@1.0::IThermal;
import IThermalCallback;

interface IThermal extends @1.0::IThermal {
   /**
    * Register an IThermalCallback, used by the Thermal HAL
    * to send thermal events to the framework thermal service.
    *
    * @param callback the IThermalCallback to use for sending
    *        thermal events, or nullptr to set no callback
    */
    registerThermalCallback(IThermalCallback callback);
};
+33 −0
Original line number Diff line number Diff line
/*
 * 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.
 */

package android.hardware.thermal@1.1;

import android.hardware.thermal@1.0::Temperature;

/**
 * IThermalCallback connects vendor code to the framework binder ThermalService.
 */
interface IThermalCallback {
    /**
     * Send a thermal throttling start/stop event to all ThermalService
     * thermal event listeners.
     * @param isThrottling true if device is currently throttling
     * @param temperature The temperature associated with the throttling
     *        start/stop event
     */
    oneway notifyThrottling(bool isThrottling, Temperature temperature);
};
+35 −0
Original line number Diff line number Diff line
//
// 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.
//

cc_test {
    name: "VtsHalThermalV1_1TargetTest",
    defaults: ["hidl_defaults"],
    srcs: ["VtsHalThermalV1_1TargetTest.cpp"],
    shared_libs: [
        "liblog",
        "libhidlbase",
        "libhidltransport",
        "libutils",
        "android.hardware.thermal@1.0",
        "android.hardware.thermal@1.1",
    ],
    static_libs: ["VtsHalHidlTargetTestBase"],
    cflags: [
        "-O0",
        "-g",
    ],
}
Loading