Merge "Allow libhardware to be used in recovery" am: dc62b58d3d
am: ced9903818
am: 93221cf4cd
am: acd90e7cfa
Change-Id: I250a74ffda8d23cf3586a40c70de763f08086fa1
This commit is contained in:
commit
3d2535d0f5
2 changed files with 22 additions and 0 deletions
16
Android.bp
16
Android.bp
|
@ -16,7 +16,17 @@ cc_library_headers {
|
||||||
],
|
],
|
||||||
|
|
||||||
export_include_dirs: ["include"],
|
export_include_dirs: ["include"],
|
||||||
|
recovery_available: true,
|
||||||
vendor_available: true,
|
vendor_available: true,
|
||||||
|
target: {
|
||||||
|
recovery: {
|
||||||
|
exclude_header_libs: [
|
||||||
|
"libaudio_system_headers",
|
||||||
|
"libbluetooth-types-header",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cc_library_shared {
|
cc_library_shared {
|
||||||
|
@ -38,9 +48,15 @@ cc_library_shared {
|
||||||
header_libs: ["libhardware_headers"],
|
header_libs: ["libhardware_headers"],
|
||||||
export_header_lib_headers: ["libhardware_headers"],
|
export_header_lib_headers: ["libhardware_headers"],
|
||||||
|
|
||||||
|
recovery_available: true,
|
||||||
vendor_available: true,
|
vendor_available: true,
|
||||||
vndk: {
|
vndk: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
support_system_process: true,
|
support_system_process: true,
|
||||||
},
|
},
|
||||||
|
target: {
|
||||||
|
recovery: {
|
||||||
|
exclude_shared_libs: ["libvndksupport"],
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,9 @@
|
||||||
#define LOG_TAG "HAL"
|
#define LOG_TAG "HAL"
|
||||||
#include <log/log.h>
|
#include <log/log.h>
|
||||||
|
|
||||||
|
#if !defined(__ANDROID_RECOVERY__)
|
||||||
#include <vndksupport/linker.h>
|
#include <vndksupport/linker.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Base path of the hal modules */
|
/** Base path of the hal modules */
|
||||||
#if defined(__LP64__)
|
#if defined(__LP64__)
|
||||||
|
@ -95,7 +97,11 @@ static int load(const char *id,
|
||||||
*/
|
*/
|
||||||
handle = dlopen(path, RTLD_NOW);
|
handle = dlopen(path, RTLD_NOW);
|
||||||
} else {
|
} else {
|
||||||
|
#if defined(__ANDROID_RECOVERY__)
|
||||||
|
handle = dlopen(path, RTLD_NOW);
|
||||||
|
#else
|
||||||
handle = android_load_sphal_library(path, RTLD_NOW);
|
handle = android_load_sphal_library(path, RTLD_NOW);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (handle == NULL) {
|
if (handle == NULL) {
|
||||||
char const *err_str = dlerror();
|
char const *err_str = dlerror();
|
||||||
|
|
Loading…
Reference in a new issue