change device plugin support check

Summary: Invert the way device plugin <-> device support works with the long term goal of supporting user defined device plugins

Reviewed By: danielbuechele

Differential Revision: D10240765

fbshipit-source-id: 9e886518a2fbfd263c79daa4b805c088ab38ab87
This commit is contained in:
Alex Langenfeld
2018-10-10 18:28:21 -07:00
committed by Facebook Github Bot
parent 069f2be335
commit 7527636a38
8 changed files with 18 additions and 31 deletions

View File

@@ -23,9 +23,6 @@ export default class AndroidDevice extends BaseDevice {
) {
super(serial, deviceType, title);
this.adb = adb;
if (deviceType == 'physical') {
this.supportedPlugins.push('DeviceCPU');
}
this.adb.openLogcat(this.serial).then(reader => {
reader.on('entry', entry => {
@@ -63,12 +60,6 @@ export default class AndroidDevice extends BaseDevice {
});
}
supportedPlugins = [
'DeviceLogs',
'DeviceShell',
'DeviceFiles',
'DeviceScreen',
];
icon = 'icons/android.svg';
os = 'Android';
adb: ADBClient;

View File

@@ -56,9 +56,6 @@ export default class BaseDevice {
// serial number for this device
serial: string;
// supported device plugins for this platform
supportedPlugins: Array<string> = [];
// possible src of icon to display next to the device title
icon: ?string;
@@ -69,10 +66,6 @@ export default class BaseDevice {
return os.toLowerCase() === this.os.toLowerCase();
}
supportsPlugin = (DevicePlugin: Class<FlipperDevicePlugin<>>): boolean => {
return this.supportedPlugins.includes(DevicePlugin.id);
};
toJSON() {
return `<${this.constructor.name}#${this.title}>`;
}

View File

@@ -31,7 +31,6 @@ type RawLogEntry = {|
|};
export default class IOSDevice extends BaseDevice {
supportedPlugins = ['DeviceLogs'];
icon = 'icons/ios.svg';
os = 'iOS';

View File

@@ -8,8 +8,7 @@
import BaseDevice from './BaseDevice.js';
export default class WindowsDevice extends BaseDevice {
supportedPlugins = [];
os = 'windows';
os = 'Windows';
constructor() {
super('', 'physical', 'desktop');