disable default notification sounds for incoming calls

This commit is contained in:
tibbi
2018-11-26 10:54:52 +01:00
parent 6bf34e3a84
commit 772a28eb9e

View File

@ -58,6 +58,7 @@ class DialerCallService : Service() {
NotificationChannel(channelId, name, importance).apply { NotificationChannel(channelId, name, importance).apply {
enableLights(false) enableLights(false)
enableVibration(false) enableVibration(false)
setSound(null, null)
notificationManager.createNotificationChannel(this) notificationManager.createNotificationChannel(this)
} }
} }
@ -71,6 +72,7 @@ class DialerCallService : Service() {
.setPriority(NotificationCompat.PRIORITY_MAX) .setPriority(NotificationCompat.PRIORITY_MAX)
.setOngoing(true) .setOngoing(true)
.setChannelId(channelId) .setChannelId(channelId)
.setSound(null)
.setUsesChronometer(callStatus == Call.STATE_ACTIVE) .setUsesChronometer(callStatus == Call.STATE_ACTIVE)
.addAction(0, getString(R.string.decline_call), getDeclineCallIntent()) .addAction(0, getString(R.string.decline_call), getDeclineCallIntent())
.addAction(0, getString(R.string.answer_call), getAnswerCallIntent()) .addAction(0, getString(R.string.answer_call), getAnswerCallIntent())