2020-01-09 10:44:32 +01:00
|
|
|
/* Copyright (C) 2015-2020 Andreas Shimokawa, Daniele Gobbetti, Frank Slezak
|
2017-03-10 14:53:19 +01:00
|
|
|
|
|
|
|
This file is part of Gadgetbridge.
|
|
|
|
|
|
|
|
Gadgetbridge is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Gadgetbridge is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2015-09-24 14:45:21 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.model;
|
|
|
|
|
2018-10-31 21:47:12 +01:00
|
|
|
import java.io.Serializable;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
2015-09-24 14:45:21 +02:00
|
|
|
public class NotificationSpec {
|
2016-01-09 17:54:17 +01:00
|
|
|
public int flags;
|
2018-10-31 21:47:12 +01:00
|
|
|
private static final AtomicInteger c = new AtomicInteger((int) (System.currentTimeMillis()/1000));
|
|
|
|
private int id;
|
2015-09-24 14:45:21 +02:00
|
|
|
public String sender;
|
|
|
|
public String phoneNumber;
|
|
|
|
public String title;
|
|
|
|
public String subject;
|
|
|
|
public String body;
|
|
|
|
public NotificationType type;
|
|
|
|
public String sourceName;
|
2015-12-13 12:03:57 +01:00
|
|
|
public String[] cannedReplies;
|
2018-10-31 21:47:12 +01:00
|
|
|
/**
|
|
|
|
* Wearable actions that were attached to the incoming notifications and will be passed to the gadget (includes the "reply" action)
|
|
|
|
*/
|
|
|
|
public ArrayList<Action> attachedActions;
|
2017-09-19 13:24:31 +02:00
|
|
|
/**
|
|
|
|
* The application that generated the notification.
|
|
|
|
*/
|
|
|
|
public String sourceAppId;
|
2021-04-20 09:55:27 +02:00
|
|
|
/**
|
|
|
|
* The notification's icon ID
|
|
|
|
*/
|
|
|
|
public int iconId;
|
2017-09-19 13:24:31 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The color that should be assigned to this notification when displayed on a Pebble
|
|
|
|
*/
|
|
|
|
public byte pebbleColor;
|
2018-10-31 21:47:12 +01:00
|
|
|
|
2021-11-19 15:09:27 +01:00
|
|
|
public int dndSuppressed;
|
|
|
|
|
2018-10-31 21:47:12 +01:00
|
|
|
public NotificationSpec() {
|
|
|
|
this.id = c.incrementAndGet();
|
|
|
|
}
|
|
|
|
|
|
|
|
public NotificationSpec(int id) {
|
|
|
|
if (id != -1)
|
|
|
|
this.id = id;
|
|
|
|
else
|
|
|
|
this.id = c.incrementAndGet();
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class Action implements Serializable {
|
2018-11-15 15:53:04 +01:00
|
|
|
static final int TYPE_UNDEFINED = -1;
|
|
|
|
public static final int TYPE_WEARABLE_SIMPLE = 0;
|
|
|
|
public static final int TYPE_WEARABLE_REPLY = 1;
|
|
|
|
public static final int TYPE_SYNTECTIC_REPLY_PHONENR = 2;
|
|
|
|
public static final int TYPE_SYNTECTIC_DISMISS = 3;
|
|
|
|
public static final int TYPE_SYNTECTIC_DISMISS_ALL = 4;
|
|
|
|
public static final int TYPE_SYNTECTIC_MUTE = 5;
|
|
|
|
public static final int TYPE_SYNTECTIC_OPEN = 6;
|
|
|
|
|
|
|
|
public int type = TYPE_UNDEFINED;
|
|
|
|
public long handle;
|
2018-10-31 21:47:12 +01:00
|
|
|
public String title;
|
|
|
|
}
|
2015-09-24 14:45:21 +02:00
|
|
|
}
|