Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
5555725f
Unverified
Commit
5555725f
authored
Jun 06, 2019
by
Zachary Anderson
Committed by
GitHub
Jun 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tool] Fix 'q' for Fuchsia profile/debug mode (#33846)
parent
9114f445
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
36 additions
and
37 deletions
+36
-37
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+1
-1
device.dart
packages/flutter_tools/lib/src/device.dart
+1
-1
fuchsia_device.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
+1
-1
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+23
-22
run_cold.dart
packages/flutter_tools/lib/src/run_cold.dart
+2
-4
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+3
-3
web_device.dart
packages/flutter_tools/lib/src/web/web_device.dart
+1
-1
fuchsia_device_test.dart
packages/flutter_tools/test/fuchsia/fuchsia_device_test.dart
+1
-1
hot_test.dart
packages/flutter_tools/test/hot_test.dart
+3
-3
No files found.
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
5555725f
...
...
@@ -863,7 +863,7 @@ class AppInstance {
return
runner
.
restart
(
fullRestart:
fullRestart
,
pauseAfterRestart:
pauseAfterRestart
,
reason:
reason
);
}
Future
<
void
>
stop
()
=>
runner
.
stop
();
Future
<
void
>
stop
()
=>
runner
.
exit
();
Future
<
void
>
detach
()
=>
runner
.
detach
();
void
closeLogger
()
{
...
...
packages/flutter_tools/lib/src/device.dart
View file @
5555725f
...
...
@@ -307,7 +307,7 @@ abstract class Device {
/// Whether flutter applications running on this device can be terminated
/// from the vmservice.
bool
get
supports
StopApp
=>
true
;
bool
get
supports
FlutterExit
=>
true
;
/// Whether the device supports taking screenshots of a running flutter
/// application.
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
View file @
5555725f
...
...
@@ -184,7 +184,7 @@ class FuchsiaDevice extends Device {
bool
get
supportsHotRestart
=>
false
;
@override
bool
get
supports
StopApp
=>
false
;
bool
get
supports
FlutterExit
=>
false
;
@override
final
String
name
;
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
5555725f
...
...
@@ -11,7 +11,7 @@ import 'artifacts.dart';
import
'asset.dart'
;
import
'base/common.dart'
;
import
'base/file_system.dart'
;
import
'base/io.dart'
;
import
'base/io.dart'
as
io
;
import
'base/logger.dart'
;
import
'base/terminal.dart'
;
import
'base/utils.dart'
;
...
...
@@ -166,8 +166,9 @@ class FlutterDevice {
await
service
.
getVM
();
}
Future
<
void
>
stopApps
()
async
{
if
(!
device
.
supportsStopApp
)
{
Future
<
void
>
exitApps
()
async
{
if
(!
device
.
supportsFlutterExit
)
{
await
device
.
stopApp
(
package
);
return
;
}
final
List
<
FlutterView
>
flutterViews
=
views
;
...
...
@@ -530,7 +531,7 @@ abstract class ResidentRunner {
final
bool
stayResident
;
final
bool
ipv6
;
final
Completer
<
int
>
_finished
=
Completer
<
int
>();
bool
_
stopp
ed
=
false
;
bool
_
exit
ed
=
false
;
String
_packagesFilePath
;
String
get
packagesFilePath
=>
_packagesFilePath
;
String
_projectRootPath
;
...
...
@@ -582,18 +583,18 @@ abstract class ResidentRunner {
throw
'
${fullRestart ? 'Restart' : 'Reload'}
is not supported in
$mode
mode'
;
}
Future
<
void
>
stop
()
async
{
_
stopp
ed
=
true
;
Future
<
void
>
exit
()
async
{
_
exit
ed
=
true
;
if
(
saveCompilationTrace
)
await
_debugSaveCompilationTrace
();
await
stopEchoingDeviceLog
();
await
pre
Stop
();
await
stop
App
();
await
pre
Exit
();
await
exit
App
();
}
Future
<
void
>
detach
()
async
{
await
stopEchoingDeviceLog
();
await
pre
Stop
();
await
pre
Exit
();
appFinished
();
}
...
...
@@ -743,29 +744,29 @@ abstract class ResidentRunner {
void
registerSignalHandlers
()
{
assert
(
stayResident
);
ProcessSignal
.
SIGINT
.
watch
().
listen
(
_cleanUpAndExit
);
ProcessSignal
.
SIGTERM
.
watch
().
listen
(
_cleanUpAndExit
);
io
.
ProcessSignal
.
SIGINT
.
watch
().
listen
(
_cleanUpAndExit
);
io
.
ProcessSignal
.
SIGTERM
.
watch
().
listen
(
_cleanUpAndExit
);
if
(!
supportsServiceProtocol
||
!
supportsRestart
)
return
;
ProcessSignal
.
SIGUSR1
.
watch
().
listen
(
_handleSignal
);
ProcessSignal
.
SIGUSR2
.
watch
().
listen
(
_handleSignal
);
io
.
ProcessSignal
.
SIGUSR1
.
watch
().
listen
(
_handleSignal
);
io
.
ProcessSignal
.
SIGUSR2
.
watch
().
listen
(
_handleSignal
);
}
Future
<
void
>
_cleanUpAndExit
(
ProcessSignal
signal
)
async
{
Future
<
void
>
_cleanUpAndExit
(
io
.
ProcessSignal
signal
)
async
{
_resetTerminal
();
await
cleanupAfterSignal
();
exit
(
0
);
io
.
exit
(
0
);
}
bool
_processingUserRequest
=
false
;
Future
<
void
>
_handleSignal
(
ProcessSignal
signal
)
async
{
Future
<
void
>
_handleSignal
(
io
.
ProcessSignal
signal
)
async
{
if
(
_processingUserRequest
)
{
printTrace
(
'Ignoring signal: "
$signal
" because we are busy.'
);
return
;
}
_processingUserRequest
=
true
;
final
bool
fullRestart
=
signal
==
ProcessSignal
.
SIGUSR2
;
final
bool
fullRestart
=
signal
==
io
.
ProcessSignal
.
SIGUSR2
;
try
{
await
restart
(
fullRestart:
fullRestart
);
...
...
@@ -903,7 +904,7 @@ abstract class ResidentRunner {
}
}
else
if
(
lower
==
'q'
)
{
// exit
await
stop
();
await
exit
();
return
true
;
}
else
if
(
lower
==
'd'
)
{
await
detach
();
...
...
@@ -937,7 +938,7 @@ abstract class ResidentRunner {
}
void
_serviceDisconnected
()
{
if
(
_
stopp
ed
)
{
if
(
_
exit
ed
)
{
// User requested the application exit.
return
;
}
...
...
@@ -980,12 +981,12 @@ abstract class ResidentRunner {
return
exitCode
;
}
Future
<
void
>
pre
Stop
()
async
{
}
Future
<
void
>
pre
Exit
()
async
{
}
Future
<
void
>
stop
App
()
async
{
Future
<
void
>
exit
App
()
async
{
final
List
<
Future
<
void
>>
futures
=
<
Future
<
void
>>[];
for
(
FlutterDevice
device
in
flutterDevices
)
futures
.
add
(
device
.
stop
Apps
());
futures
.
add
(
device
.
exit
Apps
());
await
Future
.
wait
(
futures
);
appFinished
();
}
...
...
packages/flutter_tools/lib/src/run_cold.dart
View file @
5555725f
...
...
@@ -160,10 +160,8 @@ class ColdRunner extends ResidentRunner {
await
stopEchoingDeviceLog
();
if
(
_didAttach
)
{
appFinished
();
}
else
{
await
stopApp
();
}
await
stop
App
();
await
exit
App
();
}
@override
...
...
@@ -207,7 +205,7 @@ class ColdRunner extends ResidentRunner {
}
@override
Future
<
void
>
pre
Stop
()
async
{
Future
<
void
>
pre
Exit
()
async
{
for
(
FlutterDevice
device
in
flutterDevices
)
{
// If we're running in release mode, stop the app using the device logic.
if
(
device
.
vmServices
==
null
||
device
.
vmServices
.
isEmpty
)
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
5555725f
...
...
@@ -218,7 +218,7 @@ class HotRunner extends ResidentRunner {
printStatus
(
'Benchmark completed. Exiting application.'
);
await
_cleanupDevFS
();
await
stopEchoingDeviceLog
();
await
stop
App
();
await
exit
App
();
}
final
File
benchmarkOutput
=
fs
.
file
(
'hot_benchmark.json'
);
benchmarkOutput
.
writeAsStringSync
(
toPrettyJson
(
benchmarkData
));
...
...
@@ -922,12 +922,12 @@ class HotRunner extends ResidentRunner {
if
(
_didAttach
)
{
appFinished
();
}
else
{
await
stop
App
();
await
exit
App
();
}
}
@override
Future
<
void
>
pre
Stop
()
async
{
Future
<
void
>
pre
Exit
()
async
{
await
_cleanupDevFS
();
await
hotRunnerConfig
.
runPreShutdownOperations
();
}
...
...
packages/flutter_tools/lib/src/web/web_device.dart
View file @
5555725f
...
...
@@ -49,7 +49,7 @@ class WebDevice extends Device {
bool
get
supportsStartPaused
=>
true
;
@override
bool
get
supports
StopApp
=>
true
;
bool
get
supports
FlutterExit
=>
true
;
@override
bool
get
supportsScreenshot
=>
false
;
...
...
packages/flutter_tools/test/fuchsia/fuchsia_device_test.dart
View file @
5555725f
...
...
@@ -72,7 +72,7 @@ void main() {
expect
(
device
.
supportsHotReload
,
true
);
expect
(
device
.
supportsHotRestart
,
false
);
expect
(
device
.
supports
StopApp
,
false
);
expect
(
device
.
supports
FlutterExit
,
false
);
expect
(
device
.
isSupportedForProject
(
FlutterProject
.
current
()),
true
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
memoryFileSystem
,
...
...
packages/flutter_tools/test/hot_test.dart
View file @
5555725f
...
...
@@ -232,7 +232,7 @@ void main() {
final
MockDevice
mockDevice
=
MockDevice
();
when
(
mockDevice
.
supportsHotReload
).
thenReturn
(
true
);
when
(
mockDevice
.
supportsHotRestart
).
thenReturn
(
true
);
when
(
mockDevice
.
supports
StopApp
).
thenReturn
(
false
);
when
(
mockDevice
.
supports
FlutterExit
).
thenReturn
(
false
);
final
List
<
FlutterDevice
>
devices
=
<
FlutterDevice
>[
FlutterDevice
(
mockDevice
,
generator:
residentCompiler
,
trackWidgetCreation:
false
,
buildMode:
BuildMode
.
debug
),
];
...
...
@@ -247,11 +247,11 @@ void main() {
final
MockDevice
mockDevice
=
MockDevice
();
when
(
mockDevice
.
supportsHotReload
).
thenReturn
(
true
);
when
(
mockDevice
.
supportsHotRestart
).
thenReturn
(
true
);
when
(
mockDevice
.
supports
StopApp
).
thenReturn
(
false
);
when
(
mockDevice
.
supports
FlutterExit
).
thenReturn
(
false
);
final
List
<
FlutterDevice
>
devices
=
<
FlutterDevice
>[
FlutterDevice
(
mockDevice
,
generator:
residentCompiler
,
trackWidgetCreation:
false
,
buildMode:
BuildMode
.
debug
),
];
await
HotRunner
(
devices
).
pre
Stop
();
await
HotRunner
(
devices
).
pre
Exit
();
expect
(
shutdownTestingConfig
.
shutdownHookCalled
,
true
);
},
overrides:
<
Type
,
Generator
>{
Artifacts:
()
=>
mockArtifacts
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment