Just for info. Works like charm on my Moto G3 runnnig V6.0.1 Android.
But on Moto G7 Power running Android V9, I don't get caller ID and I get:
Use TelecomManger to end call programatically for Android 9 and above using ANSWER_PHONE_CALL permission.
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) { TelecomManager tm = (TelecomManager) getSystemService(Context.TELECOM_SERVICE); if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ANSWER_PHONE_CALLS) == PackageManager.PERMISSION_GRANTED) { success = tm.endCall(); Log.d("call state", "call end"); } }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Just for info.
Works like charm on my Moto G3 runnnig V6.0.1 Android.
But on Moto G7 Power running Android V9, I don't get caller ID and I get:
Use TelecomManger to end call programatically for Android 9 and above using ANSWER_PHONE_CALL permission.
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) {
TelecomManager tm = (TelecomManager) getSystemService(Context.TELECOM_SERVICE);
if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ANSWER_PHONE_CALLS) == PackageManager.PERMISSION_GRANTED) {
success = tm.endCall();
Log.d("call state", "call end");
}
}