Loading Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -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", Loading core/java/android/content/Context.java +9 −0 Original line number Diff line number Diff line Loading @@ -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. Loading core/java/android/os/IThermalEventListener.aidl +1 −2 Original line number Diff line number Diff line Loading @@ -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); } core/java/android/os/IThermalService.aidl +16 −7 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package android.os; import android.os.IThermalEventListener; import android.os.Temperature; import java.util.List; /** * {@hide} */ Loading @@ -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. Loading @@ -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); } core/java/android/os/PowerManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -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", Loading
core/java/android/content/Context.java +9 −0 Original line number Diff line number Diff line Loading @@ -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. Loading
core/java/android/os/IThermalEventListener.aidl +1 −2 Original line number Diff line number Diff line Loading @@ -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); }
core/java/android/os/IThermalService.aidl +16 −7 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ package android.os; import android.os.IThermalEventListener; import android.os.Temperature; import java.util.List; /** * {@hide} */ Loading @@ -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. Loading @@ -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); }
core/java/android/os/PowerManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -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