Move JNI bindings code from mapbox-gl-native to this repo. (#301)

This commit is contained in:
Igor Tarasov
2020-04-02 19:45:56 +03:00
committed by GitHub
parent 620bda356c
commit daecbed823
178 changed files with 14422 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
#pragma once
#include <mbgl/storage/file_source.hpp>
#include "asset_manager.hpp"
#include <jni/jni.hpp>
namespace mbgl {
namespace util {
template <typename T> class Thread;
} // namespace util
class AssetManagerFileSource : public FileSource {
public:
AssetManagerFileSource(jni::JNIEnv&, const jni::Object<android::AssetManager>&);
~AssetManagerFileSource() override;
std::unique_ptr<AsyncRequest> request(const Resource&, Callback) override;
bool canRequest(const Resource&) const override;
private:
class Impl;
jni::Global<jni::Object<android::AssetManager>> assetManager;
std::unique_ptr<util::Thread<Impl>> impl;
};
} // namespace mbgl