mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Garmin: Fix NPE on call with privacy mode on
This commit is contained in:
parent
3a778a9f2a
commit
2212b244e6
@ -76,8 +76,9 @@ public class NotificationsHandler implements MessageHandler {
|
||||
public NotificationUpdateMessage onSetCallState(CallSpec callSpec) {
|
||||
if (!enabled)
|
||||
return null;
|
||||
final int id = StringUtils.firstNonBlank(callSpec.number, "Gadgetbridge Call").hashCode();
|
||||
if (callSpec.command == CallSpec.CALL_INCOMING) {
|
||||
NotificationSpec callNotificationSpec = new NotificationSpec(callSpec.number.hashCode());
|
||||
NotificationSpec callNotificationSpec = new NotificationSpec(id);
|
||||
callNotificationSpec.phoneNumber = callSpec.number;
|
||||
callNotificationSpec.sourceAppId = callSpec.sourceAppId;
|
||||
callNotificationSpec.title = StringUtils.isEmpty(callSpec.name) ? callSpec.number : callSpec.name;
|
||||
@ -91,10 +92,8 @@ public class NotificationsHandler implements MessageHandler {
|
||||
|
||||
return onNotification(callNotificationSpec);
|
||||
} else {
|
||||
if (callSpec.number != null) // this happens in debug screen
|
||||
return onDeleteNotification(callSpec.number.hashCode());
|
||||
return onDeleteNotification(id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public NotificationUpdateMessage onNotification(NotificationSpec notificationSpec) {
|
||||
|
Loading…
Reference in New Issue
Block a user