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
891036c9
Unverified
Commit
891036c9
authored
Jan 08, 2019
by
Jonah Williams
Committed by
GitHub
Jan 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent calls to view.uiIsolate.flutterExit on devices which do not support it (#26201)
parent
e4fb4fe2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
2 deletions
+24
-2
device.dart
packages/flutter_tools/lib/src/device.dart
+9
-2
fuchsia_device.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
+3
-0
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+3
-0
fuchsa_device_test.dart
packages/flutter_tools/test/fuchsia/fuchsa_device_test.dart
+9
-0
No files found.
packages/flutter_tools/lib/src/device.dart
View file @
891036c9
...
@@ -184,6 +184,7 @@ abstract class PollingDeviceDiscovery extends DeviceDiscovery {
...
@@ -184,6 +184,7 @@ abstract class PollingDeviceDiscovery extends DeviceDiscovery {
}
}
abstract
class
Device
{
abstract
class
Device
{
Device
(
this
.
id
);
Device
(
this
.
id
);
final
String
id
;
final
String
id
;
...
@@ -276,11 +277,17 @@ abstract class Device {
...
@@ -276,11 +277,17 @@ abstract class Device {
/// Whether this device implements support for hot restart.
/// Whether this device implements support for hot restart.
bool
get
supportsHotRestart
=>
true
;
bool
get
supportsHotRestart
=>
true
;
/// Stop an app package on the current device.
/// Whether flutter applications running on this device can be terminated
Future
<
bool
>
stopApp
(
ApplicationPackage
app
);
/// from the vmservice.
bool
get
supportsStopApp
=>
true
;
/// Whether the device supports taking screenshots of a running flutter
/// application.
bool
get
supportsScreenshot
=>
false
;
bool
get
supportsScreenshot
=>
false
;
/// Stop an app package on the current device.
Future
<
bool
>
stopApp
(
ApplicationPackage
app
);
Future
<
void
>
takeScreenshot
(
File
outputFile
)
=>
Future
<
void
>.
error
(
'unimplemented'
);
Future
<
void
>
takeScreenshot
(
File
outputFile
)
=>
Future
<
void
>.
error
(
'unimplemented'
);
@override
@override
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
View file @
891036c9
...
@@ -150,6 +150,9 @@ class FuchsiaDevice extends Device {
...
@@ -150,6 +150,9 @@ class FuchsiaDevice extends Device {
@override
@override
bool
get
supportsHotRestart
=>
false
;
bool
get
supportsHotRestart
=>
false
;
@override
bool
get
supportsStopApp
=>
false
;
@override
@override
final
String
name
;
final
String
name
;
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
891036c9
...
@@ -109,6 +109,9 @@ class FlutterDevice {
...
@@ -109,6 +109,9 @@ class FlutterDevice {
}
}
Future
<
void
>
stopApps
()
async
{
Future
<
void
>
stopApps
()
async
{
if
(!
device
.
supportsStopApp
)
{
return
;
}
final
List
<
FlutterView
>
flutterViews
=
views
;
final
List
<
FlutterView
>
flutterViews
=
views
;
if
(
flutterViews
==
null
||
flutterViews
.
isEmpty
)
if
(
flutterViews
==
null
||
flutterViews
.
isEmpty
)
return
;
return
;
...
...
packages/flutter_tools/test/fuchsia/fuchsa_device_test.dart
View file @
891036c9
...
@@ -36,6 +36,15 @@ void main() {
...
@@ -36,6 +36,15 @@ void main() {
expect
(
names
.
length
,
1
);
expect
(
names
.
length
,
1
);
expect
(
names
.
first
,
'lilia-shore-only-last'
);
expect
(
names
.
first
,
'lilia-shore-only-last'
);
});
});
test
(
'default capabilities'
,
()
async
{
final
FuchsiaDevice
device
=
FuchsiaDevice
(
'123'
);
expect
(
device
.
supportsHotReload
,
true
);
expect
(
device
.
supportsHotRestart
,
false
);
expect
(
device
.
supportsStopApp
,
false
);
expect
(
await
device
.
stopApp
(
null
),
false
);
});
});
});
group
(
'displays friendly error when'
,
()
{
group
(
'displays friendly error when'
,
()
{
...
...
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