From 5a3491a4bbc9f558bd0871ec7bb1c49a2c508c7e Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Tue, 21 Aug 2018 09:29:27 +0200 Subject: [PATCH] Add time to all notification --- .../org/linphone/compatibility/ApiTwentyOnePlus.java | 5 +++++ .../org/linphone/compatibility/ApiTwentySixPlus.java | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/android/org/linphone/compatibility/ApiTwentyOnePlus.java b/src/android/org/linphone/compatibility/ApiTwentyOnePlus.java index 8215d4e0d..7197dbbba 100644 --- a/src/android/org/linphone/compatibility/ApiTwentyOnePlus.java +++ b/src/android/org/linphone/compatibility/ApiTwentyOnePlus.java @@ -59,6 +59,7 @@ public class ApiTwentyOnePlus { .setVisibility(Notification.VISIBILITY_PRIVATE) .setPriority(Notification.PRIORITY_HIGH) .setNumber(msgCount) + .setWhen(System.currentTimeMillis()) .build(); return notif; @@ -100,6 +101,7 @@ public class ApiTwentyOnePlus { .setLights(ContextCompat.getColor(context, R.color.notification_color_led), context.getResources().getInteger(R.integer.notification_ms_on), context.getResources().getInteger(R.integer.notification_ms_off)) + .setWhen(System.currentTimeMillis()) .setPriority(priority) .build(); } else { @@ -114,6 +116,7 @@ public class ApiTwentyOnePlus { context.getResources().getInteger(R.integer.notification_ms_on), context.getResources().getInteger(R.integer.notification_ms_off)) .setPriority(priority) + .setWhen(System.currentTimeMillis()) .build(); } @@ -139,6 +142,7 @@ public class ApiTwentyOnePlus { context.getResources().getInteger(R.integer.notification_ms_on), context.getResources().getInteger(R.integer.notification_ms_off)) .setPriority(Notification.PRIORITY_HIGH) + .setWhen(System.currentTimeMillis()) .build(); return notif; @@ -158,6 +162,7 @@ public class ApiTwentyOnePlus { .setLights(ContextCompat.getColor(context, R.color.notification_color_led), context.getResources().getInteger(R.integer.notification_ms_on), context.getResources().getInteger(R.integer.notification_ms_off)) + .setWhen(System.currentTimeMillis()) .setPriority(Notification.PRIORITY_HIGH) .build(); diff --git a/src/android/org/linphone/compatibility/ApiTwentySixPlus.java b/src/android/org/linphone/compatibility/ApiTwentySixPlus.java index 0ed80b882..6c88ce9cd 100644 --- a/src/android/org/linphone/compatibility/ApiTwentySixPlus.java +++ b/src/android/org/linphone/compatibility/ApiTwentySixPlus.java @@ -87,6 +87,7 @@ public class ApiTwentySixPlus { .setVisibility(Notification.VISIBILITY_PRIVATE) .setPriority(Notification.PRIORITY_HIGH) .setNumber(msgCount) + .setWhen(System.currentTimeMillis()) .build(); return notif; @@ -106,6 +107,7 @@ public class ApiTwentySixPlus { .setCategory(Notification.CATEGORY_CALL) .setVisibility(Notification.VISIBILITY_PUBLIC) .setPriority(Notification.PRIORITY_HIGH) + .setWhen(System.currentTimeMillis()) .build(); return notif; @@ -124,6 +126,7 @@ public class ApiTwentySixPlus { .setCategory(Notification.CATEGORY_SERVICE) .setVisibility(Notification.VISIBILITY_SECRET) .setPriority(priority) + .setWhen(System.currentTimeMillis()) .build(); } else { notif = new Notification.Builder(context, context.getString(R.string.notification_service_channel_id)) @@ -134,6 +137,7 @@ public class ApiTwentySixPlus { .setCategory(Notification.CATEGORY_SERVICE) .setVisibility(Notification.VISIBILITY_SECRET) .setPriority(priority) + .setWhen(System.currentTimeMillis()) .build(); } @@ -156,6 +160,7 @@ public class ApiTwentySixPlus { .setCategory(Notification.CATEGORY_MESSAGE) .setVisibility(Notification.VISIBILITY_PRIVATE) .setPriority(Notification.PRIORITY_HIGH) + .setWhen(System.currentTimeMillis()) .build(); return notif; @@ -173,6 +178,7 @@ public class ApiTwentySixPlus { .setCategory(Notification.CATEGORY_MESSAGE) .setVisibility(Notification.VISIBILITY_PRIVATE) .setPriority(Notification.PRIORITY_HIGH) + .setWhen(System.currentTimeMillis()) .build(); return notif;