mirror of
https://gitlab.com/xynngh/YetAnotherCallBlocker.git
synced 2025-02-17 04:10:36 +01:00
Fix incoming call notifications not being removed on some devices
This commit is contained in:
parent
930372f488
commit
29e43fec3c
@ -73,7 +73,7 @@ public class CallReceiver extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
} else if(TelephonyManager.EXTRA_STATE_IDLE.equals(telephonyExtraState)) {
|
} else if(TelephonyManager.EXTRA_STATE_IDLE.equals(telephonyExtraState)) {
|
||||||
isOnCall = false;
|
isOnCall = false;
|
||||||
NotificationHelper.hideIncomingCallNotification(context, incomingNumber);
|
NotificationHelper.hideIncomingCallNotification(context);
|
||||||
postEvent(new CallEndedEvent());
|
postEvent(new CallEndedEvent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,13 +54,12 @@ public class NotificationHelper {
|
|||||||
public static void showIncomingCallNotification(Context context, NumberInfo numberInfo) {
|
public static void showIncomingCallNotification(Context context, NumberInfo numberInfo) {
|
||||||
Notification notification = createIncomingCallNotification(context, numberInfo);
|
Notification notification = createIncomingCallNotification(context, numberInfo);
|
||||||
|
|
||||||
String tag = numberInfo.number != null ? NOTIFICATION_TAG_INCOMING_CALL + numberInfo.number : null;
|
notify(context, NOTIFICATION_TAG_INCOMING_CALL, NOTIFICATION_ID_INCOMING_CALL, notification);
|
||||||
notify(context, tag, NOTIFICATION_ID_INCOMING_CALL, notification);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void hideIncomingCallNotification(Context context, String number) {
|
public static void hideIncomingCallNotification(Context context) {
|
||||||
String tag = number != null ? NOTIFICATION_TAG_INCOMING_CALL + number : null;
|
NotificationManagerCompat.from(context)
|
||||||
NotificationManagerCompat.from(context).cancel(tag, NOTIFICATION_ID_INCOMING_CALL);
|
.cancel(NOTIFICATION_TAG_INCOMING_CALL, NOTIFICATION_ID_INCOMING_CALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showBlockedCallNotification(Context context, NumberInfo numberInfo) {
|
public static void showBlockedCallNotification(Context context, NumberInfo numberInfo) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user