Fix hot reload / restart after the back button dismisses the app on Android (#9455)

- [x] Refresh FlutterViews before issuing a hot reload / restart

Fixes #7248
This commit is contained in:
John McCutchan
2017-04-18 14:18:33 -07:00
committed by GitHub
parent 1e4151691a
commit 71d80fbd3f
2 changed files with 5 additions and 0 deletions

View File

@@ -324,6 +324,8 @@ class HotRunner extends ResidentRunner {
}
Future<OperationResult> _restartFromSources() async {
printTrace('Refreshing active FlutterViews before restarting.');
await refreshViews();
final Stopwatch restartTimer = new Stopwatch();
restartTimer.start();
final bool updatedDevFS = await _updateDevFS();
@@ -409,6 +411,8 @@ class HotRunner extends ResidentRunner {
}
Future<OperationResult> _reloadSources({ bool pause: false }) async {
printTrace('Refreshing active FlutterViews before reloading.');
await refreshViews();
if (currentView.uiIsolate == null)
throw 'Application isolate not found';
// The initial launch is from a script snapshot. When we reload from source

View File

@@ -756,6 +756,7 @@ class VM extends ServiceObjectOwner {
}
Future<Null> refreshViews() async {
_viewCache.clear();
await vmService.vm.invokeRpc('_flutter.listViews', timeout: kLongRequestTimeout);
}