[Android Head-Units] romprod:
Hi,

Yes the right keymod installed and BusyBox has been upgraded.

I have installed Tasker and created a task to run a shell command to kill the app with "am force-stop com.android.DroidLivePlayer" and that works fine.

It seems I've probably not got the script set right or installed right.

# V3.0 - 2/26/2017 - Simple Example script for Joying 2GB Sofia
#
# This script is designed to customize the commands issued from steering wheel
# keys and is an example of what can be done. Not all programs/actions have
# been tested, but this should serve as a guide to your own custom script.
#
# All output from this script goes to /dev/null, however the system call is
# shown in the 'adb logcat' as a debug statement with the tag MCUKEY. If
# you want to preserve script output for debugging, you may want to consider a
# wrapper script to capture. When this script is run by the system, access to
# /sdcard is not available. Hence you may want to use /data to store anything
# such as counts or command output. When run by the system it is run with the
# 'system' login. If you are testing the script using adb, make sure you
# either delete or change ownership of the files so 'system' has r/w access.
#
# USEFUL LAUNCH COMMDANDS defined as variables
#

# Goto Home screen
home="input keyevent 3"

# Back
back="input keyevent 4"

# pause
pause="input keyevent 127"

# Play
play="input keyevent 126"

# Recent Task list
recent="input keyevent KEYCODE_APP_SWITCH"

# Launch Web Page ( you may need to get creative with quotes depending on page )
web="am start -a android.intent.action.VIEW -n com.android.browser/.BrowserActivity http://images.intellicast.com/WxImages/RadarLoop/spi_None_anim.gif"

# ScreenFilter
scrflt="am start com.haxor/com.haxor.ScreenFilter"

# Google Voice Command
gvc="am start com.google.android.googlequicksearchbox/com.google.android.googlequicksearchbox.VoiceSearchActivity"

# Google maps
maps="am start com.google.android.apps.maps/com.google.android.maps.MapsActivity"

# Radio
radio="am start com.syu.radio/com.syu.radio.Launch"

# I heart radio
iheart="am start com.clearchannel.iheartradio.controller/com.clearchannel.iheartradio.controller.activities.NavDrawerActivity"
iheart_press=$play

# Pandora
pandora="am start com.pandora.android/com.pandora.android.Main --activity-single-top --activity-brought-to-front"

# Press position on touchscreen for play/pause, small swipe was more reliable
pandora_press="input swipe 550 580 555 585 500";

# Spotify
spotify="am start com.spotify.music/com.spotify.music.MainActivity"

# Press position on touchscreen for play/pause
spotify_press="input swipe 945 500 950 505 200"

# SYU Music ( stock music player )
music="am start com.syu.music/com.syu.media.act.Act_Music"

# Torque
torque="am start org.prowl.torque/org.prowl.torque.landing.FrontPage"

# key is the only arguemnt recieved and actions are based on the key number
key=$1

case $key in
27) # BTPHONE/PTT - call google voice search
$gvc
;;

9) # NAVI - Toggle between Google Maps and last app
#
x=`dumpsys activity activities | grep "Run #" | cut -f 13 -d" "| head -1 | grep maps`
if [ "$x" = "" ]
then
$maps
else
am start `dumpsys activity activities | grep "Run #" | cut -f 13 -d" " | grep -v launcher | grep -v systemui | grep -v maps |head -1`
fi
;;

37) # SOURCE/MODE
#
# Toggle between applications Pandora, Spotify, Stock Music App,
# and Radio. If longer than 1m, then bring up the last one
# called before continuing cycle
#

# Check if key press in last minute by checking if key file was modified
found=`busybox find /data/$key.cnt -mmin -1 | wc -l`
if [ "$found" = "0" ]
then
# More than 1 minute bring current player to front
next=`cat /data/$key.last`
# Do not send pause or play
keypress=0
else
next=`cat /data/$key.cnt`
keypress=1
# Send pause before changing to next
$pause
fi
echo $next > /data/$key.last

case $next in
0) echo 1 > /data/$key.cnt
$pandora
( [ $keypress = 1 ] && sleep 3 && $pandora_press)
;;
1) echo 2 > /data/$key.cnt
$spotify
( [ $keypress = 1 ] && sleep 3 && $spotify_press)
;;
2) echo 3 > /data/$key.cnt
$music
( [ $keypress = 1 ] && sleep 3 && $music_press)
;;
3) echo 0 > /data/$key.cnt
$radio
;;
*) echo 0 > /data/$key.cnt
echo 0 > /data/$key.last
$home
;;
esac
;;

28) # HANG
;;
31) # DVD
;;
32) # EJECT
;;
33) # MEDIA KEY - Not used by me
;;
34) # BAND KEY - Not used by me
;;
97) # ACC_ON - execute on key on
$play
;;
98) # ACC_OFF
$pause;
am force-stop org.prowl.torque;
am force-stop com.google.android.apps.maps;
am force-stop com.android.DroidLivePlayer;
;;
99) # RESUME - executes on resume of system
sleep 2; $home
;;

*) # DO NOT REMOVE - Pass any other keys pressed as keyevent
# 3-Home, 4-Back, 85-PlayPause, 88-Prev, 86-Stop, 89-FB
# 90-FF, 87-Next, 126-Play, 127-Pause
input keyevent $key
;;
esac # End $key cases

exit 0