mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 08:09:12 +01:00
Fix crash for incoming calls when running in private spaces.
This commit is contained in:
committed by
jeffrey-signal
parent
f271c85aef
commit
da2eb02cde
@@ -89,9 +89,14 @@ public final class DoNotDisturbUtil {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
final NotificationManager.Policy policy = notificationManager.getNotificationPolicy();
|
final NotificationManager.Policy policy = notificationManager.getNotificationPolicy();
|
||||||
final boolean areCallsPrioritized = (policy.priorityCategories & NotificationManager.Policy.PRIORITY_CATEGORY_CALLS) != 0;
|
if (policy == null) {
|
||||||
final boolean isRepeatCallerEnabled = (policy.priorityCategories & NotificationManager.Policy.PRIORITY_CATEGORY_REPEAT_CALLERS) != 0;
|
Log.w(TAG, "Notification policy is null, likely in a private space. Allowing call to disturb user.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
final boolean areCallsPrioritized = (policy.priorityCategories & NotificationManager.Policy.PRIORITY_CATEGORY_CALLS) != 0;
|
||||||
|
final boolean isRepeatCallerEnabled = (policy.priorityCategories & NotificationManager.Policy.PRIORITY_CATEGORY_REPEAT_CALLERS) != 0;
|
||||||
|
|
||||||
if (!areCallsPrioritized && !isRepeatCallerEnabled) {
|
if (!areCallsPrioritized && !isRepeatCallerEnabled) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user