Fix temp dir path for Android.
"/data/local/tmp" is not writable by applications.
BUG=125059
TEST=
Review URL: https://chromiumcodereview.appspot.com/10332218
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137719 0039d316-1c4b-4281-b951-d872f2087c98
CrOS-Libchrome-Original-Commit: 0eae7eb31aa96f27dd131b5bcd42579f67dd77fd
diff --git a/base/file_util_android.cc b/base/file_util_android.cc
index 6807d8d..79db279 100644
--- a/base/file_util_android.cc
+++ b/base/file_util_android.cc
@@ -1,16 +1,16 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/file_util.h"
#include "base/file_path.h"
+#include "base/path_service.h"
namespace file_util {
bool GetShmemTempDir(FilePath* path, bool executable) {
- *path = FilePath("/data/local/tmp");
- return true;
+ return PathService::Get(base::DIR_CACHE, path);
}
} // namespace file_util
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index f1113d5..c9a0d9b 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -38,6 +38,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
+#include "base/path_service.h"
#include "base/stl_util.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
@@ -920,7 +921,7 @@
*path = FilePath(tmp);
else
#if defined(OS_ANDROID)
- *path = FilePath("/data/local/tmp");
+ return PathService::Get(base::DIR_CACHE, path);
#else
*path = FilePath("/tmp");
#endif