diff options
author | 2024-01-09 13:24:41 -0800 | |
---|---|---|
committer | 2024-01-11 00:42:40 +0000 | |
commit | 800af348c11767bfc4e35e26f8a6bcd51bcc6497 (patch) | |
tree | 5456ced8fb445d5fb5186af89cae8ca989a26cbe | |
parent | 365716398f5955558ce7185ede55d923b7ed9781 (diff) |
Add nullability type qualifiers for thermal NDK APIs
Bug: 319285135
Test: m
Change-Id: I5bf5b92b2844e7b9a5702b3ed48111d42e4ecce8
-rw-r--r-- | include/android/thermal.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/include/android/thermal.h b/include/android/thermal.h index 0b57e9376d..fa168cdecb 100644 --- a/include/android/thermal.h +++ b/include/android/thermal.h @@ -111,7 +111,7 @@ typedef struct AThermalManager AThermalManager; * It's passed the updated thermal status as parameter, as well as the * pointer provided by the client that registered a callback. */ -typedef void (*AThermal_StatusCallback)(void* data, AThermalStatus status); +typedef void (*AThermal_StatusCallback)(void* _Nullable data, AThermalStatus status); /** * Acquire an instance of the thermal manager. This must be freed using @@ -121,7 +121,7 @@ typedef void (*AThermal_StatusCallback)(void* data, AThermalStatus status); * * @return manager instance on success, nullptr on failure. */ -AThermalManager* AThermal_acquireManager() __INTRODUCED_IN(30); +AThermalManager* _Nonnull AThermal_acquireManager() __INTRODUCED_IN(30); /** * Release the thermal manager pointer acquired via @@ -131,7 +131,7 @@ AThermalManager* AThermal_acquireManager() __INTRODUCED_IN(30); * * @param manager The manager to be released. */ -void AThermal_releaseManager(AThermalManager *manager) __INTRODUCED_IN(30); +void AThermal_releaseManager(AThermalManager* _Nonnull manager) __INTRODUCED_IN(30); /** * Gets the current thermal status. @@ -143,7 +143,8 @@ void AThermal_releaseManager(AThermalManager *manager) __INTRODUCED_IN(30); * * @return current thermal status, ATHERMAL_STATUS_ERROR on failure. */ -AThermalStatus AThermal_getCurrentThermalStatus(AThermalManager *manager) __INTRODUCED_IN(30); +AThermalStatus +AThermal_getCurrentThermalStatus(AThermalManager* _Nonnull manager) __INTRODUCED_IN(30); /** * Register the thermal status listener for thermal status change. @@ -160,8 +161,9 @@ AThermalStatus AThermal_getCurrentThermalStatus(AThermalManager *manager) __INTR * EPERM if the required permission is not held. * EPIPE if communication with the system service has failed. */ -int AThermal_registerThermalStatusListener(AThermalManager *manager, - AThermal_StatusCallback callback, void *data) __INTRODUCED_IN(30); +int AThermal_registerThermalStatusListener(AThermalManager* _Nonnull manager, + AThermal_StatusCallback _Nullable callback, + void* _Nullable data) __INTRODUCED_IN(30); /** * Unregister the thermal status listener previously resgistered. @@ -178,8 +180,9 @@ int AThermal_registerThermalStatusListener(AThermalManager *manager, * EPERM if the required permission is not held. * EPIPE if communication with the system service has failed. */ -int AThermal_unregisterThermalStatusListener(AThermalManager *manager, - AThermal_StatusCallback callback, void *data) __INTRODUCED_IN(30); +int AThermal_unregisterThermalStatusListener(AThermalManager* _Nonnull manager, + AThermal_StatusCallback _Nullable callback, + void* _Nullable data) __INTRODUCED_IN(30); /** * Provides an estimate of how much thermal headroom the device currently has before @@ -219,8 +222,8 @@ int AThermal_unregisterThermalStatusListener(AThermalManager *manager, * as described above. Returns NaN if the device does not support this functionality or * if this function is called significantly faster than once per second. */ -float AThermal_getThermalHeadroom(AThermalManager *manager, - int forecastSeconds) __INTRODUCED_IN(31); +float AThermal_getThermalHeadroom(AThermalManager* _Nonnull manager, + int forecastSeconds) __INTRODUCED_IN(31); /** * This struct defines an instance of headroom threshold value and its status. @@ -282,9 +285,10 @@ struct AThermalHeadroomThreshold { * EPIPE if communication with the system service has failed. * ENOSYS if the feature is disabled by the current system. */ -int AThermal_getThermalHeadroomThresholds(AThermalManager* manager, - const AThermalHeadroomThreshold ** outThresholds, - size_t* size) __INTRODUCED_IN(35); +int AThermal_getThermalHeadroomThresholds(AThermalManager* _Nonnull manager, + const AThermalHeadroomThreshold* _Nonnull + * _Nullable outThresholds, + size_t* _Nonnull size) __INTRODUCED_IN(35); #ifdef __cplusplus } |