Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix codepush breakage caused by #5954. #5996

Merged
merged 1 commit into from
Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions shell/platform/android/io/flutter/view/FlutterNativeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,30 +81,28 @@ public void runFromBundle(FlutterRunArguments args) {
} 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;
}
Expand Down Expand Up @@ -238,7 +236,7 @@ private void onPreEngineRestart() {

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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ public class FlutterRunArguments {
public String bundlePath;
public String entrypoint;
public String libraryPath;
public String snapshotOverride;
public String defaultPath;
}
21 changes: 10 additions & 11 deletions shell/platform/android/io/flutter/view/FlutterView.java
Original file line number Diff line number Diff line change
Expand Up @@ -611,34 +611,33 @@ public void runFromBundle(FlutterRunArguments args) {

/**
* @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);
}

Expand Down
4 changes: 2 additions & 2 deletions shell/platform/android/platform_view_android_jni.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)));
Expand Down