Commit graph

33 commits

Author SHA1 Message Date
Devin Moore
690e02aa2c Make libhardware host_supported
This requires dropping a header file and avoiding a missing strlcpy API.
Required for host_supported fuzzers that include this lib.

Test: libsensorserviceaidl_fuzzer
Bug: 205764765

Change-Id: Ib1d2851e915ed87ef2936a044e7a72bab3077f40
2022-11-17 17:47:52 +00:00
Jerry Zhang
3d2535d0f5 Merge "Allow libhardware to be used in recovery" am: dc62b58d3d am: ced9903818 am: 93221cf4cd
am: acd90e7cfa

Change-Id: I250a74ffda8d23cf3586a40c70de763f08086fa1
2018-08-10 18:37:26 -07:00
Jerry Zhang
551e1f7bd9 Allow libhardware to be used in recovery
The default boot ctrl implementation depends
on libhardware.

Bug: 78793464
Test: Compiles, can load bootctrl in recovery
Change-Id: I9c8aa8b00b9b81f11736de13c85973e113056e69
2018-08-10 11:42:44 -07:00
Ernie Hua
ed7ca10dcd Merge "Wrong variable being printed in ALOGV statement." am: f8248731ab am: 1c48df531f
am: 1a7b396a0a

Change-Id: I8f7068f6345255b8d138f30306e65402fd885011
2018-07-11 10:09:30 -07:00
Ernie Hua
5c7a3bd4f9 Wrong variable being printed in ALOGV statement.
Bug: b/111308664
Test: Force on the log message to ensure it is printed.
Change-Id: Id7df120ee024b1bf5530cd06ee4c386da6b75d29
2018-07-10 15:21:24 -07:00
Steven Moreland
e448a05fec sanity: loaded paths in expected locations
HAL implementations should be directly inside hw
folders.

Fixes: 80431864
Test: Boot Pixel 2 devices (which has hal implementations
    that use this as an implementation detail)

Change-Id: I430c2531ed40ce85c86e8efac4fbd2bc244aa5fd
2018-06-26 11:29:33 -07:00
Justin Yun
8f30cfc41b libhardware do not open system hal for vendor modules
For vendor modules, do not search system directory.
Also, vendor modules do not need to dlopen system hals.

Those are allowed only for system modules.

Bug: 62209000
Test: On the device, use camera, audio and bluetooth a2dp.
Change-Id: If7af82a694ef8de901adae7e9aeb187a30e50b02
2017-12-04 12:20:06 +09:00
Justin Yun
c571709b28 libhardware: load with dlopen if the library is in system.
Originally, it is not allowed to open non-sphal libraries if the device
has sphal namespace. However, some system processes are still using
libhardware to load non-sphal libraries. Since it has no harm to allow
system libraries to be loaded by libhardware, this patch loads the
library from the default namespace if the library is located in system
partition.

