mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Disable CallStyle notifications (Android 12+) for samsung devices, they are currently badly displayed
This commit is contained in:
parent
c9d1159ebd
commit
11c70b8bea
1 changed files with 9 additions and 3 deletions
|
|
@ -189,9 +189,12 @@ class Compatibility {
|
|||
pendingIntent: PendingIntent,
|
||||
notificationsManager: NotificationsManager
|
||||
): Notification {
|
||||
if (Version.sdkAboveOrEqual(Version.API31_ANDROID_12)) {
|
||||
val manufacturer = Build.MANUFACTURER.lowercase(Locale.getDefault())
|
||||
// Samsung One UI 4.0 (API 31) doesn't (currently) display CallStyle notifications well
|
||||
// Tested on Samsung S10 and Z Fold 2
|
||||
if (Version.sdkAboveOrEqual(Version.API31_ANDROID_12) && manufacturer != "samsung") {
|
||||
return Api31Compatibility.createIncomingCallNotification(context, call, notifiable, pendingIntent, notificationsManager)
|
||||
} else if (Build.MANUFACTURER.lowercase(Locale.getDefault()) == "xiaomi") {
|
||||
} else if (manufacturer == "xiaomi") { // Xiaomi devices don't handle CustomHeadsUpContentView correctly
|
||||
return XiaomiCompatibility.createIncomingCallNotification(context, call, notifiable, pendingIntent, notificationsManager)
|
||||
}
|
||||
return Api26Compatibility.createIncomingCallNotification(context, call, notifiable, pendingIntent, notificationsManager)
|
||||
|
|
@ -205,7 +208,10 @@ class Compatibility {
|
|||
channel: String,
|
||||
notificationsManager: NotificationsManager
|
||||
): Notification {
|
||||
if (Version.sdkAboveOrEqual(Version.API31_ANDROID_12)) {
|
||||
val manufacturer = Build.MANUFACTURER.lowercase(Locale.getDefault())
|
||||
// Samsung One UI 4.0 (API 31) doesn't (currently) display CallStyle notifications well
|
||||
// Tested on Samsung S10 and Z Fold 2
|
||||
if (Version.sdkAboveOrEqual(Version.API31_ANDROID_12) && manufacturer != "samsung") {
|
||||
return Api31Compatibility.createCallNotification(context, call, notifiable, pendingIntent, channel, notificationsManager)
|
||||
}
|
||||
return Api26Compatibility.createCallNotification(context, call, notifiable, pendingIntent, channel, notificationsManager)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue