OSDN Git Service

HACK - Avoid crashes on SurfaceFlinger when using software rendering
[android-x86/hardware-libhardware.git] / hardware.c
index 79d0a2f..5394787 100644 (file)
 #if defined(__LP64__)
 #define HAL_LIBRARY_PATH1 "/system/lib64/hw"
 #define HAL_LIBRARY_PATH2 "/vendor/lib64/hw"
+#define HAL_LIBRARY_PATH3 "/odm/lib64/hw"
 #else
 #define HAL_LIBRARY_PATH1 "/system/lib/hw"
 #define HAL_LIBRARY_PATH2 "/vendor/lib/hw"
+#define HAL_LIBRARY_PATH3 "/odm/lib/hw"
 #endif
 
 /**
@@ -130,6 +132,11 @@ static int hw_module_exists(char *path, size_t path_len, const char *name,
                             const char *subname)
 {
     snprintf(path, path_len, "%s/%s.%s.so",
+             HAL_LIBRARY_PATH3, name, subname);
+    if (access(path, R_OK) == 0)
+        return 0;
+
+    snprintf(path, path_len, "%s/%s.%s.so",
              HAL_LIBRARY_PATH2, name, subname);
     if (access(path, R_OK) == 0)
         return 0;