Bug: 38435840
Test: sailfish builds and boots
Change-Id: I206da11a2656559fcd0995d32dbd73621a79a683
2017-05-24 14:21:24 +09:00
Jiyong Park
4d67d2e13a Load legacy HAL modules from the sphal namespace
'vndk' namespace should not have /vendor/lib/* in its search paths.
However, /vendor/lib/* has been included due to libhardware; it should
be able to load HAL libs in /vendor/lib and /vendor/lib/hw.

Since the HAL libs are not vndk but part of SP-HAL, they are loaded
explicitly from the 'sphal' namespace.

Bug: 37731053
Bug: 37323945
Test: sailfish builds and boots successfuly
Test: BOARD_VNDK_VERSION=current m libhardware.vendor successful
Change-Id: I1e1619de7deaa0e6610180e585bd7775887bc562
2017-05-11 11:49:11 +09:00
Dan Willemsen
4d53a041d3 Include what you use
This doesn't need utils/Log.h, just log/log.h and some stdlib headers.

Bug: 33241851
Test: m -j libhardware
Change-Id: Id73059f5636af42b0d1680b89f6ca27f466d9ea8
2017-04-10 22:16:19 -07:00
Hung-ying Tyan
48f57ad4f4 Add /odm/lib/hw to HAL search path
ODM HALs should be compiled into /odm/lib/hw on the ODM partition.

BUG: 25653199
Change-Id: I23324d8e4dc82301cebd71bc40cdd2b73a678360
2015-11-12 11:24:23 +08:00
Andrei V. FOMITCHEV
ec2ddf56e4 initialization of defined variables
Because in functions of hardware.c, the variables are
not initialized when they are defined, valgrind indicates
that these variables are used as uninitialised! So,
the purpose of this patch is initialization of varaibles.
In the same way, the patch fixes the compilation warning
(unused variable).

Change-Id: Ibaab89d7b57eb9e3a1f46c3af61705a39be10e16
Signed-off-by: Andrei V. FOMITCHEV <andreix.fomitchev@intel.com>
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
2014-04-30 15:49:57 +08:00
Dan Willemsen
86389d1080 Use /(vendor|system)/lib64/hw for 64-bit HAL libraries
Change-Id: Ib905e079b1e88977fb3408671301904c58f35d3c
2014-02-16 10:07:15 -08:00
Colin Cross
f7d761ca34 hardware: fix check for ro.hardware.<class> property
Replace == with >, property_get returns the length of the
property if found.

Change-Id: I4b8fe8f8dba578112d21eee5dc64be4aa27f3bfb
2014-01-13 23:43:23 -08:00
Colin Cross
85ab5d1f91 hardware: add ro.hardware.<class> to HAL loading properites list
Try to load a HAL determined by ro.hardware.<class> first before
falling back to hardware, board, platform, arch, and default.
This is intended to be used to support multiple hardware variants
from the same source.  For example, a single build that supports
two gps chips, gps001 and gpsb, could use /factory/factory.prop
to set ro.hardware.gps=gps001 or ro.hardware.gps=gpsb, which would
load gps.gps001.so or gps.gpsb.so.  Two separate builds from the
same source could use PRODUCT_PROPERTY_OVERRIDES to set the
properties.

Change-Id: I1ac46c21ceb27ceb5165e8c44e9373e9c5d4e34e
2014-01-02 13:17:51 -08:00
Colin Cross
b0c303229f hardware: look in /vendor for default.so
Some vendors have their own HAL modules, which may need their
default implementation stored in /vendor.

Change-Id: I5337a61875023404a85029bbc59b984056b3e441
2013-09-30 14:23:01 -07:00
Steve Block
60d056bf29 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: I0cbe865d464a37365fa3be84948b07e5a0d181d0
2012-01-08 11:03:25 +00:00
Steve Block
7567eba2af Rename LOGV(_IF) to ALOGV(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I8772e564a55981aad2a9cf7cb9245367fcf57fe8
2011-10-25 18:16:10 +01:00
Eric Laurent
188c223c7d Fix hw module lookup order.
Make sure hw_get_module_by_class() first scans /vendor/lib/hw
and then /system/lib/hw so that vendor specific modules override
default ones.

Change-Id: Iaec61c3b4bb6fde202acb4412aaec3b318cc1cbd
2011-05-27 15:46:27 -07:00
Dima Zavin
54921de415 libhardware: add concept of module classes
Needed for things like audio and audio effects. Provides a
new interface to loading modules named 'hw_get_module_by_class'.
This takes two parameters: 'class_id' and 'instance' which are
used to construct the filename for the module to be loaded. If
instance is NULL, then this function acts identically to
hw_get_module where 'class_id' == 'id' (and in fact the latter
implemented exactly this way).

For audio, this new mechanism allows us to load multiple audio
interfaces by doing:

hw_get_module_by_class("audio", "primary", &module);
hw_get_module_by_class("audio", "a2dp", &module);
hw_get_module_by_class("audio", "usb", &module);
...

In the future we will likely want to add the ability to load a set of
module instances based on a config file, which will have a standard
syntax and the mechanism will be provided by libhardware.

Change-Id: I9976cc6d59a85a414b18e7b398a36edfbce4abd8
Signed-off-by: Dima Zavin <dima@android.com>
2011-04-18 15:59:13 -07:00
Brian Swetland
e755bd4038 add /vendor support
Search /vendor/lib/hw/... as well as /system/lib/hw/... for hal modules.

Change-Id: I1aecafcc884e11b2f17edf28e8c8ca2926184807
2010-09-19 03:41:01 -07:00
David 'Digit' Turner
2b811adcbc Fix a bug that prevents default hw modules to be loaded properly.
The problem was a simple typo, which prevented modules like
/system/lib/hw/lib<module>.default.so from being loaded even if they
were found on the system.

This is required to fix the generic build when run in the emulator.
2009-09-25 02:31:47 -07:00
Mathias Agopian
cab816fb6d fix a bug I introduced recently where the "default" HAL module would not be loaded. 2009-09-24 15:11:04 -07:00
Mathias Agopian
3f03e98dbf don't loas inapropriate HAL for a device.
Once we have determined which HAL to load and checked that the library exists,
we should not try to load another (more generic) HAL if a failure occurs, because
this could result in different process using different HALs for the same component.
Instead we just return an error.
2009-09-21 22:50:44 -07:00
Mathias Agopian
6d125da5d2 generic gralloc HAL doesn't need to support partial updates using msm7k specific ioctl. 2009-07-15 15:12:13 -07:00
Mathias Agopian
8c4ab1fa14 pmem allocator in gralloc. enabled for all surfaces. currently it uses a lot more address space than needed. 2009-06-16 18:16:38 -07:00
Mathias Agopian
a8a75166a2 Integrate from //sandbox/mathias/donut/...@145728
SurfaceFlinger rework for new EGL driver model support.
2009-04-10 14:24:31 -07:00
The Android Open Source Project
8232b50d98 auto import from //branches/cupcake_rel/...@138607 2009-03-13 13:04:23 -07:00
The Android Open Source Project
f53ebec387 auto import from //depot/cupcake/@135843 2009-03-03 19:32:14 -08:00
The Android Open Source Project
d51f49a11d auto import from //depot/cupcake/@135843 2009-03-03 18:28:48 -08:00
The Android Open Source Project
b5d75924d7 auto import from //branches/cupcake/...@132569 2009-02-20 07:38:32 -08:00
The Android Open Source Project
0100d517b1 auto import from //branches/cupcake/...@126645 2009-01-15 16:12:12 -08:00
The Android Open Source Project
51704bed79 Code drop from //branches/cupcake/...@124589 2008-12-17 18:05:50 -08:00