mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
30 lines
796 B
C++
30 lines
796 B
C++
// Copyright 2017 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 "flutter/fml/platform/android/paths_android.h"
|
|
|
|
#include "flutter/fml/file.h"
|
|
|
|
namespace fml {
|
|
namespace paths {
|
|
|
|
std::pair<bool, std::string> GetExecutableDirectoryPath() {
|
|
return {false, ""};
|
|
}
|
|
|
|
static std::string gCachesPath;
|
|
|
|
void InitializeAndroidCachesPath(std::string caches_path) {
|
|
gCachesPath = std::move(caches_path);
|
|
}
|
|
|
|
fml::UniqueFD GetCachesDirectory() {
|
|
// If the caches path is not initialized, the FD will be invalid and caching
|
|
// will be disabled throughout the system.
|
|
return OpenDirectory(gCachesPath.c_str(), false, fml::FilePermission::kRead);
|
|
}
|
|
|
|
} // namespace paths
|
|
} // namespace fml
|