mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-03 07:11:53 +00:00
Use libsystemproperties in resetprop
Upstream to latest Android Pie
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "redefs.h"
|
||||
|
||||
__BEGIN_DECLS
|
||||
@@ -43,9 +42,9 @@ typedef struct prop_info prop_info;
|
||||
#define PROP_VALUE_MAX 92
|
||||
|
||||
/*
|
||||
* Sets system property `key` to `value`, creating the system property if it doesn't already exist.
|
||||
* Sets system property `name` to `value`, creating the system property if it doesn't already exist.
|
||||
*/
|
||||
int __system_property_set(const char *key, const char *value);
|
||||
int __system_property_set(const char* __name, const char* __value) __INTRODUCED_IN(12);
|
||||
|
||||
/*
|
||||
* Returns a `prop_info` corresponding system property `name`, or nullptr if it doesn't exist.
|
||||
@@ -53,14 +52,14 @@ int __system_property_set(const char *key, 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* __system_property_find(const char* __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);
|
||||
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);
|
||||
|
||||
/*
|
||||
* Passes a `prop_info` for each system property to the provided
|
||||
@@ -68,7 +67,8 @@ 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 (*propfn)(const prop_info *pi, void *cookie), void *cookie);
|
||||
int __system_property_foreach(void (*__callback)(const prop_info* __pi, void* __cookie), void* __cookie)
|
||||
__INTRODUCED_IN(19);
|
||||
|
||||
/*
|
||||
* Waits for the specific system property identified by `pi` to be updated
|
||||
@@ -83,19 +83,17 @@ int __system_property_foreach(void (*propfn)(const prop_info *pi, void *cookie),
|
||||
* 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* __pi, uint32_t __old_serial, uint32_t* __new_serial_ptr, const struct timespec* __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* __pi, char* __name, char* __value);
|
||||
/* Deprecated. Use __system_property_read_callback instead. */
|
||||
int __system_property_get(const char* name, char* value);
|
||||
int __system_property_get(const char* __name, char* __value);
|
||||
/* Deprecated. Use __system_property_foreach instead. */
|
||||
const prop_info* __system_property_find_nth(unsigned n);
|
||||
const prop_info* __system_property_find_nth(unsigned __n);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user