Merge "libvndksupport: Do not lookup default namespace for sphal failure" into oc-dev
diff --git a/fs_mgr/fs_mgr_fstab.cpp b/fs_mgr/fs_mgr_fstab.cpp
index 0a694c1..7d09d01 100644
--- a/fs_mgr/fs_mgr_fstab.cpp
+++ b/fs_mgr/fs_mgr_fstab.cpp
@@ -397,6 +397,15 @@
std::vector<std::string> fstab_entry;
std::string file_name;
std::string value;
+ // skip a partition entry if the status property is present and not set to ok
+ file_name = android::base::StringPrintf("%s/%s/status", fstabdir_name.c_str(), dp->d_name);
+ if (read_dt_file(file_name, &value)) {
+ if (value != "okay" && value != "ok") {
+ LINFO << "dt_fstab: Skip disabled entry for partition " << dp->d_name;
+ continue;
+ }
+ }
+
file_name = android::base::StringPrintf("%s/%s/dev", fstabdir_name.c_str(), dp->d_name);
if (!read_dt_file(file_name, &value)) {
LERROR << "dt_fstab: Failed to find device for partition " << dp->d_name;
diff --git a/libdiskconfig/Android.bp b/libdiskconfig/Android.bp
index 041fd63..088981a 100644
--- a/libdiskconfig/Android.bp
+++ b/libdiskconfig/Android.bp
@@ -1,5 +1,6 @@
cc_library {
name: "libdiskconfig",
+ vendor_available: true,
srcs: [
"diskconfig.c",
"diskutils.c",
diff --git a/libion/Android.bp b/libion/Android.bp
index da98111..6f267e4 100644
--- a/libion/Android.bp
+++ b/libion/Android.bp
@@ -1,6 +1,7 @@
cc_library {
name: "libion",
+ vendor_available: true,
srcs: ["ion.c"],
shared_libs: ["liblog"],
local_include_dirs: [
diff --git a/libmemunreachable/Android.bp b/libmemunreachable/Android.bp
index 4662368..1b8830a 100644
--- a/libmemunreachable/Android.bp
+++ b/libmemunreachable/Android.bp
@@ -15,6 +15,7 @@
cc_library_shared {
name: "libmemunreachable",
+ vendor_available: true,
defaults: ["libmemunreachable_defaults"],
srcs: [
"Allocator.cpp",
diff --git a/libmetricslogger/Android.bp b/libmetricslogger/Android.bp
index da8afe1..79d6c3f 100644
--- a/libmetricslogger/Android.bp
+++ b/libmetricslogger/Android.bp
@@ -30,6 +30,7 @@
// -----------------------------------------------------------------------------
cc_library_shared {
name: "libmetricslogger",
+ vendor_available: true,
srcs: metricslogger_lib_src_files,
defaults: ["metricslogger_defaults"],
}
diff --git a/libnetutils/Android.bp b/libnetutils/Android.bp
index f710ba2..d63d619 100644
--- a/libnetutils/Android.bp
+++ b/libnetutils/Android.bp
@@ -1,5 +1,6 @@
cc_library_shared {
name: "libnetutils",
+ vendor_available: true,
srcs: [
"dhcpclient.c",
diff --git a/libprocinfo/Android.bp b/libprocinfo/Android.bp
index c13ffe9..aedaa38 100644
--- a/libprocinfo/Android.bp
+++ b/libprocinfo/Android.bp
@@ -22,6 +22,7 @@
cc_library {
name: "libprocinfo",
+ vendor_available: true,
host_supported: true,
srcs: [
"process.cpp",
diff --git a/libsuspend/Android.bp b/libsuspend/Android.bp
index d442c94..130800e 100644
--- a/libsuspend/Android.bp
+++ b/libsuspend/Android.bp
@@ -2,6 +2,8 @@
cc_library {
name: "libsuspend",
+ vendor_available: true,
+
srcs: [
"autosuspend.c",
"autosuspend_wakeup_count.c",
diff --git a/libsysutils/Android.bp b/libsysutils/Android.bp
index 296bd26..550ef42 100644
--- a/libsysutils/Android.bp
+++ b/libsysutils/Android.bp
@@ -1,5 +1,7 @@
cc_library_shared {
name: "libsysutils",
+ vendor_available: true,
+
srcs: [
"src/SocketListener.cpp",
"src/FrameworkListener.cpp",
diff --git a/libutils/Android.bp b/libutils/Android.bp
index 696db3b..5e76279 100644
--- a/libutils/Android.bp
+++ b/libutils/Android.bp
@@ -94,6 +94,7 @@
"libcutils",
"libdl",
"liblog",
+ "libvndksupport",
],
sanitize: {
diff --git a/libutils/misc.cpp b/libutils/misc.cpp
index ab72fe6..d95fd05 100644
--- a/libutils/misc.cpp
+++ b/libutils/misc.cpp
@@ -23,6 +23,13 @@
#include <utils/Log.h>
#include <utils/Vector.h>
+#if defined(__ANDROID__)
+#include <dlfcn.h>
+#include <vndksupport/linker.h>
+#endif
+
+extern "C" void do_report_sysprop_change();
+
using namespace android;
namespace android {
@@ -61,7 +68,36 @@
#endif
}
+#if defined(__ANDROID__)
+void (*get_report_sysprop_change_func())() {
+ void (*func)() = nullptr;
+ void* handle = android_load_sphal_library("libutils.so", RTLD_NOW);
+ if (handle != nullptr) {
+ func = reinterpret_cast<decltype(func)>(dlsym(handle, "do_report_sysprop_change"));
+ }
+
+ return func;
+}
+#endif
+
void report_sysprop_change() {
+ do_report_sysprop_change();
+
+#if defined(__ANDROID__)
+ // libutils.so is double loaded; from the default namespace and from the
+ // 'sphal' namespace. Redirect the sysprop change event to the other instance
+ // of libutils.so loaded in the 'sphal' namespace so that listeners attached
+ // to that instance is also notified with this event.
+ static auto func = get_report_sysprop_change_func();
+ if (func != nullptr) {
+ (*func)();
+ }
+#endif
+}
+
+}; // namespace android
+
+void do_report_sysprop_change() {
#if !defined(_WIN32)
pthread_mutex_lock(&gSyspropMutex);
Vector<sysprop_change_callback_info> listeners;
@@ -76,5 +112,3 @@
}
#endif
}
-
-}; // namespace android
diff --git a/libvndksupport/Android.bp b/libvndksupport/Android.bp
index ab9e26f..b624223 100644
--- a/libvndksupport/Android.bp
+++ b/libvndksupport/Android.bp
@@ -1,6 +1,6 @@
subdirs = ["tests"]
-cc_library_shared {
+cc_library {
name: "libvndksupport",
srcs: ["linker.c"],
local_include_dirs: ["include/vndksupport"],
diff --git a/libziparchive/Android.bp b/libziparchive/Android.bp
index 44daf36..0a4f088 100644
--- a/libziparchive/Android.bp
+++ b/libziparchive/Android.bp
@@ -56,6 +56,8 @@
cc_library {
name: "libziparchive",
host_supported: true,
+ vendor_available:true,
+
defaults: ["libziparchive_defaults", "libziparchive_flags"],
shared_libs: ["liblog", "libbase"],
target: {