[android] use shared DefaultFileSource for all maps + OfflineManager

This commit is contained in:
Konstantin Käfer
2017-02-17 15:17:21 +01:00
parent 6c0310209d
commit c86e38e303
7 changed files with 51 additions and 27 deletions

View File

@@ -0,0 +1,20 @@
#include "default_file_source.hpp"
#include <mbgl/util/logging.hpp>
#include <cassert>
namespace mbgl {
namespace android {
DefaultFileSource& defaultFileSource(const std::string& cachePath_, const std::string& assetRoot_) {
static auto cachePath = cachePath_;
assert(cachePath == cachePath_);
static auto assetRoot = assetRoot_;
assert(assetRoot == assetRoot_);
static DefaultFileSource defaultFileSource{ cachePath, assetRoot };
return defaultFileSource;
}
} // namespace android
} // namespace mbgl