flutter_flutter/fml/platform/android/paths_android.cc
Chinmay Garde f2a3df97e2
Wire up the Skia persistent GPU related artifacts cache. (#6278)
Also teaches FML to create files and directories.
2018-09-26 14:54:09 -07:00

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