ThermalGuard is an OutSystems 11 mobile plugin that provides access to the device's native thermal status information on Android devices.
The component uses the Android PowerManager API to retrieve the current thermal status reported by the operating system. It allows OutSystems applications to check thermal API availability and identify the device's current thermal condition through a readable status name and its corresponding numeric code.
PowerManager
ThermalGuard provides a simple interface through OutSystems Client Actions, allowing developers to integrate device thermal-status information into their mobile applications without writing custom native Android code.
Important: ThermalGuard reports the thermal status provided by the Android operating system. It does not measure the device's actual temperature in degrees Celsius.
Check whether the Android thermal status API is supported on the device.
Retrieve the current device thermal status.
Obtain both the readable thermal status name and its numeric code.
Identify different thermal conditions, from normal operation to critical thermal states.
Provide simple OutSystems Client Actions for accessing native Android functionality.
Return success indicators and descriptive error messages.
No additional runtime permissions are required.
Checks whether the device supports the Android thermal status API.
Outputs:
IsAvailable – Indicates whether the thermal status API is supported on the device.
IsAvailable
ErrorMessage – Provides error information when the API is unavailable or the availability check fails.
ErrorMessage
The Android thermal status API requires Android 10 (API level 29) or later.
Retrieves the current thermal status reported by the Android operating system using the native PowerManager API.
ThermalState – Readable name of the current thermal status.
ThermalState
ThermalStateCode – Numeric code representing the current thermal status.
ThermalStateCode
IsSuccess – Indicates whether the thermal status was retrieved successfully.
IsSuccess
ErrorMessage – Provides error information when the thermal status cannot be retrieved.
ThermalGuard supports the standard Android thermal status values:
These values are retrieved from the Android operating system and are not calculated by the component.
A typical implementation can follow this flow:
Call CheckThermalStateAvailability to verify whether the device supports the thermal status API.
CheckThermalStateAvailability
Check the IsAvailable output.
If available, call GetCurrentThermalState.
GetCurrentThermalState
Read ThermalState and ThermalStateCode.
Use the returned status to determine appropriate application behavior.
Example:
Availability Check
IsAvailable = True
Current Thermal Status
ThermalState = NONE
ThermalStateCode = 0
IsSuccess = True
ThermalGuard can help developers build applications that respond to the device's thermal condition.
Examples include:
Adaptive Workloads: Reduce resource-intensive processing when the operating system reports elevated thermal status.
Mobile Performance Optimization: Adapt application behavior based on the current thermal condition.
Background Processing: Adjust the intensity of background operations when thermal stress is reported.
Media Applications: Consider adapting resource-intensive media processing based on device thermal status.
Device Diagnostics: Display the current thermal condition as part of a device diagnostics interface.
Monitoring Dashboards: Present thermal status information within mobile monitoring applications.
The consuming application is responsible for implementing any workload adjustments or business logic based on the returned status.
OutSystems 11.
Mobile / Phone applications.
Android 10 (API level 29) or later.
Cordova-based mobile application.
Platform Support: Android only.
Devices running Android versions earlier than Android 10 are not supported because the required native thermal status API is unavailable.
ThermalGuard uses the native Android PowerManager API:
PowerManager.getCurrentThermalStatus()
The component implements a lightweight Cordova bridge that exposes this native functionality through JavaScript and makes it accessible to OutSystems Client Actions.
No external thermal-sensor library or third-party native SDK is required.
ThermalGuard retrieves the thermal status reported by the Android operating system; it does not return an actual temperature measurement in Celsius.
IsAvailable = True indicates that the required Android API is supported, not that the device is currently experiencing thermal stress.
Thermal status values depend on the device, Android implementation, and current operating conditions.
The component retrieves the current status when GetCurrentThermalState is called. It does not provide continuous thermal-state monitoring or listener events in this version.
Applications should handle unsupported Android versions and API errors gracefully.
The component exposes the native thermal status; application-specific workload management and response logic should be implemented by the consuming application.
A dedicated demo application, ThermalGuard, is provided to demonstrate the plugin's functionality.
The demo allows developers to:
Check thermal status API availability.
View the readable thermal state.
View the corresponding numeric status code.
Observe successful responses and error information.
ThermalGuard is distributed under the MIT License.