Restore device icons [3/n]

Summary: Restored support for device icons which was disabled in previous diff

Reviewed By: passy

Differential Revision: D31054802

fbshipit-source-id: 107a53f06159211534cb9a2316340af7a7ca530a
This commit is contained in:
Michel Weststrate
2021-09-22 09:01:29 -07:00
committed by Facebook GitHub Bot
parent 2d838efd4d
commit 3428ce2968
7 changed files with 15 additions and 7 deletions

View File

@@ -44,9 +44,9 @@ export default class ArchivedDevice extends BaseDevice {
title: options.title, title: options.title,
os: options.os, os: options.os,
serial: options.serial, serial: options.serial,
icon: 'box',
}, },
); );
this.icon = 'box';
this.connected.set(false); this.connected.set(false);
this.source = options.source || ''; this.source = options.source || '';
this.supportRequestDetails = options.supportRequestDetails; this.supportRequestDetails = options.supportRequestDetails;

View File

@@ -79,7 +79,9 @@ export default class BaseDevice {
} }
// possible src of icon to display next to the device title // possible src of icon to display next to the device title
icon: string | null | undefined; get icon() {
return this.description.icon;
}
logListeners: Map<Symbol, DeviceLogListener> = new Map(); logListeners: Map<Symbol, DeviceLogListener> = new Map();

View File

@@ -41,12 +41,12 @@ export default class AndroidDevice extends ServerDevice {
deviceType, deviceType,
title, title,
os: 'Android', os: 'Android',
icon: 'mobile',
specs, specs,
abiList, abiList,
sdkVersion, sdkVersion,
}); });
this.adb = adb; this.adb = adb;
// TODO: this.icon = 'mobile';
} }
startLogging() { startLogging() {

View File

@@ -17,7 +17,7 @@ export default class MacDevice extends ServerDevice {
deviceType: 'physical', deviceType: 'physical',
title: 'Mac', title: 'Mac',
os: 'MacOS', os: 'MacOS',
icon: 'app-apple',
}); });
// TODO: this.icon = 'app-apple';
} }
} }

View File

@@ -17,7 +17,7 @@ export default class WindowsDevice extends ServerDevice {
deviceType: 'physical', deviceType: 'physical',
title: 'Windows', title: 'Windows',
os: 'Windows', os: 'Windows',
icon: 'app-microsoft-windows',
}); });
// TODO: this.icon = 'app-microsoft-windows';
} }
} }

View File

@@ -53,8 +53,13 @@ export default class IOSDevice extends ServerDevice {
deviceType: DeviceType, deviceType: DeviceType,
title: string, title: string,
) { ) {
super(flipperServer, {serial, deviceType, title, os: 'iOS'}); super(flipperServer, {
// TODO: this.icon = 'mobile'; serial,
deviceType,
title,
os: 'iOS',
icon: 'mobile',
});
this.buffer = ''; this.buffer = '';
this.iOSBridge = iOSBridge; this.iOSBridge = iOSBridge;
} }

View File

@@ -33,6 +33,7 @@ export type DeviceDescription = {
readonly title: string; readonly title: string;
readonly deviceType: DeviceType; readonly deviceType: DeviceType;
readonly serial: string; readonly serial: string;
readonly icon?: string;
// Android specific information // Android specific information
readonly specs?: DeviceSpec[]; readonly specs?: DeviceSpec[];
readonly abiList?: string[]; readonly abiList?: string[];