From df31e7e436822593e772cbb33363aa201ed7edad Mon Sep 17 00:00:00 2001 From: Andrea Scarpino <andrea@scarpino.dev> Date: Thu, 21 Nov 2019 15:36:08 +0100 Subject: [PATCH] Hide sensitive data from lock screen notifications Hide info about: - received messages - missed calls - contact requests - file requests Gitlab: #527 Change-Id: I5c12924cd5b8568795e21d4c5adff328578fa418 --- .../java/cx/ring/services/NotificationServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ring-android/app/src/main/java/cx/ring/services/NotificationServiceImpl.java b/ring-android/app/src/main/java/cx/ring/services/NotificationServiceImpl.java index cd1de904c..e5c67e37e 100644 --- a/ring-android/app/src/main/java/cx/ring/services/NotificationServiceImpl.java +++ b/ring-android/app/src/main/java/cx/ring/services/NotificationServiceImpl.java @@ -159,7 +159,7 @@ public class NotificationServiceImpl implements NotificationService { // Missed calls channel NotificationChannel missedCallsChannel = new NotificationChannel(NOTIF_CHANNEL_MISSED_CALL, mContext.getString(R.string.notif_channel_missed_calls), NotificationManager.IMPORTANCE_DEFAULT); - missedCallsChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC); + missedCallsChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET); missedCallsChannel.setSound(null, null); missedCallsChannel.enableVibration(false); missedCallsChannel.setGroup(NOTIF_CALL_GROUP); @@ -189,21 +189,21 @@ public class NotificationServiceImpl implements NotificationService { NotificationChannel messageChannel = new NotificationChannel(NOTIF_CHANNEL_MESSAGE, mContext.getString(R.string.notif_channel_messages), NotificationManager.IMPORTANCE_HIGH); messageChannel.enableVibration(true); - messageChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC); + messageChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET); messageChannel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), soundAttributes); notificationManager.createNotificationChannel(messageChannel); // Contact requests NotificationChannel requestsChannel = new NotificationChannel(NOTIF_CHANNEL_REQUEST, mContext.getString(R.string.notif_channel_requests), NotificationManager.IMPORTANCE_DEFAULT); requestsChannel.enableVibration(true); - requestsChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC); + requestsChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET); requestsChannel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), soundAttributes); notificationManager.createNotificationChannel(requestsChannel); // File transfer requests NotificationChannel fileTransferChannel = new NotificationChannel(NOTIF_CHANNEL_FILE_TRANSFER, mContext.getString(R.string.notif_channel_file_transfer), NotificationManager.IMPORTANCE_DEFAULT); fileTransferChannel.enableVibration(true); - fileTransferChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC); + fileTransferChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET); fileTransferChannel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), soundAttributes); notificationManager.createNotificationChannel(fileTransferChannel); -- GitLab