Revert "Hold a global reference to the AssetManager Java object backing the APKAssetProvider (#5078)" (flutter/engine#5116)

This reverts commit c2b081e229.

It causes engine crashes in some Android Espresso tests.
This commit is contained in:
Yegor
2018-04-27 13:47:26 -07:00
committed by GitHub
parent 3610085650
commit 2b58565cee
2 changed files with 2 additions and 5 deletions

View File

@@ -10,8 +10,7 @@ namespace blink {
APKAssetProvider::APKAssetProvider(JNIEnv* env,
jobject jassetManager,
std::string directory)
: java_asset_manager_(env, jassetManager),
directory_(std::move(directory)) {
: directory_(std::move(directory)) {
assetManager_ = AAssetManager_fromJava(env, jassetManager);
}

View File

@@ -9,7 +9,6 @@
#include <jni.h>
#include "flutter/assets/asset_resolver.h"
#include "flutter/fml/platform/android/scoped_java_ref.h"
#include "lib/fxl/memory/ref_counted.h"
namespace blink {
@@ -22,7 +21,6 @@ class APKAssetProvider final : public AssetResolver {
virtual ~APKAssetProvider();
private:
fml::jni::ScopedJavaGlobalRef<jobject> java_asset_manager_;
AAssetManager* assetManager_;
const std::string directory_;
@@ -38,4 +36,4 @@ class APKAssetProvider final : public AssetResolver {
} // namespace blink
#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H
#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H