Skip to content

Commit

Permalink
Merge pull request flutter#2313 from jason-simmons/view_reset_isolate
Browse files Browse the repository at this point in the history
Create a new pipe to the ServiceProvider when PlatformViewAndroid sta…
  • Loading branch information
jason-simmons committed Jan 28, 2016
2 parents 9ee9721 + 35e3e94 commit 8d7a4bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,20 @@ private void attach() {
ServiceRegistry localRegistry = new ServiceRegistry();
configureLocalServices(localRegistry);

mServiceProvider = new PlatformServiceProvider(core, getContext(), localRegistry);
}

void runFromBundle(String path) {
Core core = CoreImpl.getInstance();
Pair<ServiceProvider.Proxy, InterfaceRequest<ServiceProvider>> serviceProvider =
ServiceProvider.MANAGER.getInterfaceRequest(core);
mServiceProvider = new PlatformServiceProvider(core, getContext(), localRegistry);
ServiceProvider.MANAGER.bind(mServiceProvider, serviceProvider.second);

ServicesData services = new ServicesData();
services.servicesProvidedByEmbedder = serviceProvider.first;
mSkyEngine.setServices(services);

mSkyEngine.runFromBundle(path);
}

private static native long nativeAttach(int inputObserverHandle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected void onSkyReady() {
File dataDir = new File(PathUtils.getDataDirectory(this));
File appBundle = new File(dataDir, SkyApplication.APP_BUNDLE);
if (appBundle.exists()) {
mView.getEngine().runFromBundle(appBundle.getPath());
mView.runFromBundle(appBundle.getPath());
return;
}
}
Expand All @@ -151,7 +151,7 @@ public boolean loadIntent(Intent intent) {
String action = intent.getAction();

if (Intent.ACTION_RUN.equals(action)) {
mView.getEngine().runFromBundle(intent.getDataString());
mView.runFromBundle(intent.getDataString());
String route = intent.getStringExtra("route");
if (route != null)
mView.getEngine().pushRoute(route);
Expand All @@ -167,7 +167,7 @@ public boolean loadBundleByName(String name) {
if (!bundle.exists()) {
return false;
}
mView.getEngine().runFromBundle(bundle.getPath());
mView.runFromBundle(bundle.getPath());
return true;
}

Expand Down

0 comments on commit 8d7a4bb

Please sign in to comment.