diff options
author | Nick Vaccaro <nvaccaro@google.com> | 2014-05-15 14:14:43 -0700 |
---|---|---|
committer | Nick Vaccaro <nvaccaro@google.com> | 2014-05-15 14:31:51 -0700 |
commit | ad70dc482f044b1ef03ef1aa74b6e2c5a446d32b (patch) | |
tree | d507601d2abae098b1fc94468f62d97a0729d10a /modules/sensors/multihal.cpp | |
parent | d34ed32e06045c5a55b4d25247a98fa64c233bfe (diff) | |
download | hardware_libhardware-ad70dc482f044b1ef03ef1aa74b6e2c5a446d32b.zip hardware_libhardware-ad70dc482f044b1ef03ef1aa74b6e2c5a446d32b.tar.gz hardware_libhardware-ad70dc482f044b1ef03ef1aa74b6e2c5a446d32b.tar.bz2 |
add /system/vendor/lib as valid search path for sensor HALs
MultiHal will now accept sensor HALs listed in the hals.conf file that
reside in either /system/lib/hw or /system/vendor/lib.
Bug: 14994424
Change-Id: I13f17352b97c36b97cfbcee8c9b6a0d2e1ed6dc3
Diffstat (limited to 'modules/sensors/multihal.cpp')
-rw-r--r-- | modules/sensors/multihal.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/sensors/multihal.cpp b/modules/sensors/multihal.cpp index 135e740..5fd500a 100644 --- a/modules/sensors/multihal.cpp +++ b/modules/sensors/multihal.cpp @@ -36,6 +36,7 @@ static const char* CONFIG_FILENAME = "/system/etc/sensors/hals.conf"; static const char* LEGAL_SUBHAL_PATH_PREFIX = "/system/lib/hw/"; +static const char* LEGAL_SUBHAL_ALTERNATE_PATH_PREFIX = "/system/vendor/lib/"; static const int MAX_CONF_LINE_LENGTH = 1024; static pthread_mutex_t init_modules_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -440,14 +441,15 @@ static void get_so_paths(std::vector<char*> *so_paths) { } ALOGV("config file line #%d: '%s'", ++line_count, line); char *real_path = realpath(line, NULL); - if (starts_with(real_path, LEGAL_SUBHAL_PATH_PREFIX)) { + if (starts_with(real_path, LEGAL_SUBHAL_PATH_PREFIX) || + starts_with(real_path, LEGAL_SUBHAL_ALTERNATE_PATH_PREFIX)) { ALOGV("accepting valid path '%s'", real_path); char* compact_line = new char[strlen(real_path) + 1]; strcpy(compact_line, real_path); so_paths->push_back(compact_line); } else { - ALOGW("rejecting path '%s' because it does not start with '%s'", - real_path, LEGAL_SUBHAL_PATH_PREFIX); + ALOGW("rejecting path '%s' because it does not start with '%s' or '%s'", + real_path, LEGAL_SUBHAL_PATH_PREFIX, LEGAL_SUBHAL_ALTERNATE_PATH_PREFIX); } free(real_path); } |