Merge "Hide __system_property_add/update, deprecate find_nth"

am: 907fcc98b2

Change-Id: I68bbcf32432de9dba91116faae981701e122dbaa
This commit is contained in:
Dimitry Ivanov 2017-01-11 02:03:20 +00:00 committed by android-build-merger
commit ee062c3577
10 changed files with 61 additions and 32 deletions

View file

@ -56,6 +56,7 @@
#include "private/bionic_futex.h"
#include "private/bionic_lock.h"
#include "private/bionic_macros.h"
#include "private/bionic_sdk_version.h"
#include "private/libc_logging.h"
static const char property_service_socket[] = "/dev/socket/" PROP_SERVICE_NAME;
@ -1265,6 +1266,11 @@ unsigned int __system_property_wait_any(unsigned int serial)
const prop_info *__system_property_find_nth(unsigned n)
{
if (bionic_get_application_target_sdk_version() >= __ANDROID_API_O__) {
__libc_fatal("__system_property_find_nth is not supported since Android O,"
" please use __system_property_foreach instead.");
}
find_nth_cookie cookie(n);
const int err = __system_property_foreach(find_nth_fn, &cookie);

View file

@ -81,7 +81,8 @@ int __system_property_read(const prop_info *pi, char *name, char *value);
** is inefficient and order of results may change from call
** to call.
*/
const prop_info *__system_property_find_nth(unsigned n);
const prop_info *__system_property_find_nth(unsigned n)
__REMOVED_IN(26);
/* Pass a prop_info for each system property to the provided
** callback. Use __system_property_read() to read the value

View file

@ -186,19 +186,16 @@ LIBC {
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area__; # var
__system_property_area_init; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area_serial; # introduced=23
__system_property_find;
__system_property_find_nth;
__system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_get;
__system_property_read;
__system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
__system_property_set_filename; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_update; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_wait_any; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__timer_create; # arm x86 mips
__timer_delete; # arm x86 mips
@ -1535,8 +1532,15 @@ LIBC_PRIVATE {
wcswcs; # arm x86 mips
} LIBC_O;
LIBC_DEPRECATED {
global:
__system_property_find_nth;
};
LIBC_PLATFORM {
global:
__system_property_add;
__system_property_update;
android_net_res_stats_get_info_for_net;
android_net_res_stats_aggregate;
android_net_res_stats_get_usable_servers;

View file

@ -131,19 +131,16 @@ LIBC {
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area__; # var
__system_property_area_init; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area_serial; # introduced=23
__system_property_find;
__system_property_find_nth;
__system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_get;
__system_property_read;
__system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
__system_property_set_filename; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_update; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_wait_any; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__umask_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
__vsnprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
@ -1252,8 +1249,15 @@ LIBC_PRIVATE {
gMallocLeakZygoteChild;
} LIBC_O;
LIBC_DEPRECATED {
global:
__system_property_find_nth;
};
LIBC_PLATFORM {
global:
__system_property_add;
__system_property_update;
android_net_res_stats_get_info_for_net;
android_net_res_stats_aggregate;
android_net_res_stats_get_usable_servers;

View file

@ -187,19 +187,16 @@ LIBC {
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area__; # var
__system_property_area_init; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area_serial; # introduced=23
__system_property_find;
__system_property_find_nth;
__system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_get;
__system_property_read;
__system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
__system_property_set_filename; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_update; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_wait_any; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__timer_create; # arm x86 mips
__timer_delete; # arm x86 mips
@ -1561,8 +1558,15 @@ LIBC_PRIVATE {
wcswcs; # arm x86 mips
} LIBC_O;
LIBC_DEPRECATED {
global:
__system_property_find_nth;
};
LIBC_PLATFORM {
global:
__system_property_add;
__system_property_update;
android_net_res_stats_get_info_for_net;
android_net_res_stats_aggregate;
android_net_res_stats_get_usable_servers;

View file

@ -183,19 +183,16 @@ LIBC {
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area__; # var
__system_property_area_init; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area_serial; # introduced=23
__system_property_find;
__system_property_find_nth;
__system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_get;
__system_property_read;
__system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
__system_property_set_filename; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_update; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_wait_any; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__timer_create; # arm x86 mips
__timer_delete; # arm x86 mips
@ -1376,8 +1373,15 @@ LIBC_PRIVATE {
wcswcs; # arm x86 mips
} LIBC_O;
LIBC_DEPRECATED {
global:
__system_property_find_nth;
};
LIBC_PLATFORM {
global:
__system_property_add;
__system_property_update;
android_net_res_stats_get_info_for_net;
android_net_res_stats_aggregate;
android_net_res_stats_get_usable_servers;

View file

@ -131,19 +131,16 @@ LIBC {
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area__; # var
__system_property_area_init; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area_serial; # introduced=23
__system_property_find;
__system_property_find_nth;
__system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_get;
__system_property_read;
__system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
__system_property_set_filename; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_update; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_wait_any; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__umask_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
__vsnprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
@ -1252,8 +1249,15 @@ LIBC_PRIVATE {
gMallocLeakZygoteChild;
} LIBC_O;
LIBC_DEPRECATED {
global:
__system_property_find_nth;
};
LIBC_PLATFORM {
global:
__system_property_add;
__system_property_update;
android_net_res_stats_get_info_for_net;
android_net_res_stats_aggregate;
android_net_res_stats_get_usable_servers;

View file

@ -183,19 +183,16 @@ LIBC {
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area__; # var
__system_property_area_init; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area_serial; # introduced=23
__system_property_find;
__system_property_find_nth;
__system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_get;
__system_property_read;
__system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
__system_property_set_filename; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_update; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_wait_any; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__timer_create; # arm x86 mips
__timer_delete; # arm x86 mips
@ -1375,8 +1372,15 @@ LIBC_PRIVATE {
wcswcs; # arm x86 mips
} LIBC_O;
LIBC_DEPRECATED {
global:
__system_property_find_nth;
};
LIBC_PLATFORM {
global:
__system_property_add;
__system_property_update;
android_net_res_stats_get_info_for_net;
android_net_res_stats_aggregate;
android_net_res_stats_get_usable_servers;

View file

@ -131,19 +131,16 @@ LIBC {
__sym_ntos;
__sym_ston;
__system_properties_init;
__system_property_add; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area__; # var
__system_property_area_init; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_area_serial; # introduced=23
__system_property_find;
__system_property_find_nth;
__system_property_foreach; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_get;
__system_property_read;
__system_property_serial; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_set; # introduced-arm=12 introduced-arm64=21 introduced-mips=12 introduced-mips64=21 introduced-x86=12 introduced-x86_64=21
__system_property_set_filename; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_update; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__system_property_wait_any; # introduced-arm=19 introduced-arm64=21 introduced-mips=19 introduced-mips64=21 introduced-x86=19 introduced-x86_64=21
__umask_chk; # introduced-arm=18 introduced-arm64=21 introduced-mips=18 introduced-mips64=21 introduced-x86=18 introduced-x86_64=21
__vsnprintf_chk; # introduced-arm=17 introduced-arm64=21 introduced-mips=17 introduced-mips64=21 introduced-x86=17 introduced-x86_64=21
@ -1252,8 +1249,15 @@ LIBC_PRIVATE {
gMallocLeakZygoteChild;
} LIBC_O;
LIBC_DEPRECATED {
global:
__system_property_find_nth;
};
LIBC_PLATFORM {
global:
__system_property_add;
__system_property_update;
android_net_res_stats_get_info_for_net;
android_net_res_stats_aggregate;
android_net_res_stats_get_usable_servers;

View file

@ -244,16 +244,10 @@ TEST(properties, find_nth) {
ASSERT_EQ(0, __system_property_add("other_property", 14, "value2", 6));
ASSERT_EQ(0, __system_property_add("property_other", 14, "value3", 6));
ASSERT_NE((const prop_info *)NULL, __system_property_find_nth(0));
ASSERT_NE((const prop_info *)NULL, __system_property_find_nth(1));
ASSERT_NE((const prop_info *)NULL, __system_property_find_nth(2));
ASSERT_EQ((const prop_info *)NULL, __system_property_find_nth(3));
ASSERT_EQ((const prop_info *)NULL, __system_property_find_nth(4));
ASSERT_EQ((const prop_info *)NULL, __system_property_find_nth(5));
ASSERT_EQ((const prop_info *)NULL, __system_property_find_nth(100));
ASSERT_EQ((const prop_info *)NULL, __system_property_find_nth(200));
ASSERT_EQ((const prop_info *)NULL, __system_property_find_nth(247));
// This method is no longer supported and should result in abort
ASSERT_EXIT(__system_property_find_nth(0), testing::KilledBySignal(SIGABRT),
"__system_property_find_nth is not supported since Android O,"
" please use __system_property_foreach instead.");
#else // __BIONIC__
GTEST_LOG_(INFO) << "This test does nothing.\n";
#endif // __BIONIC__