1

what i'm trying to do is answering a whatsapp voice call with volume keys (usb handset phone) using Tasker (or anything else) on my Raspberry Pi running Android pie, i have followed the following step and the swape is working properly, but when the incoming call rings it doesn't seem to work and fails to do that, hope someone would have a way to solve this problem, thanks in advance!

Whatsapp Answer (6)
    A1: [X] Play Ringtone [ Type:Notification Sound: Stream:5 ] 
    A2: Run Shell [ Command:input swipe 275 575 275 400 Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ] 
    A3: Take Call


Profile: Answer (7)
    Restore: no
    Event: Volume Long Press [ Type:Volume Down Additional Time (Check Help):* ]
Enter: Whatsapp Answer (6)
    A1: [X] Play Ringtone [ Type:Notification Sound: Stream:5 ] 
    A2: Run Shell [ Command:input swipe 275 575 275 400 Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ] 
    A3: Take Call
Starks
  • 35
  • 7
  • Does the swipe work if you trigger it manually? + Does the trigger work for other actions? – JensV Apr 13 '20 at 16:08
  • Yes swipe work when it trigged manually, and the trigger work for other action and even when i'm on whatsapp app it works, but when the call comes, the volume keys only mute the call and nothing else – Starks Apr 13 '20 at 18:05
  • even with a normal phone call it doesn't work, apparently the volume keys only silence the phone call – Starks Apr 13 '20 at 18:37
  • Yes, the active volume stream gets changed. I don't know if you can specify the volume stream in Tasker or something but it will definitely get harder to intercept the keypress when the call window is in foreground. By "usb handset phone" what do you mean exactly? Perhaps you could use other buttons on that if available – JensV Apr 13 '20 at 21:22
  • I use an old usb skype phone from hp, unfortunately there are only two volume keys detected by virtual key code scan, up and down, so I only have these two possibilities to answer an incoming call – Starks Apr 13 '20 at 22:44
  • I can't provide an answer to use the volume buttons, it might not be possible but I don't know. An alternate solution could be to wire up a button to the GPIO pins on the raspberry and write a little Android App that starts a foreground service and listens to the pins. See https://developer.android.com/things/sdk/pio/gpio#input-state – JensV Apr 14 '20 at 07:46
  • Thanks anyway, I was able to resolve this problem using Button Mapper app, with which i've bind volum keys with headsethook keycode key – Starks Apr 15 '20 at 21:25

1 Answers1

1

I was able to resolve this problem using Button Mapper app, with which i've bind vol keys with headsethook keycode key.

Starks
  • 35
  • 7
  • 1
    I totally forgot about that even though I've used it myself before! Nice find on the workaround – JensV Apr 15 '20 at 22:00