Source:
<code>private void onFolderRejected(String deviceId, String folderId, String folderLabel) { if (deviceId == null || folderId == null) { return; } Log.d(TAG, "Device " + deviceId + " wants to share folder " + folderLabel + " (" + folderId + ")"); String deviceName = null; for (Device d : mApi.getDevices(false)) { if (d.deviceID.equals(deviceId)) <START> deviceName = d.getDisplayName(); <END> } String title = mContext.getString(R.string.folder_rejected, deviceName, folderLabel.isEmpty() ? folderId : folderLabel + " (" + folderId + ")"); int notificationId = mNotificationHandler.getNotificationIdFromText(title); boolean isNewFolder = Stream.of(mApi.getFolders()) .noneMatch(f -> f.id.equals(folderId)); Intent intentAccept = new Intent(mContext, FolderActivity.class) .putExtra(FolderActivity.EXTRA_NOTIFICATION_ID, notificationId) .putExtra(FolderActivity.EXTRA_IS_CREATE, isNewFolder) .putExtra(FolderActivity.EXTRA_DEVICE_ID, deviceId) .putExtra(FolderActivity.EXTRA_FOLDER_ID, folderId) .putExtra(FolderActivity.EXTRA_FOLDER_LABEL, folderLabel); int requestCode = (deviceId + folderId).hashCode(); PendingIntent piAccept = PendingIntent.getActivity(mContext, requestCode, intentAccept, PendingIntent.FLAG_UPDATE_CURRENT); Intent intentIgnore = new Intent(mContext, SyncthingService.class) .putExtra(SyncthingService.EXTRA_NOTIFICATION_ID, notificationId) .putExtra(SyncthingService.EXTRA_FOLDER_ID, folderId); intentIgnore.setAction(SyncthingService.ACTION_IGNORE_FOLDER); PendingIntent piIgnore = PendingIntent.getService(mContext, 0, intentIgnore, PendingIntent.FLAG_UPDATE_CURRENT); mNotificationHandler.showConsentNotification(notificationId, title, piAccept, piIgnore); }</code><technical_language>break</technical_language>

Target:
private void onFolderRejected(String deviceId, String folderId, String folderLabel) { if (deviceId == null || folderId == null) { return; } Log.d(TAG, "Device " + deviceId + " wants to share folder " + folderLabel + " (" + folderId + ")"); String deviceName = null; for (Device d : mApi.getDevices(false)) { if (d.deviceID.equals(deviceId)) { deviceName = d.getDisplayName(); break; } } String title = mContext.getString(R.string.folder_rejected, deviceName, folderLabel.isEmpty() ? folderId : folderLabel + " (" + folderId + ")"); int notificationId = mNotificationHandler.getNotificationIdFromText(title); boolean isNewFolder = Stream.of(mApi.getFolders()) .noneMatch(f -> f.id.equals(folderId)); Intent intentAccept = new Intent(mContext, FolderActivity.class) .putExtra(FolderActivity.EXTRA_NOTIFICATION_ID, notificationId) .putExtra(FolderActivity.EXTRA_IS_CREATE, isNewFolder) .putExtra(FolderActivity.EXTRA_DEVICE_ID, deviceId) .putExtra(FolderActivity.EXTRA_FOLDER_ID, folderId) .putExtra(FolderActivity.EXTRA_FOLDER_LABEL, folderLabel); PendingIntent piAccept = PendingIntent.getActivity(mContext, notificationId, intentAccept, PendingIntent.FLAG_UPDATE_CURRENT); Intent intentIgnore = new Intent(mContext, SyncthingService.class) .putExtra(SyncthingService.EXTRA_NOTIFICATION_ID, notificationId) .putExtra(SyncthingService.EXTRA_FOLDER_ID, folderId); intentIgnore.setAction(SyncthingService.ACTION_IGNORE_FOLDER); PendingIntent piIgnore = PendingIntent.getService(mContext, 0, intentIgnore, PendingIntent.FLAG_UPDATE_CURRENT); mNotificationHandler.showConsentNotification(notificationId, title, piAccept, piIgnore); }