1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-04 09:17:29 +01:00

SMS: add reply action in generic code (no longer explicitly handled in PebbleProtocol)

This commit is contained in:
Andreas Shimokawa 2018-11-01 16:58:20 +01:00
parent f05cc83848
commit e54f1eaccc

View File

@ -26,6 +26,7 @@ import android.os.Bundle;
import android.os.PowerManager;
import android.telephony.SmsMessage;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;
@ -72,6 +73,12 @@ public class SMSReceiver extends BroadcastReceiver {
if (originatingAddress != null) {
notificationSpec.body = entry.getValue().toString();
notificationSpec.phoneNumber = originatingAddress;
notificationSpec.attachedActions = new ArrayList<>();
NotificationSpec.Action replyAction = new NotificationSpec.Action();
replyAction.title = "Reply";
replyAction.isReply = true;
notificationSpec.attachedActions.add(replyAction);
switch (GBApplication.getGrantedInterruptionFilter()) {
case NotificationManager.INTERRUPTION_FILTER_ALL:
break;