summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-08-09 05:08:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-08-09 05:08:30 +0000
commitdebc264b5b9b86dcbdc63238faea9079730be722 (patch)
tree458c1a122bb01f7813533f4866d81799ae287bbd
parentb0899a73c3e0633dd8e8cff6bf3a094f1c26bcc0 (diff)
parentb096f774115869cf8dc8ced5a1cd9d7af729b6bd (diff)
downloadlibhidl-debc264b5b9b86dcbdc63238faea9079730be722.tar.gz
Merge changes from topic 'mark_vndk' into oc-mr1-dev
* changes: Add /system/lib/vndk-sp/hw to search paths for HAL impls Mark android.hidl.memory@1.0-impl as vndk-sp
-rw-r--r--CleanSpec.mk3
-rw-r--r--base/HidlInternal.cpp1
-rw-r--r--base/include/hidl/HidlInternal.h11
-rw-r--r--transport/ServiceManagement.cpp17
-rw-r--r--transport/memory/1.0/default/Android.bp5
5 files changed, 25 insertions, 12 deletions
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 7d4e281..f3573c5 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -46,3 +46,6 @@
$(call add-clean-step, rm -f $(PRODUCT_OUT)/system/bin/hw/android.hidl.memory@1.0-service)
$(call add-clean-step, rm -f $(PRODUCT_OUT)/system/etc/init/android.hidl.memory@1.0-service.rc)
+
+# memory@1.0-impl is moved to /system/lib/vndk-sp
+$(call add-clean-step, rm -f $(PRODUCT_OUT)/system/lib/hw/android.hidl.memory@1.0-impl.so)
diff --git a/base/HidlInternal.cpp b/base/HidlInternal.cpp
index b0d867f..c534a4c 100644
--- a/base/HidlInternal.cpp
+++ b/base/HidlInternal.cpp
@@ -77,6 +77,7 @@ void HidlInstrumentor::registerInstrumentationCallbacks(
instrumentationLibPaths.push_back(instrumentationLibPath);
} else {
instrumentationLibPaths.push_back(HAL_LIBRARY_PATH_SYSTEM);
+ instrumentationLibPaths.push_back(HAL_LIBRARY_PATH_VNDK_SP);
instrumentationLibPaths.push_back(HAL_LIBRARY_PATH_VENDOR);
instrumentationLibPaths.push_back(HAL_LIBRARY_PATH_ODM);
}
diff --git a/base/include/hidl/HidlInternal.h b/base/include/hidl/HidlInternal.h
index 6c0d8df..374cbf7 100644
--- a/base/include/hidl/HidlInternal.h
+++ b/base/include/hidl/HidlInternal.h
@@ -95,18 +95,22 @@ private:
};
#define HAL_LIBRARY_PATH_SYSTEM_64BIT "/system/lib64/hw/"
+#define HAL_LIBRARY_PATH_VNDK_SP_64BIT "/system/lib64/vndk-sp/hw/"
#define HAL_LIBRARY_PATH_VENDOR_64BIT "/vendor/lib64/hw/"
#define HAL_LIBRARY_PATH_ODM_64BIT "/odm/lib64/hw/"
#define HAL_LIBRARY_PATH_SYSTEM_32BIT "/system/lib/hw/"
+#define HAL_LIBRARY_PATH_VNDK_SP_32BIT "/system/lib/vndk-sp/hw/"
#define HAL_LIBRARY_PATH_VENDOR_32BIT "/vendor/lib/hw/"
#define HAL_LIBRARY_PATH_ODM_32BIT "/odm/lib/hw/"
#if defined(__LP64__)
#define HAL_LIBRARY_PATH_SYSTEM HAL_LIBRARY_PATH_SYSTEM_64BIT
+#define HAL_LIBRARY_PATH_VNDK_SP HAL_LIBRARY_PATH_VNDK_SP_64BIT
#define HAL_LIBRARY_PATH_VENDOR HAL_LIBRARY_PATH_VENDOR_64BIT
#define HAL_LIBRARY_PATH_ODM HAL_LIBRARY_PATH_ODM_64BIT
#else
#define HAL_LIBRARY_PATH_SYSTEM HAL_LIBRARY_PATH_SYSTEM_32BIT
+#define HAL_LIBRARY_PATH_VNDK_SP HAL_LIBRARY_PATH_VNDK_SP_32BIT
#define HAL_LIBRARY_PATH_VENDOR HAL_LIBRARY_PATH_VENDOR_32BIT
#define HAL_LIBRARY_PATH_ODM HAL_LIBRARY_PATH_ODM_32BIT
#endif
@@ -153,9 +157,10 @@ struct HidlInstrumentor {
// libraries and registers the instrumentation callback functions.
//
// The instrumentation libraries should be stored under any of the following
- // directories: HAL_LIBRARY_PATH_SYSTEM, HAL_LIBRARY_PATH_VENDOR and
- // HAL_LIBRARY_PATH_ODM. The name of instrumentation libraries should
- // follow pattern: ^profilerPrefix(.*).profiler.so$
+ // directories: HAL_LIBRARY_PATH_SYSTEM, HAL_LIBRARY_PATH_VNDK_SP,
+ // HAL_LIBRARY_PATH_VENDOR and HAL_LIBRARY_PATH_ODM.
+ // The name of instrumentation libraries should follow pattern:
+ // ^profilerPrefix(.*).profiler.so$
//
// Each instrumentation library is expected to implement the instrumentation
// function called HIDL_INSTRUMENTATION_FUNCTION.
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index 44a6f31..72ac53a 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -278,7 +278,7 @@ struct PassthroughServiceManager : IServiceManager1_1 {
dlerror(); // clear
std::vector<std::string> paths = {HAL_LIBRARY_PATH_ODM, HAL_LIBRARY_PATH_VENDOR,
- HAL_LIBRARY_PATH_SYSTEM};
+ HAL_LIBRARY_PATH_VNDK_SP, HAL_LIBRARY_PATH_SYSTEM};
#ifdef LIBHIDL_TARGET_DEBUGGABLE
const char* env = std::getenv("TREBLE_TESTING_OVERRIDE");
const bool trebleTestingOverride = env && !strcmp(env, "true");
@@ -381,14 +381,13 @@ struct PassthroughServiceManager : IServiceManager1_1 {
Return<void> debugDump(debugDump_cb _hidl_cb) override {
using Arch = ::android::hidl::base::V1_0::DebugInfo::Architecture;
using std::literals::string_literals::operator""s;
- static std::vector<std::pair<Arch, std::vector<const char *>>> sAllPaths{
- {Arch::IS_64BIT, {HAL_LIBRARY_PATH_ODM_64BIT,
- HAL_LIBRARY_PATH_VENDOR_64BIT,
- HAL_LIBRARY_PATH_SYSTEM_64BIT}},
- {Arch::IS_32BIT, {HAL_LIBRARY_PATH_ODM_32BIT,
- HAL_LIBRARY_PATH_VENDOR_32BIT,
- HAL_LIBRARY_PATH_SYSTEM_32BIT}}
- };
+ static std::vector<std::pair<Arch, std::vector<const char*>>> sAllPaths{
+ {Arch::IS_64BIT,
+ {HAL_LIBRARY_PATH_ODM_64BIT, HAL_LIBRARY_PATH_VENDOR_64BIT,
+ HAL_LIBRARY_PATH_VNDK_SP_64BIT, HAL_LIBRARY_PATH_SYSTEM_64BIT}},
+ {Arch::IS_32BIT,
+ {HAL_LIBRARY_PATH_ODM_32BIT, HAL_LIBRARY_PATH_VENDOR_32BIT,
+ HAL_LIBRARY_PATH_VNDK_SP_32BIT, HAL_LIBRARY_PATH_SYSTEM_32BIT}}};
std::map<std::string, InstanceDebugInfo> map;
for (const auto &pair : sAllPaths) {
Arch arch = pair.first;
diff --git a/transport/memory/1.0/default/Android.bp b/transport/memory/1.0/default/Android.bp
index 93f6370..a4f45cf 100644
--- a/transport/memory/1.0/default/Android.bp
+++ b/transport/memory/1.0/default/Android.bp
@@ -14,6 +14,11 @@
cc_library_shared {
name: "android.hidl.memory@1.0-impl",
+ vendor_available: true,
+ vndk: {
+ enabled: true,
+ support_system_process: true,
+ },
compile_multilib: "both",
relative_install_path: "hw",
cflags: libhidl_flags,