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

Commit 48dbcaae authored by Chris Ye's avatar Chris Ye
Browse files

Add native Thermal Throttling API to libandroid.

Add native thermal manager API of thermal mananger service into
libandroid. Export Thermal API as NDK library.

Bug: 137151587
Bug: 136285293
Test: build, atest thermalmanager-test atest CtsThermalTestCases

Change-Id: Ia49fb2133624ffcd6168af804ae612ef2bb190f2
parent 205a16ab
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -453,6 +453,18 @@ filegroup {
    path: "core/java",
}

filegroup {
    name: "libpowermanager_aidl",
    srcs: [
        "core/java/android/os/Temperature.aidl",
        "core/java/android/os/CoolingDevice.aidl",
        "core/java/android/os/IThermalEventListener.aidl",
        "core/java/android/os/IThermalStatusListener.aidl",
        "core/java/android/os/IThermalService.aidl",
    ],
    path: "core/java",
}

java_library {
    name: "framework-minus-apex",
    defaults: ["framework-defaults"],
+1 −1
Original line number Diff line number Diff line
@@ -16,4 +16,4 @@

package android.os;

parcelable CoolingDevice;
parcelable CoolingDevice cpp_header "android/CoolingDevice.h";
+5 −4
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ interface IThermalService {
      * @return list of {@link android.os.Temperature}.
      * {@hide}
      */
    List<Temperature> getCurrentTemperatures();
    Temperature[] getCurrentTemperatures();

    /**
      * Get current temperature with its throttling status on given temperature type.
@@ -64,7 +64,7 @@ interface IThermalService {
      * @return list of {@link android.os.Temperature}.
      * {@hide}
      */
    List<Temperature> getCurrentTemperaturesWithType(in int type);
    Temperature[] getCurrentTemperaturesWithType(in int type);

    /**
      * Register a listener for thermal status change.
@@ -94,7 +94,7 @@ interface IThermalService {
      * @return list of {@link android.os.CoolingDevice}.
      * {@hide}
      */
    List<CoolingDevice> getCurrentCoolingDevices();
    CoolingDevice[] getCurrentCoolingDevices();

    /**
      * Get current cooling devices on given type.
@@ -102,7 +102,8 @@ interface IThermalService {
      * @return list of {@link android.os.CoolingDevice}.
      * {@hide}
      */
    List<CoolingDevice> getCurrentCoolingDevicesWithType(in int type);

    CoolingDevice[] getCurrentCoolingDevicesWithType(in int type);

    /**
     * @param forecastSeconds how many seconds ahead to forecast the provided headroom
+1 −1
Original line number Diff line number Diff line
@@ -16,4 +16,4 @@

package android.os;

parcelable Temperature;
parcelable Temperature cpp_header "android/Temperature.h";
+2 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ cc_library_shared {
        "surface_control.cpp",
        "system_fonts.cpp",
        "trace.cpp",
        "thermal.cpp"
    ],

    shared_libs: [
@@ -72,6 +73,7 @@ cc_library_shared {
        "libxml2",
        "libEGL",
        "libGLESv2",
        "libpowermanager",
        "android.hardware.configstore@1.0",
        "android.hardware.configstore-utils",
    ],
Loading