Use libsystemproperties in resetprop

Upstream to latest Android Pie
This commit is contained in:
topjohnwu
2018-09-06 01:33:17 -04:00
parent ad7ec79903
commit 7a0025673c
41 changed files with 3404 additions and 2216 deletions

View File

@@ -36,6 +36,7 @@
#error you should #include <sys/system_properties.h> instead
#endif
//#include <sys/system_properties.h>
#include "system_properties.h"
__BEGIN_DECLS
@@ -58,17 +59,17 @@ __BEGIN_DECLS
#define PROP_ERROR_SET_FAILED 0x0024
/*
** Map the property area from the specified filename. This
** method is for testing only.
** 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* __filename);
/*
** Initialize the area to be used to store properties. Can
** only be done by a single process that has write access to
** the property area.
*/
int __system_property_area_init();
int __system_property_area_init(void);
/* Read the global serial number of the system properties
**
@@ -92,7 +93,7 @@ int __system_property_area_init();
**
** Returns the serial number on success, -1 on error.
*/
uint32_t __system_property_area_serial();
uint32_t __system_property_area_serial(void);
/* Add a new system property. Can only be done by a single
** process that has write access to the property area, and
@@ -102,13 +103,7 @@ uint32_t __system_property_area_serial();
**
** Returns 0 on success, -1 if the property area is full.
*/
int __system_property_add(const char *name, unsigned int namelen, const char *value, unsigned int valuelen);
/* Delete a new system property. Added in resetprop
**
** Returns 0 on success, -1 if the property area is full.
*/
int __system_property_del(const char *name);
int __system_property_add(const char* __name, unsigned int __name_length, const char* __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
@@ -118,14 +113,14 @@ int __system_property_del(const char *name);
**
** Returns 0 on success, -1 if the parameters are incorrect.
*/
int __system_property_update(prop_info *pi, const char *value, unsigned int len);
int __system_property_update(prop_info* __pi, const char* __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* __pi);
/* Initialize the system properties area in read only mode.
* Should be done by all processes that need to read system
@@ -133,10 +128,10 @@ uint32_t __system_property_serial(const prop_info* pi);
*
* Returns 0 on success, -1 otherwise.
*/
int __system_properties_init();
int __system_properties_init(void);
/* Deprecated: use __system_property_wait instead. */
uint32_t __system_property_wait_any(uint32_t old_serial);
uint32_t __system_property_wait_any(uint32_t __old_serial);
__END_DECLS