From d20ca24a070d547be3bce4d513ef151b6be5f955 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Tue, 25 Feb 2020 19:45:39 -0500 Subject: Issue #1053 - Remove android support from toolkit Note: Does not remove support completely from toolkit/mozapps/installer or from telemetry or AppConstants.jsm --- toolkit/components/downloads/nsDownloadManager.cpp | 45 +--------------------- 1 file changed, 2 insertions(+), 43 deletions(-) (limited to 'toolkit/components/downloads') diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp index ab984c5f2..9f43ade2c 100644 --- a/toolkit/components/downloads/nsDownloadManager.cpp +++ b/toolkit/components/downloads/nsDownloadManager.cpp @@ -61,10 +61,6 @@ #include #endif -#ifdef MOZ_WIDGET_ANDROID -#include "FennecJNIWrappers.h" -#endif - #ifdef MOZ_WIDGET_GTK #include #endif @@ -1421,19 +1417,6 @@ nsDownloadManager::GetDefaultDownloadsDirectory(nsIFile **aResult) } } #elif defined(XP_UNIX) -#if defined(MOZ_WIDGET_ANDROID) - // Android doesn't have a $HOME directory, and by default we only have - // write access to /data/data/org.mozilla.{$APP} and /sdcard - char* downloadDirPath = getenv("DOWNLOADS_DIRECTORY"); - if (downloadDirPath) { - rv = NS_NewNativeLocalFile(nsDependentCString(downloadDirPath), - true, getter_AddRefs(downloadDir)); - NS_ENSURE_SUCCESS(rv, rv); - } - else { - rv = NS_ERROR_FAILURE; - } -#else rv = dirService->Get(NS_UNIX_DEFAULT_DOWNLOAD_DIR, NS_GET_IID(nsIFile), getter_AddRefs(downloadDir)); @@ -1446,7 +1429,6 @@ nsDownloadManager::GetDefaultDownloadsDirectory(nsIFile **aResult) rv = downloadDir->Append(folderName); NS_ENSURE_SUCCESS(rv, rv); } -#endif #else rv = dirService->Get(NS_OS_HOME_DIR, NS_GET_IID(nsIFile), @@ -2685,14 +2667,6 @@ nsDownload::SetState(DownloadState aState) case nsIDownloadManager::DOWNLOAD_DIRTY: case nsIDownloadManager::DOWNLOAD_CANCELED: case nsIDownloadManager::DOWNLOAD_FAILED: -#ifdef ANDROID - // If we still have a temp file, remove it - bool tempExists; - if (mTempFile && NS_SUCCEEDED(mTempFile->Exists(&tempExists)) && tempExists) { - nsresult rv = mTempFile->Remove(false); - NS_ENSURE_SUCCESS(rv, rv); - } -#endif // Transfers are finished, so break the reference cycle Finalize(); @@ -2770,7 +2744,7 @@ nsDownload::SetState(DownloadState aState) } } -#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GTK) +#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK) nsCOMPtr fileURL = do_QueryInterface(mTarget); nsCOMPtr file; nsAutoString path; @@ -2780,27 +2754,13 @@ nsDownload::SetState(DownloadState aState) file && NS_SUCCEEDED(file->GetPath(path))) { -#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_ANDROID) +#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) // On Windows and Gtk, add the download to the system's "recent documents" // list, with a pref to disable. { bool addToRecentDocs = true; if (pref) pref->GetBoolPref(PREF_BDM_ADDTORECENTDOCS, &addToRecentDocs); -#ifdef MOZ_WIDGET_ANDROID - if (addToRecentDocs) { - nsCOMPtr mimeInfo; - nsAutoCString contentType; - GetMIMEInfo(getter_AddRefs(mimeInfo)); - - if (mimeInfo) - mimeInfo->GetMIMEType(contentType); - - if (jni::IsFennec()) { - java::DownloadsIntegration::ScanMedia(path, NS_ConvertUTF8toUTF16(contentType)); - } - } -#else if (addToRecentDocs && !mPrivate) { #ifdef XP_WIN ::SHAddToRecentDocs(SHARD_PATHW, path.get()); @@ -2815,7 +2775,6 @@ nsDownload::SetState(DownloadState aState) } #endif } -#endif #ifdef MOZ_ENABLE_GIO // Use GIO to store the source URI for later display in the file manager. GFile* gio_file = g_file_new_for_path(NS_ConvertUTF16toUTF8(path).get()); -- cgit v1.2.3