Merge "Nullability check for system_properties module." am: 83f9b28792

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2593054

Change-Id: I7da1dec1bcb6b83c9c2629118a38387f91ee6ef0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-05-18 20:05:22 +00:00 committed by Automerger Merge Worker
commit 4eccad6838
2 changed files with 15 additions and 15 deletions

View file

@ -61,7 +61,7 @@ __BEGIN_DECLS
** This was previously for testing, but now that SystemProperties is its own testable class,
** there is never a reason to call this function and its implementation simply returns -1.
*/
int __system_property_set_filename(const char* __filename);
int __system_property_set_filename(const char* __unused __filename);
/*
** Initialize the area to be used to store properties. Can
@ -102,7 +102,7 @@ uint32_t __system_property_area_serial(void);
**
** Returns 0 on success, -1 if the property area is full.
*/
int __system_property_add(const char* __name, unsigned int __name_length, const char* __value, unsigned int __value_length);
int __system_property_add(const char* _Nonnull __name, unsigned int __name_length, const char* _Nonnull __value, unsigned int __value_length);
/* Update the value of a system property returned by
** __system_property_find. Can only be done by a single process
@ -112,14 +112,14 @@ int __system_property_add(const char* __name, unsigned int __name_length, const
**
** Returns 0 on success, -1 if the parameters are incorrect.
*/
int __system_property_update(prop_info* __pi, const char* __value, unsigned int __value_length);
int __system_property_update(prop_info* _Nonnull __pi, const char* _Nonnull __value, unsigned int __value_length);
/* Read the serial number of a system property returned by
** __system_property_find.
**
** Returns the serial number on success, -1 on error.
*/
uint32_t __system_property_serial(const prop_info* __pi);
uint32_t __system_property_serial(const prop_info* _Nonnull __pi);
/* Initialize the system properties area in read only mode.
* Should be done by all processes that need to read system

View file

@ -43,7 +43,7 @@ typedef struct prop_info prop_info;
/*
* Sets system property `name` to `value`, creating the system property if it doesn't already exist.
*/
int __system_property_set(const char* __name, const char* __value);
int __system_property_set(const char* _Nonnull __name, const char* _Nonnull __value);
/*
* Returns a `prop_info` corresponding system property `name`, or nullptr if it doesn't exist.
@ -51,14 +51,14 @@ int __system_property_set(const char* __name, const char* __value);
*
* Property lookup is expensive, so it can be useful to cache the result of this function.
*/
const prop_info* __system_property_find(const char* __name);
const prop_info* _Nullable __system_property_find(const char* _Nonnull __name);
/*
* Calls `callback` with a consistent trio of name, value, and serial number for property `pi`.
*/
void __system_property_read_callback(const prop_info* __pi,
void (*__callback)(void* __cookie, const char* __name, const char* __value, uint32_t __serial),
void* __cookie) __INTRODUCED_IN(26);
void __system_property_read_callback(const prop_info* _Nonnull __pi,
void (* _Nonnull __callback)(void* _Nullable __cookie, const char* _Nonnull __name, const char* _Nonnull __value, uint32_t __serial),
void* _Nullable __cookie) __INTRODUCED_IN(26);
/*
* Passes a `prop_info` for each system property to the provided
@ -66,13 +66,13 @@ void __system_property_read_callback(const prop_info* __pi,
*
* This method is for inspecting and debugging the property system, and not generally useful.
*/
int __system_property_foreach(void (*__callback)(const prop_info* __pi, void* __cookie), void* __cookie)
int __system_property_foreach(void (* _Nonnull __callback)(const prop_info* _Nonnull __pi, void* _Nullable __cookie), void* _Nullable __cookie)
__INTRODUCED_IN(19);
/*
* Waits for the specific system property identified by `pi` to be updated
* past `old_serial`. Waits no longer than `relative_timeout`, or forever
* if `relaive_timeout` is null.
* if `relative_timeout` is null.
*
* If `pi` is null, waits for the global serial number instead.
*
@ -82,17 +82,17 @@ int __system_property_foreach(void (*__callback)(const prop_info* __pi, void* __
* timed out.
*/
struct timespec;
bool __system_property_wait(const prop_info* __pi, uint32_t __old_serial, uint32_t* __new_serial_ptr, const struct timespec* __relative_timeout)
bool __system_property_wait(const prop_info* _Nullable __pi, uint32_t __old_serial, uint32_t* _Nonnull __new_serial_ptr, const struct timespec* _Nullable __relative_timeout)
__INTRODUCED_IN(26);
/* Deprecated. In Android O and above, there's no limit on property name length. */
#define PROP_NAME_MAX 32
/* Deprecated. Use __system_property_read_callback instead. */
int __system_property_read(const prop_info* __pi, char* __name, char* __value);
int __system_property_read(const prop_info* _Nonnull __pi, char* _Nullable __name, char* _Nonnull __value);
/* Deprecated. Use __system_property_read_callback instead. */
int __system_property_get(const char* __name, char* __value);
int __system_property_get(const char* _Nonnull __name, char* _Nonnull __value);
/* Deprecated. Use __system_property_foreach instead. */
const prop_info* __system_property_find_nth(unsigned __n);
const prop_info* _Nullable __system_property_find_nth(unsigned __n);
__END_DECLS