1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-25 01:55:50 +01:00

Garmin: Improve logging if notification picture is not found

This commit is contained in:
José Rebelo 2024-11-26 21:27:43 +00:00
parent fab6a7bc7f
commit ee8eeaf16f
3 changed files with 7 additions and 2 deletions

View File

@ -240,7 +240,12 @@ public class GarminSupport extends AbstractBTLEDeviceSupport implements ICommuni
}
protected Bitmap getNotificationAttachmentBitmap(int notificationId) {
return BitmapFactory.decodeFile(getNotificationAttachmentPath(notificationId));
final String picturePath = getNotificationAttachmentPath(notificationId);
final Bitmap bitmap = BitmapFactory.decodeFile(picturePath);
if (bitmap == null) {
LOG.warn("Failed to load bitmap for {} from {}", notificationId, picturePath);
}
return bitmap;
}
@Override

View File

@ -135,6 +135,7 @@ public class NotificationsHandler implements MessageHandler {
return e;
}
}
LOG.warn("Failed to find notificationSpec in queue for {}", id);
return null;
}

View File

@ -370,7 +370,6 @@ public class ProtocolBufferHandler implements MessageHandler {
final int notificationId = pictureRequest.getNotificationId();
final Bitmap bmp = deviceSupport.getNotificationAttachmentBitmap(notificationId);
if (bmp == null) {
LOG.warn("Failed to find bitmap for notification id {}", notificationId);
return null;
}