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

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

Merge "Add thermal service into system_server"

parents 059810b7 bad7c206
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -706,6 +706,8 @@ java_defaults {
        "android.hardware.contexthub-V1.0-java",
        "android.hardware.health-V1.0-java-constants",
        "android.hardware.thermal-V1.0-java-constants",
        "android.hardware.thermal-V1.1-java",
        "android.hardware.thermal-V2.0-java",
        "android.hardware.tv.input-V1.0-java-constants",
        "android.hardware.usb-V1.0-java-constants",
        "android.hardware.usb-V1.1-java-constants",
+9 −0
Original line number Diff line number Diff line
@@ -4225,6 +4225,15 @@ public abstract class Context {
     */
    public static final String HARDWARE_PROPERTIES_SERVICE = "hardware_properties";

    /**
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.os.ThermalService} for accessing the thermal service.
     *
     * @see #getSystemService(String)
     * @hide
     */
    public static final String THERMAL_SERVICE = "thermalservice";

    /**
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.content.pm.ShortcutManager} for accessing the launcher shortcut service.
+1 −2
Original line number Diff line number Diff line
@@ -27,6 +27,5 @@ oneway interface IThermalEventListener {
     * Called when a thermal throttling start/stop event is received.
     * @param temperature the temperature at which the event was generated.
     */
    void notifyThrottling(
        in boolean isThrottling, in Temperature temperature);
    void notifyThrottling(in Temperature temperature);
}
+16 −7
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package android.os;
import android.os.IThermalEventListener;
import android.os.Temperature;

import java.util.List;

/**
 * {@hide}
 */
@@ -29,6 +31,13 @@ interface IThermalService {
      * {@hide}
      */
    void registerThermalEventListener(in IThermalEventListener listener);
    /**
      * Register a listener for thermal events on given temperature type.
      * @param listener the IThermalEventListener to be notified.
      * @param type the temperature type IThermalEventListener to be notified.
      * {@hide}
      */
    void registerThermalEventListenerWithType(in IThermalEventListener listener, in int type);
    /**
      * Unregister a previously-registered listener for thermal events.
      * @param listener the IThermalEventListener to no longer be notified.
@@ -36,16 +45,16 @@ interface IThermalService {
      */
    void unregisterThermalEventListener(in IThermalEventListener listener);
    /**
      * Send a thermal throttling start/stop notification to all listeners.
      * @param temperature the temperature at which the event was generated.
      * Get current temperature with its throttling status.
      * @return list of android.os.Temperature
      * {@hide}
      */
    oneway void notifyThrottling(
        in boolean isThrottling, in Temperature temperature);
    List<Temperature> getCurrentTemperatures();
    /**
      * Return whether system performance is currently thermal throttling.
      * @return true if thermal throttling is currently in effect
      * Get current temperature with its throttling status on given temperature type.
      * @param type the temperature type to query.
      * @return list of android.os.Temperature
      * {@hide}
      */
    boolean isThrottling();
    List<Temperature> getCurrentTemperaturesWithType(in int type);
}
+7 −0
Original line number Diff line number Diff line
@@ -476,6 +476,13 @@ public final class PowerManager {
     */
    public static final String SHUTDOWN_BATTERY_THERMAL_STATE = "thermal,battery";

    /**
     * The value to pass as the 'reason' argument to android_reboot() when device temperature
     * is too high.
     * @hide
     */
    public static final String SHUTDOWN_THERMAL_STATE = "thermal";

    /**
     * The value to pass as the 'reason' argument to android_reboot() when device is running
     * critically low on battery.
Loading