diff --git a/Packages/MobileSupportThermal/CHANGELOG.md b/Packages/MobileSupportThermal/CHANGELOG.md index 1ea3241..3ea1f48 100644 --- a/Packages/MobileSupportThermal/CHANGELOG.md +++ b/Packages/MobileSupportThermal/CHANGELOG.md @@ -1,5 +1,10 @@ # Release notes +## v1.0.0 - 2024/06/26 + +- New Features :rocket: + - Thermal: New apis to get battery temperature and thermal headroom on Android + ## v0.1.0 - 2023/02/10 - New Features :rocket: diff --git a/Packages/MobileSupportThermal/README.md b/Packages/MobileSupportThermal/README.md index a743504..6bf0d0c 100644 --- a/Packages/MobileSupportThermal/README.md +++ b/Packages/MobileSupportThermal/README.md @@ -30,6 +30,12 @@ Below is an example. ```C# private void StartThermalMonitoring() { + +#if UNITY_ANDROID + // OnBatteryTemperatureChanged is only available on Android + Thermal.OnBatteryTemperatureChanged += value => Debug.Log($"Battery Temperature: {value}"); +#endif + #if UNITY_ANDROID || UNITY_IOS Thermal.OnThermalStatusChanged += status => Debug.Log($"Thermal Status: {status}"); Thermal.StartMonitoring(); @@ -39,6 +45,18 @@ Below is an example. If you want to stop monitoring, call `Thermal.StopStopMonitoring()` +### Thermal Headroom (Android) + +On Android, `Thermal.GetThermalHeadroom()` is available to estimate CPU temperature. +Details: https://developer.android.com/reference/android/os/PowerManager#getThermalHeadroom(int) + +```C# + private void GetThermalHeadroom() + { + Thermal.GetThermalHeadroom(0, out var headroom, out var resultForecastSeconds, out var isLatestValue); + } +``` + ## Setup ### Requirements diff --git a/Packages/MobileSupportThermal/package.json b/Packages/MobileSupportThermal/package.json index 78f371a..9941cba 100644 --- a/Packages/MobileSupportThermal/package.json +++ b/Packages/MobileSupportThermal/package.json @@ -1,7 +1,7 @@ { "name": "jp.co.cyberagent.unity-mobile-support-thermal", "displayName": "Mobile Support - Thermal", - "version": "0.1.0", + "version": "1.0.0", "unity": "2019.4", "description": "Tools to support thermal of mobile like iOS/Android.", "keywords": [ diff --git a/README.md b/README.md index 8ab2343..522e0b2 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,6 @@ Scripts ars split into multiple packages, so choose packages what you only need. | Package | Description | Latest Version | Readme Link | Changelog Link | |-------------|------------------------------------------------------|----------------|----------------------------------------------------------|----------------------------------------------------------------| | Storage | Functions to retrive information about storage | v0.2.0 | [README.md](Packages/MobileSupportStorage/README.md) | [CHANGELOG.md](Packages/MobileSupportStorage/CHANGELOG.md) | -| Thermal | Functions to retrive information about thermal | v0.1.0 | [README.md](Packages/MobileSupportThermal/README.md) | [CHANGELOG.md](Packages/MobileSupportThermal/CHANGELOG.md) | +| Thermal | Functions to retrive information about thermal | v1.0.0 | [README.md](Packages/MobileSupportThermal/README.md) | [CHANGELOG.md](Packages/MobileSupportThermal/CHANGELOG.md) | | AndroidGame | Functions to integrate with Android GameManager APIs | v1.1.0 | [README.md](Packages/MobileSupportAndroidGame/README.md) | [CHANGELOG.md](Packages/MobileSupportAndroidGame/CHANGELOG.md) | | QualityTuner | Package to get hardware specs and tool to decide quality level | v1.0.0 | [README.md](Packages/MobileSupportQualityTuner/README.md) | [CHANGELOG.md](Packages/MobileSupportQualityTuner/CHANGELOG.md) |