As per android developer documentation
Android 8.0 (API level 26) introduces several new permissions related to telephony: The ANSWER_PHONE_CALLS p
Updates from Google :
telecomManager.acceptRingingCall(); telecomManager.acceptRingingCall(false); telecomManager.endCall();
All these three commands are deprecated on and from Android Q
click to verify here