diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-22 19:03:00 -0500 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 12:51:25 +0200 |
commit | da15aa0fdf5ec769a0973a00d84f9fa090de0b60 (patch) | |
tree | c6f5b8197eac51be855aecdae3b5d97207cdf97e /xpcom/io/nsLocalFileUnix.cpp | |
parent | 867737dd4b650494404a90b8b99ea959f74462ca (diff) | |
download | UXP-da15aa0fdf5ec769a0973a00d84f9fa090de0b60.tar UXP-da15aa0fdf5ec769a0973a00d84f9fa090de0b60.tar.gz UXP-da15aa0fdf5ec769a0973a00d84f9fa090de0b60.tar.lz UXP-da15aa0fdf5ec769a0973a00d84f9fa090de0b60.tar.xz UXP-da15aa0fdf5ec769a0973a00d84f9fa090de0b60.zip |
Issue #1053 - Remove android support from XPCOM
Diffstat (limited to 'xpcom/io/nsLocalFileUnix.cpp')
-rw-r--r-- | xpcom/io/nsLocalFileUnix.cpp | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp index 06706235d..48f2786a7 100644 --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp @@ -62,12 +62,6 @@ static nsresult MacErrorMapper(OSErr inErr); #endif -#ifdef MOZ_WIDGET_ANDROID -#include "GeneratedJNIWrappers.h" -#include "nsIMIMEService.h" -#include <linux/magic.h> -#endif - #ifdef MOZ_ENABLE_CONTENTACTION #include <contentaction/contentaction.h> #endif @@ -1064,12 +1058,6 @@ nsLocalFile::Remove(bool aRecursive) } rv = file->Remove(aRecursive); -#ifdef ANDROID - // See bug 580434 - Bionic gives us just deleted files - if (rv == NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) { - continue; - } -#endif if (NS_FAILED(rv)) { return rv; } @@ -1193,19 +1181,7 @@ nsLocalFile::SetPermissions(uint32_t aPermissions) if (chmod(mPath.get(), aPermissions) >= 0) { return NS_OK; } -#if defined(ANDROID) && defined(STATFS) - // For the time being, this is restricted for use by Android, but we - // will figure out what to do for all platforms in bug 638503 - struct STATFS sfs; - if (STATFS(mPath.get(), &sfs) < 0) { - return NSRESULT_FOR_ERRNO(); - } - // if this is a FAT file system we can't set file permissions - if (sfs.f_type == MSDOS_SUPER_MAGIC) { - return NS_OK; - } -#endif return NSRESULT_FOR_ERRNO(); } @@ -1237,20 +1213,7 @@ nsLocalFile::SetFileSize(int64_t aFileSize) { CHECK_mPath(); -#if defined(ANDROID) - /* no truncate on bionic */ - int fd = open(mPath.get(), O_WRONLY); - if (fd == -1) { - return NSRESULT_FOR_ERRNO(); - } - - int ret = ftruncate(fd, (off_t)aFileSize); - close(fd); - - if (ret == -1) { - return NSRESULT_FOR_ERRNO(); - } -#elif defined(HAVE_TRUNCATE64) +#if defined(HAVE_TRUNCATE64) if (truncate64(mPath.get(), (off64_t)aFileSize) == -1) { return NSRESULT_FOR_ERRNO(); } @@ -2013,23 +1976,6 @@ nsLocalFile::Launch() } return NS_ERROR_FAILURE; -#elif defined(MOZ_WIDGET_ANDROID) - // Try to get a mimetype, if this fails just use the file uri alone - nsresult rv; - nsAutoCString type; - nsCOMPtr<nsIMIMEService> mimeService(do_GetService("@mozilla.org/mime;1", &rv)); - if (NS_SUCCEEDED(rv)) { - rv = mimeService->GetTypeFromFile(this, type); - } - - nsAutoCString fileUri = NS_LITERAL_CSTRING("file://") + mPath; - return java::GeckoAppShell::OpenUriExternal( - NS_ConvertUTF8toUTF16(fileUri), - NS_ConvertUTF8toUTF16(type), - EmptyString(), - EmptyString(), - EmptyString(), - EmptyString()) ? NS_OK : NS_ERROR_FAILURE; #elif defined(MOZ_WIDGET_COCOA) CFURLRef url; if (NS_SUCCEEDED(GetCFURL(&url))) { |