code: protected synchronized boolean holdForegroundNotification(String uploadId, Notification notification) {
          if (!isExecuteInForeground()) return false;
  
          if (foregroundUploadId == null) {
              foregroundUploadId = uploadId;
              Logger.debug(TAG, uploadId + " now holds the foreground notification");
          }
  
          if (uploadId.equals(foregroundUploadId)) {
              startForeground(UPLOAD_NOTIFICATION_BASE_ID, notification);
              return true;
          }
  
          return false;
      }
docs: Check if the task is currently the one shown in the foreground notification.
  @param uploadId ID of the upload
  @return true if the current upload task holds the foreground notification, otherwise false