From bd3cc95907e1ce7fa027942ef3bb5ec7af3800d0 Mon Sep 17 00:00:00 2001 From: Bionic-dev715 Date: Wed, 21 Jan 2026 19:43:38 +0530 Subject: [PATCH 1/9] Create bg_notification_answer.xml --- app/src/main/res/drawable/bg_notification_answer.xml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 app/src/main/res/drawable/bg_notification_answer.xml diff --git a/app/src/main/res/drawable/bg_notification_answer.xml b/app/src/main/res/drawable/bg_notification_answer.xml new file mode 100644 index 000000000..b1b73fb33 --- /dev/null +++ b/app/src/main/res/drawable/bg_notification_answer.xml @@ -0,0 +1,3 @@ + + + From 944c9400d049d99ee7b29d9e9f637d75a7a0c0bb Mon Sep 17 00:00:00 2001 From: Bionic-dev715 Date: Wed, 21 Jan 2026 19:46:21 +0530 Subject: [PATCH 2/9] Create bg_notification_decline.xml --- app/src/main/res/drawable/bg_notification_decline.xml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 app/src/main/res/drawable/bg_notification_decline.xml diff --git a/app/src/main/res/drawable/bg_notification_decline.xml b/app/src/main/res/drawable/bg_notification_decline.xml new file mode 100644 index 000000000..da518082c --- /dev/null +++ b/app/src/main/res/drawable/bg_notification_decline.xml @@ -0,0 +1,4 @@ + + + + From 039282e9c8697314d708941af45ddfa07745637b Mon Sep 17 00:00:00 2001 From: Bionic-dev715 Date: Wed, 21 Jan 2026 19:52:11 +0530 Subject: [PATCH 3/9] Create bg_notification_speaker.xml --- app/src/main/res/drawable/bg_notification_speaker.xml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 app/src/main/res/drawable/bg_notification_speaker.xml diff --git a/app/src/main/res/drawable/bg_notification_speaker.xml b/app/src/main/res/drawable/bg_notification_speaker.xml new file mode 100644 index 000000000..f46da781e --- /dev/null +++ b/app/src/main/res/drawable/bg_notification_speaker.xml @@ -0,0 +1,4 @@ + + + + From 15312d5759ba15b8e21fbd2a2c222c66311541bb Mon Sep 17 00:00:00 2001 From: Bionic-dev715 Date: Wed, 21 Jan 2026 19:54:55 +0530 Subject: [PATCH 4/9] Update Constants.kt --- app/src/main/kotlin/org/fossify/phone/helpers/Constants.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/kotlin/org/fossify/phone/helpers/Constants.kt b/app/src/main/kotlin/org/fossify/phone/helpers/Constants.kt index 754151c80..e92355ba6 100644 --- a/app/src/main/kotlin/org/fossify/phone/helpers/Constants.kt +++ b/app/src/main/kotlin/org/fossify/phone/helpers/Constants.kt @@ -27,5 +27,6 @@ val tabsList = arrayListOf(TAB_CONTACTS, TAB_FAVORITES, TAB_CALL_HISTORY) private const val PATH = "org.fossify.phone.action." const val ACCEPT_CALL = PATH + "ACCEPT_CALL" const val DECLINE_CALL = PATH + "DECLINE_CALL" +const val ANSWER_SPEAKER_CALL = PATH + "ANSWER_SPEAKER_CALL" const val DIALPAD_TONE_LENGTH_MS = 150L // The length of DTMF tones in milliseconds From 932eb92bb8985f3eb16d36c3afe644236e04a2a3 Mon Sep 17 00:00:00 2001 From: Bionic-dev715 Date: Wed, 21 Jan 2026 19:56:21 +0530 Subject: [PATCH 5/9] Update CallNotificationManager.kt --- .../phone/helpers/CallNotificationManager.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/kotlin/org/fossify/phone/helpers/CallNotificationManager.kt b/app/src/main/kotlin/org/fossify/phone/helpers/CallNotificationManager.kt index 90b527e9e..fb5a335c9 100644 --- a/app/src/main/kotlin/org/fossify/phone/helpers/CallNotificationManager.kt +++ b/app/src/main/kotlin/org/fossify/phone/helpers/CallNotificationManager.kt @@ -22,6 +22,7 @@ class CallNotificationManager(private val context: Context) { private const val CALL_NOTIFICATION_ID = 42 private const val ACCEPT_CALL_CODE = 0 private const val DECLINE_CALL_CODE = 1 + private const val ANSWER_SPEAKER_CALL_CODE = 2 } private val notificationManager = context.notificationManager @@ -61,6 +62,16 @@ class CallNotificationManager(private val context: Context) { PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_MUTABLE ) + val answerSpeakerIntent = Intent(context, CallActionReceiver::class.java) + answerSpeakerIntent.action = ANSWER_SPEAKER_CALL + val answerSpeakerPendingIntent = + PendingIntent.getBroadcast( + context, + ANSWER_SPEAKER_CALL_CODE, + answerSpeakerIntent, + PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_MUTABLE + ) + var callerName = callContact.name.ifEmpty { context.getString(R.string.unknown_caller) } if (callContact.numberLabel.isNotEmpty()) { callerName += " - ${callContact.numberLabel}" @@ -78,9 +89,11 @@ class CallNotificationManager(private val context: Context) { setText(R.id.notification_caller_name, callerName) setText(R.id.notification_call_status, context.getString(contentTextId)) setVisibleIf(R.id.notification_accept_call, callState == Call.STATE_RINGING) + setVisibleIf(R.id.notification_answer_speaker, callState == Call.STATE_RINGING) setOnClickPendingIntent(R.id.notification_decline_call, declinePendingIntent) setOnClickPendingIntent(R.id.notification_accept_call, acceptPendingIntent) + setOnClickPendingIntent(R.id.notification_answer_speaker, answerSpeakerPendingIntent) if (callContactAvatar != null) { setImageViewBitmap( From c482140fa71e78cfd548f15ed75b49bcbfe52e42 Mon Sep 17 00:00:00 2001 From: Bionic-dev715 Date: Wed, 21 Jan 2026 19:57:50 +0530 Subject: [PATCH 6/9] Update CallActionReceiver.kt --- .../org/fossify/phone/receivers/CallActionReceiver.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/kotlin/org/fossify/phone/receivers/CallActionReceiver.kt b/app/src/main/kotlin/org/fossify/phone/receivers/CallActionReceiver.kt index a826b7856..9cea888f6 100644 --- a/app/src/main/kotlin/org/fossify/phone/receivers/CallActionReceiver.kt +++ b/app/src/main/kotlin/org/fossify/phone/receivers/CallActionReceiver.kt @@ -3,8 +3,10 @@ package org.fossify.phone.receivers import android.content.BroadcastReceiver import android.content.Context import android.content.Intent +import android.telecom.CallAudioState import org.fossify.phone.activities.CallActivity import org.fossify.phone.helpers.ACCEPT_CALL +import org.fossify.phone.helpers.ANSWER_SPEAKER_CALL import org.fossify.phone.helpers.CallManager import org.fossify.phone.helpers.DECLINE_CALL @@ -16,6 +18,11 @@ class CallActionReceiver : BroadcastReceiver() { CallManager.accept() } + ANSWER_SPEAKER_CALL -> { + CallManager.accept() + CallManager.setAudioRoute(CallAudioState.ROUTE_SPEAKER) + } + DECLINE_CALL -> CallManager.reject() } } From 8d4e76bc17816f1b42ad548481bc0bcf80ed19fa Mon Sep 17 00:00:00 2001 From: Bionic-dev715 Date: Wed, 21 Jan 2026 20:00:50 +0530 Subject: [PATCH 7/9] Update call_notification.xml --- app/src/main/res/layout/call_notification.xml | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/layout/call_notification.xml b/app/src/main/res/layout/call_notification.xml index b75682142..ef7ed053b 100644 --- a/app/src/main/res/layout/call_notification.xml +++ b/app/src/main/res/layout/call_notification.xml @@ -42,21 +42,35 @@ + android:src="@drawable/ic_phone_down_red_vector" + android:tint="@android:color/white" /> + + + android:src="@drawable/ic_phone_green_vector" + android:tint="@android:color/white" /> From fbbba741b57261dfcfeff833909bec67f12256cb Mon Sep 17 00:00:00 2001 From: Bionic-dev715 Date: Wed, 21 Jan 2026 20:40:23 +0530 Subject: [PATCH 8/9] Update call_notification.xml --- app/src/main/res/layout/call_notification.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/layout/call_notification.xml b/app/src/main/res/layout/call_notification.xml index ef7ed053b..2bc862c2e 100644 --- a/app/src/main/res/layout/call_notification.xml +++ b/app/src/main/res/layout/call_notification.xml @@ -49,7 +49,7 @@ android:background="@drawable/bg_notification_decline" android:padding="@dimen/small_margin" android:src="@drawable/ic_phone_down_red_vector" - android:tint="@android:color/white" /> + app:tint="@android:color/white" /> + app:tint="@android:color/white" /> + app:tint="@android:color/white" /> From 61e45304df052952e9317f570d0f869f34915d0b Mon Sep 17 00:00:00 2001 From: Bionic-dev715 Date: Wed, 21 Jan 2026 20:45:35 +0530 Subject: [PATCH 9/9] Update call_notification.xml --- app/src/main/res/layout/call_notification.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/layout/call_notification.xml b/app/src/main/res/layout/call_notification.xml index 2bc862c2e..ef7ed053b 100644 --- a/app/src/main/res/layout/call_notification.xml +++ b/app/src/main/res/layout/call_notification.xml @@ -49,7 +49,7 @@ android:background="@drawable/bg_notification_decline" android:padding="@dimen/small_margin" android:src="@drawable/ic_phone_down_red_vector" - app:tint="@android:color/white" /> + android:tint="@android:color/white" /> + android:tint="@android:color/white" /> + android:tint="@android:color/white" />