code: protected final void broadcastCompleted(final ServerResponse response) {
  
          final boolean successfulUpload = response.getHttpCode() >= 200 && response.getHttpCode() < 400;
  
          if (successfulUpload) {
              onSuccessfulUpload();
  
              if (params.autoDeleteSuccessfullyUploadedFiles && !successfullyUploadedFiles.isEmpty()) {
                  for (String filePath : successfullyUploadedFiles) {
                      deleteFile(new File(filePath));
                  }
              }
          }
  
          Logger.debug(LOG_TAG, "Broadcasting upload " + (successfulUpload ? "completed" : "error")
                  + " for " + params.id);
  
          final UploadInfo uploadInfo = new UploadInfo(params.id, startTime, uploadedBytes,
                  totalBytes, (attempts - 1),
                  successfullyUploadedFiles,
                  pathStringListFrom(params.files));
  
          final UploadNotificationConfig notificationConfig = params.notificationConfig;
  
          if (notificationConfig != null) {
              if (successfulUpload && notificationConfig.getCompleted().message != null) {
                  updateNotification(uploadInfo, notificationConfig.getCompleted());
  
              } else if (notificationConfig.getError().message != null) {
                  updateNotification(uploadInfo, notificationConfig.getError());
              }
          }
  
          final UploadStatusDelegate delegate = UploadService.getUploadStatusDelegate(params.id);
          if (delegate != null) {
              mainThreadHandler.post(new Runnable() {
                  @Override
                  public void run() {
                      if (successfulUpload) {
                          delegate.onCompleted(service, uploadInfo, response);
                      } else {
                          delegate.onError(service, uploadInfo, response, null);
                      }
                  }
              });
          } else {
              BroadcastData data = new BroadcastData()
                      .setStatus(successfulUpload ? BroadcastData.Status.COMPLETED : BroadcastData.Status.ERROR)
                      .setUploadInfo(uploadInfo)
                      .setServerResponse(response);
  
              service.sendBroadcast(data.getIntent());
          }
  
          service.taskCompleted(params.id);
      }
docs: Broadcasts a completion status update and informs the {@link UploadService} that the task
  executes successfully.
  Call this when the task has completed the upload request and has received the response
  from the server.
  
  @param response response got from the server