OSDN Git Service

Preload libnativehelper.so which cannot be loaded through the Java classloader.
authorMartin Stjernholm <mast@google.com>
Fri, 1 Mar 2019 18:32:35 +0000 (18:32 +0000)
committerMartin Stjernholm <mast@google.com>
Fri, 1 Mar 2019 19:40:26 +0000 (19:40 +0000)
Test: atest CtsHardwareTestCases (between 2 and 4 failing tests, but that
  happens on clean ToT too; no dlopen failures)
Bug: 126601993

Change-Id: Icfe58fad93b97992e39758c02c92c488a13c717f

cmds/hid/hid

index 2359fcd..3931da1 100755 (executable)
@@ -5,4 +5,10 @@
 #
 base=/system
 export CLASSPATH=$base/framework/hid.jar
+
+# Preload the native portion libhidcommand_jni.so to bypass the dependency
+# checks in the Java classloader, which prohibit dependencies that aren't
+# listed in system/core/rootdir/etc/public.libraries.android.txt.
+export LD_PRELOAD=libhidcommand_jni.so
+
 exec app_process $base/bin com.android.commands.hid.Hid "$@"