Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-libhardware: Commit

hardware/libhardware


Commit MetaInfo

Revisionfca06e3a651fc707d58af62d2a287bccf17fa005 (tree)
Time2013-12-09 23:47:41
AuthorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

libhardware: search hals by hal.* properties

The patch allows us to control which hals to be loaded more flexible.
It's the key point to make a generic image to support more devices.

Change Summary

Incremental Difference

--- a/hardware.c
+++ b/hardware.c
@@ -140,10 +140,17 @@ int hw_get_module_by_class(const char *class_id, const char *inst,
140140 */
141141
142142 /* Loop through the configuration variants looking for a module */
143- for (i=0 ; i<HAL_VARIANT_KEYS_COUNT+1 ; i++) {
143+ for (i=-1 ; i<HAL_VARIANT_KEYS_COUNT+1 ; i++) {
144144 if (i < HAL_VARIANT_KEYS_COUNT) {
145- if (property_get(variant_keys[i], prop, NULL) == 0) {
146- continue;
145+ if (i < 0) {
146+ snprintf(path, sizeof(path), "hal.%s", name);
147+ if (property_get(path, prop, NULL) == 0) {
148+ continue;
149+ }
150+ } else {
151+ if (property_get(variant_keys[i], prop, NULL) == 0) {
152+ continue;
153+ }
147154 }
148155 snprintf(path, sizeof(path), "%s/%s.%s.so",
149156 HAL_LIBRARY_PATH2, name, prop);
Show on old repository browser