diff options
author | Brian Swetland <swetland@google.com> | 2010-09-19 03:51:37 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-09-19 03:51:37 -0700 |
commit | 26ad39290948f7728b613208e5b8dc311029ebfe (patch) | |
tree | d9b3e39bd1a4269e28e940c10585ed8073a0cd0e | |
parent | 72c113ee6016d56bd171c5879f4a2cc71b698f17 (diff) | |
parent | e755bd4038cab69f98f7cf17e41f493296ec62ab (diff) | |
download | libhardware-26ad39290948f7728b613208e5b8dc311029ebfe.tar.gz |
am e755bd40: add /vendor support
Merge commit 'e755bd4038cab69f98f7cf17e41f493296ec62ab' into gingerbread-plus-aosp
* commit 'e755bd4038cab69f98f7cf17e41f493296ec62ab':
add /vendor support
-rw-r--r-- | hardware.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -28,7 +28,8 @@ #include <utils/Log.h> /** Base path of the hal modules */ -#define HAL_LIBRARY_PATH "/system/lib/hw" +#define HAL_LIBRARY_PATH1 "/system/lib/hw" +#define HAL_LIBRARY_PATH2 "/vendor/lib/hw" /** * There are a set of variant filename for modules. The form of the filename @@ -138,16 +139,17 @@ int hw_get_module(const char *id, const struct hw_module_t **module) continue; } snprintf(path, sizeof(path), "%s/%s.%s.so", - HAL_LIBRARY_PATH, id, prop); + HAL_LIBRARY_PATH1, id, prop); + if (access(path, R_OK) == 0) break; + + snprintf(path, sizeof(path), "%s/%s.%s.so", + HAL_LIBRARY_PATH2, id, prop); + if (access(path, R_OK) == 0) break; } else { snprintf(path, sizeof(path), "%s/%s.default.so", - HAL_LIBRARY_PATH, id); - } - if (access(path, R_OK)) { - continue; + HAL_LIBRARY_PATH1, id); + if (access(path, R_OK) == 0) break; } - /* we found a library matching this id/variant */ - break; } status = -ENOENT; |