History log of /bionic/tests/system_properties_test2.cpp
Revision Date Author Comments
a0d374d587ec18d437d0dd15ba1332aceaa188af 11-Feb-2017 Elliott Hughes <enh@google.com> Add __system_property_wait and return the serial in __system_property_read_callback.

In order to implement android::base::WaitForProperty well, we need a way to
wait not for *any* property to change (__system_property_wait_any), but to
specifically wait for the property represented by a given `prop_info` to
change.

The android::base::WaitForProperty implementation, like attempts to cache
system properties in the past, also needs a way to keep serials and values
in sync, but the existing functions don't provide a cheap way to get a
consistent snapshot. Change the __system_property_read_callback callback's
type to include the serial corresponding to the given value.

Add a test, slightly clean up some of the existing tests (and name them to
include the names of the functions they're testing, in our usual style).

Bug: http://b/35201172
Test: ran tests
Change-Id: Ibc8ebe2e88eef1e333a1bd3dd7f68135f1ba7fb5
cafd3553751dfb524316884fb213eb80c75a26a2 24-Jan-2017 Dimitry Ivanov <dimitry@google.com> Do not send 0 byte string content.

Trying to send even 0 bytes to closed socket leads to
broken pipe error. Sometimes property service is just
quick enough and closes the socket between send(valuelen)
and send(value) in the case where valuelen is 0.

Bug: http://b/34670529
Test: adb reboot 20 times and make sure phone service did not fail
Test: run bionic-unit-tests --gtest_filter=prop*
Change-Id: I96f90ca6fe1790614e7efd3015bffed1ef1e9040
16b2a4de143a026b8d467b7d242126adcf67242b 24-Jan-2017 Dimitry Ivanov <dimitry@google.com> Revert "Revert "Remove limit of system property name length""

This reverts commit 489f58b5eaedd5a80635bb3a7b39e97037c585f6.
Bug: http://b/33926793
Bug: http://b/34670529
Test: Run bionic-unit-tests --gtest_filter=prop*

Change-Id: Id4e94652dc2310a21f5b7bd3af098bf79df3f380
489f58b5eaedd5a80635bb3a7b39e97037c585f6 24-Jan-2017 Dimitry Ivanov <dimitry@google.com> Revert "Remove limit of system property name length"

This reverts commit 5c1ce278f31bc6fc338b9b951f1adc7c2b343d7c.
Bug: http://b/33926793
Bug: http://b/34670529

Change-Id: I0dc4a8ae55576c69b34b2958d8e664f7066b9c54
5c1ce278f31bc6fc338b9b951f1adc7c2b343d7c 03-Dec-2015 Dimitry Ivanov <dimitry@google.com> Remove limit of system property name length

This change introduces new __system_property_read_callback
method to use in place of deprecated __system_property_read
__system_property_set() and get() should just work but now
do not have limit on system property names.

Bug: http://b/33926793
Test: boot device, run adb shell propget
Test: boot device with old version of init (protocol v1)
Test: run bionic-unit-tests --gtest_filter=prop*
Change-Id: I619fb5a7e27a272aac30011579665f6160888bc7