LockAgent: Add agent parameters to start_lock_agent script

Add parsing of "--agent-options" parameter to configure optional agent
features.

Sample: adb shell setprop wrap.system_server "start_with_lockagent --agent-options native_crash,java_crash"

Test: m
Test: manual
Change-Id: Ie70d0155096838782cb76f8111a42eba0c20e75d
This commit is contained in:
Andreas Gampe
2019-06-20 12:28:49 -07:00
parent 8695b40720
commit f52b970c1c

View File

@@ -1,5 +1,13 @@
#!/system/bin/sh
AGENT_OPTIONS=
if [[ "$1" == --agent-options ]] ; then
shift
AGENT_OPTIONS="=$1"
shift
fi
APP=$1
shift
$APP -Xplugin:libopenjdkjvmti.so -agentpath:liblockagent.so $@
$APP -Xplugin:libopenjdkjvmti.so "-agentpath:liblockagent.so$AGENT_OPTIONS" $@