- mUploadOperation.cancel();
- }
-
- /**
- * Checks if content provider, using the content:// scheme, returns a file with mime-type
- * 'application/pdf' but file has not extension
- * @return true if is needed to add the pdf file extension to the file
- */
- private boolean isPdfFileFromContentProviderWithoutExtension() {
- return mOriginalStoragePath.startsWith(URI_CONTENT_SCHEME) &&
- mFile.getMimetype().equals(MIME_TYPE_PDF) &&
- !mFile.getFileName().endsWith(FILE_EXTENSION_PDF);
+ mCancellationRequested = new AtomicBoolean(true);
+ if (mUploadOperation != null) {
+ mUploadOperation.cancel();
+ }