OSDN Git Service

Fix hw module lookup order.
authorEric Laurent <elaurent@google.com>
Fri, 27 May 2011 22:41:57 +0000 (15:41 -0700)
committerEric Laurent <elaurent@google.com>
Fri, 27 May 2011 22:46:27 +0000 (15:46 -0700)
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

hardware.c

index 2559237..4d5f8fe 100644 (file)
@@ -146,11 +146,11 @@ int hw_get_module_by_class(const char *class_id, const char *inst,
                 continue;
             }
             snprintf(path, sizeof(path), "%s/%s.%s.so",
-                    HAL_LIBRARY_PATH1, name, prop);
+                     HAL_LIBRARY_PATH2, name, prop);
             if (access(path, R_OK) == 0) break;
 
             snprintf(path, sizeof(path), "%s/%s.%s.so",
-                     HAL_LIBRARY_PATH2, name, prop);
+                     HAL_LIBRARY_PATH1, name, prop);
             if (access(path, R_OK) == 0) break;
         } else {
             snprintf(path, sizeof(path), "%s/%s.default.so",