There’s an app called Auto Answer available through F-Droid, which automatically answers calls. Not exactly what you’re looking for, but it’s the libre option.
I’m experimenting with an Xposed module called Physical Button Master Control - I think it should be able to allow calls to be answered with the camera button, but the process of finding out how is a bit fiddly.
Is your phone rooted, and do you have Xposed by any chance?
Edit: it can be done. Here’s how to make it so that you can answer your phone with the camera button:
- Have a rooted phone, install Xposed Installer, open Xposed Installer and install framework, reboot.
- In the Xposed Installer, go to ‘Download’ and install Xposed module Physical Button Master Control. Activate the module and reboot.
- Open PBMC, press ‘no’ when it offers to create chains.
- Tap the plus sign, and tap ‘Advanced chain’.
- For ‘name’ type in any name, like ‘answer phone’.
- Tap ‘Add key’, tap ‘CHANGE’ and briefly press the camera button. The box next to ‘CHANGE’ should now say ‘Camera’.
- Next to ‘Action’ tap ‘NOTHING’, tap ‘Keypress’ and then tap ‘Call (5)’.
- Tap ‘SCREEN OFF’, and select ‘LOCKSCREEN’ and ‘SCREEN ON’. All three options should be selected.
- For ‘Telephony’, deselect ‘IDLE’ and select ‘Ringing’.
- Tap the floppy disc icon at the top of the screen.
You can now answer phone calls with the camera button. It’ll only perform this function when there’s an incoming call, so it performs its usual functions at all other times.