Cleaned up deviceType enum
Summary: The device type enum was mixing two different concepts (emulator vs physical) and (archived vs not), and we already have a separate `isArchived` field. So cleaned this up to not leak it into sandy. If anybody can think of any unforeseen consequences of this, lemme know :) Reviewed By: jknoxville Differential Revision: D22763506 fbshipit-source-id: bd2f7dbd1d2d2e6942ba7c6ddd8dc91ee34d591d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fbb1c78184
commit
d538b66088
@@ -7,12 +7,12 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import BaseDevice, {DeviceType} from './BaseDevice';
|
||||
import BaseDevice from './BaseDevice';
|
||||
import adb, {Client as ADBClient} from 'adbkit';
|
||||
import {Priority} from 'adbkit-logcat';
|
||||
import ArchivedDevice from './ArchivedDevice';
|
||||
import {createWriteStream} from 'fs';
|
||||
import {LogLevel} from 'flipper-plugin';
|
||||
import {LogLevel, DeviceType} from 'flipper-plugin';
|
||||
|
||||
const DEVICE_RECORDING_DIR = '/sdcard/flipper_recorder';
|
||||
|
||||
|
||||
@@ -7,21 +7,11 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {DeviceLogEntry} from 'flipper-plugin';
|
||||
import {DeviceLogEntry, DeviceType} from 'flipper-plugin';
|
||||
import BaseDevice from './BaseDevice';
|
||||
import {DeviceType, OS, DeviceShell} from './BaseDevice';
|
||||
import {OS, DeviceShell} from './BaseDevice';
|
||||
import {SupportFormRequestDetailsState} from '../reducers/supportForm';
|
||||
|
||||
function normalizeArchivedDeviceType(deviceType: DeviceType): DeviceType {
|
||||
let archivedDeviceType = deviceType;
|
||||
if (archivedDeviceType === 'emulator') {
|
||||
archivedDeviceType = 'archivedEmulator';
|
||||
} else if (archivedDeviceType === 'physical') {
|
||||
archivedDeviceType = 'archivedPhysical';
|
||||
}
|
||||
return archivedDeviceType;
|
||||
}
|
||||
|
||||
export default class ArchivedDevice extends BaseDevice {
|
||||
constructor(options: {
|
||||
serial: string;
|
||||
@@ -33,12 +23,7 @@ export default class ArchivedDevice extends BaseDevice {
|
||||
source?: string;
|
||||
supportRequestDetails?: SupportFormRequestDetailsState;
|
||||
}) {
|
||||
super(
|
||||
options.serial,
|
||||
normalizeArchivedDeviceType(options.deviceType),
|
||||
options.title,
|
||||
options.os,
|
||||
);
|
||||
super(options.serial, options.deviceType, options.title, options.os);
|
||||
this.logs = options.logEntries;
|
||||
this.source = options.source || '';
|
||||
this.supportRequestDetails = options.supportRequestDetails;
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
DeviceLogEntry,
|
||||
SandyDevicePluginInstance,
|
||||
SandyPluginDefinition,
|
||||
DeviceType,
|
||||
} from 'flipper-plugin';
|
||||
import {DevicePluginMap, FlipperDevicePlugin} from '../plugin';
|
||||
|
||||
@@ -23,12 +24,6 @@ export type DeviceShell = {
|
||||
stdin: stream.Writable;
|
||||
};
|
||||
|
||||
export type DeviceType =
|
||||
| 'emulator'
|
||||
| 'physical'
|
||||
| 'archivedEmulator'
|
||||
| 'archivedPhysical';
|
||||
|
||||
export type DeviceExport = {
|
||||
os: OS;
|
||||
title: string;
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import BaseDevice, {OS, DeviceType} from './BaseDevice';
|
||||
import BaseDevice, {OS} from './BaseDevice';
|
||||
import {DeviceType} from 'flipper-plugin';
|
||||
|
||||
export default class FlipperSelfInspectionDevice extends BaseDevice {
|
||||
constructor(serial: string, deviceType: DeviceType, title: string, os: OS) {
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {LogLevel, DeviceLogEntry} from 'flipper-plugin';
|
||||
import {DeviceType} from './BaseDevice';
|
||||
import {LogLevel, DeviceLogEntry, DeviceType} from 'flipper-plugin';
|
||||
import child_process, {ChildProcess} from 'child_process';
|
||||
import BaseDevice from './BaseDevice';
|
||||
import JSONStream from 'JSONStream';
|
||||
|
||||
Reference in New Issue
Block a user