use of nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification.AlertNotificationProfile in project Gadgetbridge by Freeyourgadget.
the class PineTimeJFSupport method onSetCallState.
@Override
public void onSetCallState(CallSpec callSpec) {
if (callSpec.command == CallSpec.CALL_INCOMING) {
TransactionBuilder builder = new TransactionBuilder("incomingcall");
String message = (byte) 0x01 + callSpec.name;
NewAlert alert = new NewAlert(AlertCategory.IncomingCall, 1, message);
AlertNotificationProfile<?> profile = new AlertNotificationProfile<>(this);
profile.setMaxLength(MaxNotificationLength);
profile.newAlert(builder, alert, OverflowStrategy.TRUNCATE);
builder.queue(getQueue());
}
}
use of nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.alertnotification.AlertNotificationProfile 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);
}
Aggregations