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

PineTime: Display app name for VoIP app calls

This commit is contained in:
Davis Mosenkovs 2023-10-08 22:07:52 +03:00 committed by José Rebelo
parent 5d15df0751
commit c4bc43d918

View File

@ -406,7 +406,14 @@ public class PineTimeJFSupport extends AbstractBTLEDeviceSupport implements DfuL
public void onSetCallState(CallSpec callSpec) { public void onSetCallState(CallSpec callSpec) {
if (callSpec.command == CallSpec.CALL_INCOMING) { if (callSpec.command == CallSpec.CALL_INCOMING) {
TransactionBuilder builder = new TransactionBuilder("incomingcall"); TransactionBuilder builder = new TransactionBuilder("incomingcall");
String message = (byte) 0x01 + callSpec.name;
String message;
if (isFirmwareAtLeastVersion0_15() && callSpec.sourceName != null) {
message = (byte) 0x01 + callSpec.sourceName + "\0" + callSpec.name;
} else {
message = (byte) 0x01 + callSpec.name;
}
NewAlert alert = new NewAlert(AlertCategory.IncomingCall, 1, message); NewAlert alert = new NewAlert(AlertCategory.IncomingCall, 1, message);
AlertNotificationProfile<?> profile = new AlertNotificationProfile<>(this); AlertNotificationProfile<?> profile = new AlertNotificationProfile<>(this);
profile.setMaxLength(MaxNotificationLength); profile.setMaxLength(MaxNotificationLength);