Remove backwards compatibility for old system properties.
No-one is directly upgrading from pre-K to O...
Also move more implementation details out of the header file.
Bug: http://b/33926793
Test: boots
Change-Id: I7a0936acbb1cea8a3b2cd6797ec53ba7e4a050f3
diff --git a/libc/include/sys/_system_properties.h b/libc/include/sys/_system_properties.h
index 080280e..ffa6d2e 100644
--- a/libc/include/sys/_system_properties.h
+++ b/libc/include/sys/_system_properties.h
@@ -33,31 +33,14 @@
#ifndef _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#error you should #include <sys/system_properties.h> instead
-#else
+#endif
+
#include <sys/system_properties.h>
-typedef struct prop_msg prop_msg;
-
-#define PROP_AREA_MAGIC 0x504f5250
-#define PROP_AREA_VERSION 0xfc6ed0ab
-#define PROP_AREA_VERSION_COMPAT 0x45434f76
-
-#define PROP_SERVICE_NAME "property_service"
-#define PROP_FILENAME_MAX 1024
-#define PROP_FILENAME "/dev/__properties__"
-
-#define PA_SIZE (128 * 1024)
-
-#define SERIAL_DIRTY(serial) ((serial) & 1)
-
__BEGIN_DECLS
-struct prop_msg
-{
- unsigned cmd;
- char name[PROP_NAME_MAX];
- char value[PROP_VALUE_MAX];
-};
+#define PROP_SERVICE_NAME "property_service"
+#define PROP_FILENAME "/dev/__properties__"
#define PROP_MSG_SETPROP 1
#define PROP_MSG_SETPROP2 0x00020001
@@ -74,34 +57,6 @@
#define PROP_ERROR_SET_FAILED 0x0024
/*
-** Rules:
-**
-** - there is only one writer, but many readers
-** - prop_area.count will never decrease in value
-** - once allocated, a prop_info's name will not change
-** - once allocated, a prop_info's offset will not change
-** - reading a value requires the following steps
-** 1. serial = pi->serial
-** 2. if SERIAL_DIRTY(serial), wait*, then goto 1
-** 3. memcpy(local, pi->value, SERIAL_VALUE_LEN(serial) + 1)
-** 4. if pi->serial != serial, goto 2
-**
-** - writing a value requires the following steps
-** 1. pi->serial = pi->serial | 1
-** 2. memcpy(pi->value, local_value, value_len)
-** 3. pi->serial = (value_len << 24) | ((pi->serial + 1) & 0xffffff)
-*/
-
-#define PROP_PATH_RAMDISK_DEFAULT "/default.prop"
-#define PROP_PATH_VENDOR_DEFAULT "/vendor/default.prop"
-#define PROP_PATH_ODM_DEFAULT "/odm/default.prop"
-#define PROP_PATH_SYSTEM_BUILD "/system/build.prop"
-#define PROP_PATH_VENDOR_BUILD "/vendor/build.prop"
-#define PROP_PATH_ODM_BUILD "/odm/build.prop"
-#define PROP_PATH_LOCAL_OVERRIDE "/data/local.prop"
-#define PROP_PATH_FACTORY "/factory/factory.prop"
-
-/*
** Map the property area from the specified filename. This
** method is for testing only.
*/
@@ -146,8 +101,7 @@
**
** 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);
+int __system_property_add(const char *name, unsigned int namelen, const char *value, unsigned int valuelen);
/* Update the value of a system property returned by
** __system_property_find. Can only be done by a single process
@@ -171,15 +125,6 @@
** successive call. */
unsigned int __system_property_wait_any(unsigned int serial);
-/* Compatibility functions to support using an old init with a new libc,
- ** mostly for the OTA updater binary. These can be deleted once OTAs from
- ** a pre-K release no longer needed to be supported. */
-const prop_info *__system_property_find_compat(const char *name);
-int __system_property_read_compat(const prop_info *pi, char *name, char *value);
-int __system_property_foreach_compat(
- void (*propfn)(const prop_info *pi, void *cookie),
- void *cookie);
-
/* Initialize the system properties area in read only mode.
* Should be done by all processes that need to read system
* properties.
@@ -191,4 +136,3 @@
__END_DECLS
#endif
-#endif