|
@@ -43,6 +43,7 @@ class OngoingNotification {
|
43
|
43
|
private static final String CHANNEL_NAME = "Ongoing Conference Notifications";
|
44
|
44
|
|
45
|
45
|
static final int NOTIFICATION_ID = new Random().nextInt(99999) + 10000;
|
|
46
|
+ private static long startingTime = 0;
|
46
|
47
|
|
47
|
48
|
static void createOngoingConferenceNotificationChannel() {
|
48
|
49
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
|
@@ -85,6 +86,10 @@ class OngoingNotification {
|
85
|
86
|
|
86
|
87
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_ID);
|
87
|
88
|
|
|
89
|
+ if (startingTime == 0) {
|
|
90
|
+ startingTime = System.currentTimeMillis();
|
|
91
|
+ }
|
|
92
|
+
|
88
|
93
|
builder
|
89
|
94
|
.setCategory(NotificationCompat.CATEGORY_CALL)
|
90
|
95
|
.setContentTitle(context.getString(R.string.ongoing_notification_title))
|
|
@@ -92,6 +97,8 @@ class OngoingNotification {
|
92
|
97
|
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
|
93
|
98
|
.setContentIntent(pendingIntent)
|
94
|
99
|
.setOngoing(true)
|
|
100
|
+ .setWhen(startingTime)
|
|
101
|
+ .setUsesChronometer(true)
|
95
|
102
|
.setAutoCancel(false)
|
96
|
103
|
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
|
97
|
104
|
.setOnlyAlertOnce(true)
|
|
@@ -110,6 +117,10 @@ class OngoingNotification {
|
110
|
117
|
return builder.build();
|
111
|
118
|
}
|
112
|
119
|
|
|
120
|
+ static void resetStartingtime() {
|
|
121
|
+ startingTime = 0;
|
|
122
|
+ }
|
|
123
|
+
|
113
|
124
|
private static NotificationCompat.Action createAction(Context context, JitsiMeetOngoingConferenceService.Action action, @StringRes int titleId) {
|
114
|
125
|
Intent intent = new Intent(context, JitsiMeetOngoingConferenceService.class);
|
115
|
126
|
intent.setAction(action.getName());
|