[flutter_tools] flutter logs no longer requires supported device (#66696)

Flutter logs should not attempt to filter the device list based on the current project, because it does not require a current project. Also fix disabled polling test

Fixes #47996
Fixes #63550
This commit is contained in:
Jonah Williams
2020-10-02 21:12:50 -07:00
committed by GitHub
parent 33fb35e951
commit 1bea512a83
7 changed files with 58 additions and 35 deletions

View File

@@ -1005,13 +1005,18 @@ abstract class FlutterCommand extends Command<void> {
/// devices and criteria entered by the user on the command line.
/// If no device can be found that meets specified criteria,
/// then print an error message and return null.
Future<List<Device>> findAllTargetDevices() async {
Future<List<Device>> findAllTargetDevices({
bool includeUnsupportedDevices = false,
}) async {
if (!globals.doctor.canLaunchAnything) {
globals.printError(userMessages.flutterNoDevelopmentDevice);
return null;
}
final DeviceManager deviceManager = globals.deviceManager;
List<Device> devices = await deviceManager.findTargetDevices(FlutterProject.current(), timeout: deviceDiscoveryTimeout);
List<Device> devices = await deviceManager.findTargetDevices(
includeUnsupportedDevices ? null : FlutterProject.current(),
timeout: deviceDiscoveryTimeout,
);
if (devices.isEmpty && deviceManager.hasSpecifiedDeviceId) {
globals.printStatus(userMessages.flutterNoMatchingDevice(deviceManager.specifiedDeviceId));
@@ -1057,8 +1062,13 @@ abstract class FlutterCommand extends Command<void> {
/// devices and criteria entered by the user on the command line.
/// If a device cannot be found that meets specified criteria,
/// then print an error message and return null.
Future<Device> findTargetDevice() async {
List<Device> deviceList = await findAllTargetDevices();
///
/// If [includeUnsupportedDevices] is true, the tool does not filter
/// the list by the current project support list.
Future<Device> findTargetDevice({
bool includeUnsupportedDevices = false,
}) async {
List<Device> deviceList = await findAllTargetDevices(includeUnsupportedDevices: includeUnsupportedDevices);
if (deviceList == null) {
return null;
}