use of nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification.NewAlert in project Gadgetbridge by Freeyourgadget.
the class Mi2TextNotificationStrategy method sendAlert.
protected void sendAlert(@NonNull SimpleNotification simpleNotification, TransactionBuilder builder) {
AlertNotificationProfile<?> profile = new AlertNotificationProfile<>(getSupport());
// override the alert category, since only SMS and incoming call support text notification
AlertCategory category = AlertCategory.SMS;
if (simpleNotification.getAlertCategory() == AlertCategory.IncomingCall) {
category = simpleNotification.getAlertCategory();
}
NewAlert alert = new NewAlert(category, 1, simpleNotification.getMessage());
profile.newAlert(builder, alert, OverflowStrategy.MAKE_MULTIPLE);
}
use of nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification.NewAlert in project Gadgetbridge by Freeyourgadget.
the class MiBand2Support method onTestNewFunction.
@Override
public void onTestNewFunction() {
try {
TransactionBuilder builder = performInitialized("incoming call from peter");
NewAlert alert = new NewAlert(AlertCategory.Custom, 1, new String(new byte[] { 0x19 }));
AlertNotificationProfile<MiBand2Support> profile = new AlertNotificationProfile<>(this);
profile.newAlert(builder, alert, OverflowStrategy.MAKE_MULTIPLE);
builder.queue(getQueue());
} catch (IOException e) {
}
}
Aggregations