summaryrefslogtreecommitdiffstats
path: root/xpcom/base/nsDumpUtils.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-22 19:03:00 -0500
committerMatt A. Tobin <email@mattatobin.com>2020-02-22 19:03:00 -0500
commit69ed4e4b4ee94b69f55e2e0d405aff109e3d145c (patch)
tree47e775a19e4ac23d4e70970fc24dec619cbfd110 /xpcom/base/nsDumpUtils.cpp
parent7c8262e8c30018c1c522de5db1f22f815212a89f (diff)
downloadUXP-69ed4e4b4ee94b69f55e2e0d405aff109e3d145c.tar
UXP-69ed4e4b4ee94b69f55e2e0d405aff109e3d145c.tar.gz
UXP-69ed4e4b4ee94b69f55e2e0d405aff109e3d145c.tar.lz
UXP-69ed4e4b4ee94b69f55e2e0d405aff109e3d145c.tar.xz
UXP-69ed4e4b4ee94b69f55e2e0d405aff109e3d145c.zip
Issue #1053 - Remove android support from XPCOM
Diffstat (limited to 'xpcom/base/nsDumpUtils.cpp')
-rw-r--r--xpcom/base/nsDumpUtils.cpp60
1 files changed, 1 insertions, 59 deletions
diff --git a/xpcom/base/nsDumpUtils.cpp b/xpcom/base/nsDumpUtils.cpp
index c68862d08..bef5b6fda 100644
--- a/xpcom/base/nsDumpUtils.cpp
+++ b/xpcom/base/nsDumpUtils.cpp
@@ -343,12 +343,6 @@ FifoWatcher::OpenFd()
return -1;
}
-#ifdef ANDROID
- // Android runs with a umask, so we need to chmod our fifo to make it
- // world-writable.
- chmod(path.get(), 0666);
-#endif
-
int fd;
do {
// The fifo will block until someone else has written to it. In
@@ -428,23 +422,11 @@ FifoWatcher::OnFileCanReadWithoutBlocking(int aFd)
#endif // XP_UNIX }
-// In Android case, this function will open a file named aFilename under
-// /data/local/tmp/"aFoldername".
-// Otherwise, it will open a file named aFilename under "NS_OS_TEMP_DIR".
+// This will open a file named aFilename under "NS_OS_TEMP_DIR".
/* static */ nsresult
nsDumpUtils::OpenTempFile(const nsACString& aFilename, nsIFile** aFile,
const nsACString& aFoldername, Mode aMode)
{
-#ifdef ANDROID
- // For Android, first try the downloads directory which is world-readable
- // rather than the temp directory which is not.
- if (!*aFile) {
- char* env = PR_GetEnv("DOWNLOADS_DIRECTORY");
- if (env) {
- NS_NewNativeLocalFile(nsCString(env), /* followLinks = */ true, aFile);
- }
- }
-#endif
nsresult rv;
if (!*aFile) {
rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, aFile);
@@ -453,32 +435,6 @@ nsDumpUtils::OpenTempFile(const nsACString& aFilename, nsIFile** aFile,
}
}
-#ifdef ANDROID
- // /data/local/tmp is a true tmp directory; anyone can create a file there,
- // but only the user which created the file can remove it. We want non-root
- // users to be able to remove these files, so we write them into a
- // subdirectory of the temp directory and chmod 777 that directory.
- if (aFoldername != EmptyCString()) {
- rv = (*aFile)->AppendNative(aFoldername);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- // It's OK if this fails; that probably just means that the directory
- // already exists.
- Unused << (*aFile)->Create(nsIFile::DIRECTORY_TYPE, 0777);
-
- nsAutoCString dirPath;
- rv = (*aFile)->GetNativePath(dirPath);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- while (chmod(dirPath.get(), 0777) == -1 && errno == EINTR) {
- }
- }
-#endif
-
nsCOMPtr<nsIFile> file(*aFile);
rv = file->AppendNative(aFilename);
@@ -495,19 +451,5 @@ nsDumpUtils::OpenTempFile(const nsACString& aFilename, nsIFile** aFile,
return rv;
}
-#ifdef ANDROID
- // Make this file world-read/writable; the permissions passed to the
- // CreateUnique call above are not sufficient on Android, which runs with a
- // umask.
- nsAutoCString path;
- rv = file->GetNativePath(path);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- while (chmod(path.get(), 0666) == -1 && errno == EINTR) {
- }
-#endif
-
return NS_OK;
}