Fix codepush breakage caused by #5954. (flutter/engine#5996)
This commit is contained in:
committed by
GitHub
parent
af25774b82
commit
b4ce259bcf
@@ -81,30 +81,28 @@ public class FlutterNativeView implements BinaryMessenger {
|
||||
} else if (args.entrypoint == null) {
|
||||
throw new AssertionError("An entrypoint must be specified");
|
||||
}
|
||||
runFromBundleInternal(args.bundlePath, args.entrypoint,
|
||||
args.libraryPath, null);
|
||||
runFromBundleInternal(args.bundlePath, args.entrypoint, args.libraryPath, args.defaultPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Please use runFromBundle with `FlutterRunArguments`. Parameters
|
||||
* `snapshotOverride` and `reuseRuntimeController` have no effect.
|
||||
* Please use runFromBundle with `FlutterRunArguments`.
|
||||
* Parameter `reuseRuntimeController` has no effect.
|
||||
*/
|
||||
@Deprecated
|
||||
public void runFromBundle(String bundlePath, String snapshotOverride, String entrypoint,
|
||||
public void runFromBundle(String bundlePath, String defaultPath, String entrypoint,
|
||||
boolean reuseRuntimeController) {
|
||||
runFromBundleInternal(bundlePath, entrypoint, null, null);
|
||||
runFromBundleInternal(bundlePath, entrypoint, null, defaultPath);
|
||||
}
|
||||
|
||||
private void runFromBundleInternal(String bundlePath, String entrypoint,
|
||||
String libraryPath, String snapshotOverride) {
|
||||
String libraryPath, String defaultPath) {
|
||||
assertAttached();
|
||||
if (applicationIsRunning)
|
||||
throw new AssertionError(
|
||||
"This Flutter engine instance is already running an application");
|
||||
nativeRunBundleAndSnapshotFromLibrary(mNativePlatformView, bundlePath,
|
||||
snapshotOverride, entrypoint, libraryPath,
|
||||
mContext.getResources().getAssets());
|
||||
defaultPath, entrypoint, libraryPath, mContext.getResources().getAssets());
|
||||
|
||||
applicationIsRunning = true;
|
||||
}
|
||||
@@ -238,7 +236,7 @@ public class FlutterNativeView implements BinaryMessenger {
|
||||
|
||||
private static native void nativeRunBundleAndSnapshotFromLibrary(
|
||||
long nativePlatformViewAndroid, String bundlePath,
|
||||
String snapshotOverride, String entrypoint, String libraryUrl,
|
||||
String defaultPath, String entrypoint, String libraryUrl,
|
||||
AssetManager manager);
|
||||
|
||||
private static native String nativeGetObservatoryUri();
|
||||
|
||||
@@ -12,5 +12,5 @@ public class FlutterRunArguments {
|
||||
public String bundlePath;
|
||||
public String entrypoint;
|
||||
public String libraryPath;
|
||||
public String snapshotOverride;
|
||||
public String defaultPath;
|
||||
}
|
||||
|
||||
@@ -611,34 +611,33 @@ public class FlutterView extends SurfaceView
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Please use runFromBundle with `FlutterRunArguments`. Parameter
|
||||
* `snapshotOverride` has no effect.
|
||||
* Please use runFromBundle with `FlutterRunArguments`.
|
||||
*/
|
||||
@Deprecated
|
||||
public void runFromBundle(String bundlePath, String snapshotOverride) {
|
||||
runFromBundle(bundlePath, snapshotOverride, "main", false);
|
||||
public void runFromBundle(String bundlePath, String defaultPath) {
|
||||
runFromBundle(bundlePath, defaultPath, "main", false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Please use runFromBundle with `FlutterRunArguments`. Parameter
|
||||
* `snapshotOverride` has no effect.
|
||||
* Please use runFromBundle with `FlutterRunArguments`.
|
||||
*/
|
||||
@Deprecated
|
||||
public void runFromBundle(String bundlePath, String snapshotOverride, String entrypoint) {
|
||||
runFromBundle(bundlePath, snapshotOverride, entrypoint, false);
|
||||
public void runFromBundle(String bundlePath, String defaultPath, String entrypoint) {
|
||||
runFromBundle(bundlePath, defaultPath, entrypoint, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Please use runFromBundle with `FlutterRunArguments`. Parameters
|
||||
* `snapshotOverride` and `reuseRuntimeController` have no effect.
|
||||
* Please use runFromBundle with `FlutterRunArguments`.
|
||||
* Parameter `reuseRuntimeController` has no effect.
|
||||
*/
|
||||
@Deprecated
|
||||
public void runFromBundle(String bundlePath, String snapshotOverride, String entrypoint, boolean reuseRuntimeController) {
|
||||
public void runFromBundle(String bundlePath, String defaultPath, String entrypoint, boolean reuseRuntimeController) {
|
||||
FlutterRunArguments args = new FlutterRunArguments();
|
||||
args.bundlePath = bundlePath;
|
||||
args.entrypoint = entrypoint;
|
||||
args.defaultPath = defaultPath;
|
||||
runFromBundle(args);
|
||||
}
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ static void RunBundleAndSnapshotFromLibrary(JNIEnv* env,
|
||||
jobject jcaller,
|
||||
jlong shell_holder,
|
||||
jstring jbundlepath,
|
||||
jstring jsnapshotOverride,
|
||||
jstring jdefaultPath,
|
||||
jstring jEntrypoint,
|
||||
jstring jLibraryUrl,
|
||||
jobject jAssetManager) {
|
||||
@@ -275,7 +275,7 @@ static void RunBundleAndSnapshotFromLibrary(JNIEnv* env,
|
||||
}
|
||||
}
|
||||
|
||||
const auto defaultpath = fml::jni::JavaStringToString(env, jsnapshotOverride);
|
||||
const auto defaultpath = fml::jni::JavaStringToString(env, jdefaultPath);
|
||||
if (defaultpath.size() > 0) {
|
||||
asset_manager->PushBack(std::make_unique<blink::DirectoryAssetBundle>(
|
||||
fml::OpenFile(defaultpath.c_str(), fml::OpenPermission::kRead, true)));
|
||||
|
||||
Reference in New Issue
Block a user