Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-libhardware: Commit

hardware/libhardware


Commit MetaInfo

Révisioneea5ad68163c57415f1e4d90239e4b30ce9e08d7 (tree)
l'heure2013-07-25 17:46:27
AuteurChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Message de Log

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

Modification

--- 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);
Afficher sur ancien navigateur de dépôt.