Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Stop using __system_property_area__
Browse files Browse the repository at this point in the history
Apparently that "backdoor" is no longer needed - the proper way is
to reinitialize properties:
    https://android-review.googlesource.com/#/c/181794/24/tests/system_properties_test.cpp

Also removes mentions of libnativehelper test (it no longer uses
__system_property_area__) and removes useless "extern" declaration
(actual use was removed long ago).

Test: refactoring CL, existsing tests still pass

BUG=21852512
BUG=34114501

Change-Id: I2223cab2fcb671ea180ad4470a7aba5c9cd20bd8
  • Loading branch information
Victor Khimenko committed Mar 1, 2017
1 parent ebceea8 commit 4a92ffd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
9 changes: 1 addition & 8 deletions benchmarks/property_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

#include <benchmark/benchmark.h>

extern void* __system_property_area__;

// Do not exceed 512, that is about the largest number of properties
// that can be created with the current property area size.
#define TEST_NUM_PROPS \
Expand All @@ -53,9 +51,6 @@ struct LocalPropertyTestState {
return;
}

old_pa = __system_property_area__;
__system_property_area__ = NULL;

pa_dirname = dirname;
pa_filename = pa_dirname + "/__properties__";

Expand Down Expand Up @@ -111,9 +106,8 @@ struct LocalPropertyTestState {
if (!valid)
return;

__system_property_area__ = old_pa;

__system_property_set_filename(PROP_FILENAME);
__system_property_area_init();
unlink(pa_filename.c_str());
rmdir(pa_dirname.c_str());

Expand All @@ -138,7 +132,6 @@ struct LocalPropertyTestState {
private:
std::string pa_dirname;
std::string pa_filename;
void* old_pa;
};

static void BM_property_get(benchmark::State& state) {
Expand Down
1 change: 0 additions & 1 deletion libc/bionic/system_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ struct find_nth_cookie {
};

// This is public because it was exposed in the NDK. As of 2017-01, ~60 apps reference this symbol.
// It's also used in a libnativehelper test.
prop_area* __system_property_area__ = nullptr;

static char property_filename[PROP_FILENAME_MAX] = PROP_FILENAME;
Expand Down
2 changes: 0 additions & 2 deletions tests/system_properties_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>

extern void *__system_property_area__;

struct LocalPropertyTestState {
LocalPropertyTestState() : valid(false) {
const char* ANDROID_DATA = getenv("ANDROID_DATA");
Expand Down

0 comments on commit 4a92ffd

Please sign in to comment.