According to Android 12 documentation there is special in/out-call notification that will show that called 'prominent chip'.
I tried to use the code from Android example:
// Create a new call with the user as caller.
Person incoming_caller = new Person.Builder()
.setName("Jane Doe")
.setImportant(true)
.build();
Notification.Builder builder = Notification.Builder(context, CHANNEL_ID)
.setContentIntent(contentIntent)
.setSmallIcon(smallIcon)
.setStyle(
Notification.CallStyle.forIncomingCall(caller, declineIntent, answerIntent))
.addPerson(incoming_caller);
In my application im using NotificationCompat
and NotificationCompat.Builder
but this line Notification.CallStyle.forIncomingCall
is refer to non Compat
versions so I can't use the logic of forIncomingCall
to my existing notification.