code: protected final void broadcastCancelled() {
  
          Logger.debug(LOG_TAG, "Broadcasting cancellation for upload with ID: " + 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 && notificationConfig.getCancelled().message != null) {
              updateNotification(uploadInfo, notificationConfig.getCancelled());
          }
  
          BroadcastData data = new BroadcastData()
                  .setStatus(BroadcastData.Status.CANCELLED)
                  .setUploadInfo(uploadInfo);
  
          final UploadStatusDelegate delegate = UploadService.getUploadStatusDelegate(params.id);
          if (delegate != null) {
              mainThreadHandler.post(new Runnable() {
                  @Override
                  public void run() {
                      delegate.onCancelled(service, uploadInfo);
                  }
              });
          } else {
              service.sendBroadcast(data.getIntent());
          }
  
          service.taskCompleted(params.id);
      }
docs: Broadcast a cancelled status.
  This called automatically by {@link UploadTask} when the user cancels the request,
  and the specific implementation of {@link UploadTask#upload()} either
  returns or throws an exception. You should never call this method explicitly in your
  implementation.