Skip to content
Snippets Groups Projects
Commit df31e7e4 authored by Andrea Scarpino's avatar Andrea Scarpino
Browse files

Hide sensitive data from lock screen notifications

Hide info about:
- received messages
- missed calls
- contact requests
- file requests

Gitlab: #527

Change-Id: I5c12924cd5b8568795e21d4c5adff328578fa418
parent 646ba085
No related branches found
No related tags found
No related merge requests found
...@@ -159,7 +159,7 @@ public class NotificationServiceImpl implements NotificationService { ...@@ -159,7 +159,7 @@ public class NotificationServiceImpl implements NotificationService {
// Missed calls channel // Missed calls channel
NotificationChannel missedCallsChannel = new NotificationChannel(NOTIF_CHANNEL_MISSED_CALL, mContext.getString(R.string.notif_channel_missed_calls), NotificationManager.IMPORTANCE_DEFAULT); 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.setSound(null, null);
missedCallsChannel.enableVibration(false); missedCallsChannel.enableVibration(false);
missedCallsChannel.setGroup(NOTIF_CALL_GROUP); missedCallsChannel.setGroup(NOTIF_CALL_GROUP);
...@@ -189,21 +189,21 @@ public class NotificationServiceImpl implements NotificationService { ...@@ -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); NotificationChannel messageChannel = new NotificationChannel(NOTIF_CHANNEL_MESSAGE, mContext.getString(R.string.notif_channel_messages), NotificationManager.IMPORTANCE_HIGH);
messageChannel.enableVibration(true); messageChannel.enableVibration(true);
messageChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC); messageChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
messageChannel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), soundAttributes); messageChannel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), soundAttributes);
notificationManager.createNotificationChannel(messageChannel); notificationManager.createNotificationChannel(messageChannel);
// Contact requests // Contact requests
NotificationChannel requestsChannel = new NotificationChannel(NOTIF_CHANNEL_REQUEST, mContext.getString(R.string.notif_channel_requests), NotificationManager.IMPORTANCE_DEFAULT); NotificationChannel requestsChannel = new NotificationChannel(NOTIF_CHANNEL_REQUEST, mContext.getString(R.string.notif_channel_requests), NotificationManager.IMPORTANCE_DEFAULT);
requestsChannel.enableVibration(true); requestsChannel.enableVibration(true);
requestsChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC); requestsChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
requestsChannel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), soundAttributes); requestsChannel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), soundAttributes);
notificationManager.createNotificationChannel(requestsChannel); notificationManager.createNotificationChannel(requestsChannel);
// File transfer requests // File transfer requests
NotificationChannel fileTransferChannel = new NotificationChannel(NOTIF_CHANNEL_FILE_TRANSFER, mContext.getString(R.string.notif_channel_file_transfer), NotificationManager.IMPORTANCE_DEFAULT); NotificationChannel fileTransferChannel = new NotificationChannel(NOTIF_CHANNEL_FILE_TRANSFER, mContext.getString(R.string.notif_channel_file_transfer), NotificationManager.IMPORTANCE_DEFAULT);
fileTransferChannel.enableVibration(true); fileTransferChannel.enableVibration(true);
fileTransferChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC); fileTransferChannel.setLockscreenVisibility(Notification.VISIBILITY_SECRET);
fileTransferChannel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), soundAttributes); fileTransferChannel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), soundAttributes);
notificationManager.createNotificationChannel(fileTransferChannel); notificationManager.createNotificationChannel(fileTransferChannel);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment