Revert "Revert "move android_ids into bionic""
This reverts commit 77cb68d9f2621639ec7f4e1b124ceeee5c80a66a.
Change-Id: Ibc9f775c4cd418be90fd8a6f192dd72ca5dff09a
diff --git a/libc/Android.bp b/libc/Android.bp
index 094ad5c..66bbc71 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -1194,6 +1194,13 @@
name: "libc_bionic",
}
+genrule {
+ name: "generated_android_ids",
+ out: [ "generated_android_ids.h" ],
+ tool_files: [ "fs_config_generator.py" ],
+ cmd: "$(location fs_config_generator.py) aidarray system/core/include/private/android_filesystem_config.h > $(out)",
+}
+
// ========================================================
// libc_bionic_ndk.a- The portions of libc_bionic that can
// be safely used in libc_ndk.a (no troublesome global data
@@ -1382,6 +1389,7 @@
local_include_dirs: ["stdio"],
include_dirs: ["bionic/libstdc++/include"],
name: "libc_bionic_ndk",
+ generated_headers: ["generated_android_ids"],
}
// ========================================================
diff --git a/libc/bionic/grp_pwd.cpp b/libc/bionic/grp_pwd.cpp
index 332b2b8..b6b5796 100644
--- a/libc/bionic/grp_pwd.cpp
+++ b/libc/bionic/grp_pwd.cpp
@@ -43,6 +43,9 @@
#include "private/libc_logging.h"
#include "private/ThreadLocalBuffer.h"
+// Generated android_ids array
+#include "generated_android_ids.h"
+
// POSIX seems to envisage an implementation where the <pwd.h> functions are
// implemented by brute-force searching with getpwent(3), and the <grp.h>
// functions are implemented similarly with getgrent(3). This means that it's
diff --git a/libc/fs_config_generator.py b/libc/fs_config_generator.py
new file mode 120000
index 0000000..aafb7dc
--- /dev/null
+++ b/libc/fs_config_generator.py
@@ -0,0 +1 @@
+../../build/tools/fs_config/fs_config_generator.py
\ No newline at end of file