1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-03 23:42:57 +01:00

Amazfit Bip S: Allow longer notification message

This commit is contained in:
Zhong Jianxin 2020-06-15 16:45:39 +08:00
parent 5ce44a4575
commit c3a9cf858e
2 changed files with 5 additions and 3 deletions

View File

@ -609,6 +609,9 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
This works on all Huami devices except Mi Band 2 This works on all Huami devices except Mi Band 2
*/ */
protected void sendNotificationNew(NotificationSpec notificationSpec, boolean hasExtraHeader) { protected void sendNotificationNew(NotificationSpec notificationSpec, boolean hasExtraHeader) {
sendNotificationNew(notificationSpec, hasExtraHeader, 230);
}
protected void sendNotificationNew(NotificationSpec notificationSpec, boolean hasExtraHeader, int maxLength) {
if (notificationSpec.type == NotificationType.GENERIC_ALARM_CLOCK) { if (notificationSpec.type == NotificationType.GENERIC_ALARM_CLOCK) {
onAlarmClock(notificationSpec); onAlarmClock(notificationSpec);
return; return;
@ -621,7 +624,7 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
message += StringUtils.truncate(notificationSpec.subject, 128) + "\n\n"; message += StringUtils.truncate(notificationSpec.subject, 128) + "\n\n";
} }
if (notificationSpec.body != null) { if (notificationSpec.body != null) {
message += StringUtils.truncate(notificationSpec.body, 128); message += StringUtils.truncate(notificationSpec.body, 512);
} }
try { try {
@ -639,7 +642,6 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport {
alertCategory = AlertCategory.Email; alertCategory = AlertCategory.Email;
} }
int maxLength = 230;
if (characteristicChunked != null) { if (characteristicChunked != null) {
int prefixlength = 2; int prefixlength = 2;

View File

@ -55,7 +55,7 @@ public class AmazfitBipSSupport extends AmazfitBipSupport {
@Override @Override
public void onNotification(NotificationSpec notificationSpec) { public void onNotification(NotificationSpec notificationSpec) {
super.sendNotificationNew(notificationSpec, true); super.sendNotificationNew(notificationSpec, true, 512);
} }
@Override @Override