Migrate AndroidDevice from js to tsx
Summary: As per the title Reviewed By: jknoxville Differential Revision: D16667269 fbshipit-source-id: d213f4ebacf8050ae55a8e3268909da8535f2d93
This commit is contained in:
committed by
Facebook Github Bot
parent
f26a28f6f6
commit
eb26a74327
@@ -9,7 +9,6 @@ import {Button, Component, styled} from 'flipper';
|
|||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
|
|
||||||
import type BaseDevice from '../devices/BaseDevice.tsx';
|
import type BaseDevice from '../devices/BaseDevice.tsx';
|
||||||
import AndroidDevice from '../devices/AndroidDevice';
|
|
||||||
|
|
||||||
type OwnProps = {|
|
type OwnProps = {|
|
||||||
locations: Array<string>,
|
locations: Array<string>,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
import {Button, ButtonGroup, Component} from 'flipper';
|
import {Button, ButtonGroup, Component} from 'flipper';
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import AndroidDevice from '../devices/AndroidDevice';
|
import AndroidDevice from '../devices/AndroidDevice.tsx';
|
||||||
import IOSDevice from '../devices/IOSDevice';
|
import IOSDevice from '../devices/IOSDevice';
|
||||||
import expandTilde from 'expand-tilde';
|
import expandTilde from 'expand-tilde';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|||||||
@@ -5,12 +5,11 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {DeviceType, DeviceShell} from './BaseDevice.tsx';
|
import BaseDevice, {DeviceType, DeviceShell, LogLevel} from './BaseDevice';
|
||||||
import BaseDevice from './BaseDevice.tsx';
|
|
||||||
import {Priority} from 'adbkit-logcat-fb';
|
import {Priority} from 'adbkit-logcat-fb';
|
||||||
import child_process from 'child_process';
|
import child_process from 'child_process';
|
||||||
import child_process_promise from 'child-process-es6-promise';
|
import child_process_promise from 'child-process-es6-promise';
|
||||||
import ArchivedDevice from './ArchivedDevice.tsx';
|
import ArchivedDevice from './ArchivedDevice';
|
||||||
|
|
||||||
type ADBClient = any;
|
type ADBClient = any;
|
||||||
|
|
||||||
@@ -23,10 +22,11 @@ export default class AndroidDevice extends BaseDevice {
|
|||||||
) {
|
) {
|
||||||
super(serial, deviceType, title);
|
super(serial, deviceType, title);
|
||||||
this.adb = adb;
|
this.adb = adb;
|
||||||
|
this.os = 'Android';
|
||||||
|
this.icon = 'icons/android.svg';
|
||||||
this.adb.openLogcat(this.serial).then(reader => {
|
this.adb.openLogcat(this.serial).then(reader => {
|
||||||
reader.on('entry', entry => {
|
reader.on('entry', entry => {
|
||||||
let type = 'unknown';
|
let type: LogLevel = 'unknown';
|
||||||
if (entry.priority === Priority.VERBOSE) {
|
if (entry.priority === Priority.VERBOSE) {
|
||||||
type = 'verbose';
|
type = 'verbose';
|
||||||
}
|
}
|
||||||
@@ -58,8 +58,6 @@ export default class AndroidDevice extends BaseDevice {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
icon = 'icons/android.svg';
|
|
||||||
os = 'Android';
|
|
||||||
adb: ADBClient;
|
adb: ADBClient;
|
||||||
pidAppMapping: {[key: number]: string} = {};
|
pidAppMapping: {[key: number]: string} = {};
|
||||||
logReader: any;
|
logReader: any;
|
||||||
@@ -78,7 +76,7 @@ export default class AndroidDevice extends BaseDevice {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
spawnShell(): ?DeviceShell {
|
spawnShell(): DeviceShell | null | undefined {
|
||||||
return child_process.spawn('adb', ['-s', this.serial, 'shell', '-t', '-t']);
|
return child_process.spawn('adb', ['-s', this.serial, 'shell', '-t', '-t']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import AndroidDevice from '../devices/AndroidDevice';
|
import AndroidDevice from '../devices/AndroidDevice.tsx';
|
||||||
import child_process from 'child_process';
|
import child_process from 'child_process';
|
||||||
import type {Store} from '../reducers/index.tsx';
|
import type {Store} from '../reducers/index.tsx';
|
||||||
import type BaseDevice from '../devices/BaseDevice.tsx';
|
import type BaseDevice from '../devices/BaseDevice.tsx';
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ export {default as isProduction} from './utils/isProduction.js';
|
|||||||
export {createTablePlugin} from './createTablePlugin.js';
|
export {createTablePlugin} from './createTablePlugin.js';
|
||||||
export {default as DetailSidebar} from './chrome/DetailSidebar.js';
|
export {default as DetailSidebar} from './chrome/DetailSidebar.js';
|
||||||
|
|
||||||
export {default as AndroidDevice} from './devices/AndroidDevice.js';
|
|
||||||
export {default as Device} from './devices/BaseDevice.tsx';
|
export {default as Device} from './devices/BaseDevice.tsx';
|
||||||
|
export {default as AndroidDevice} from './devices/AndroidDevice.tsx';
|
||||||
export {default as ArchivedDevice} from './devices/ArchivedDevice.tsx';
|
export {default as ArchivedDevice} from './devices/ArchivedDevice.tsx';
|
||||||
export {default as IOSDevice} from './devices/IOSDevice.js';
|
export {default as IOSDevice} from './devices/IOSDevice.js';
|
||||||
export type {OS} from './devices/BaseDevice.tsx';
|
export type {OS} from './devices/BaseDevice.tsx';
|
||||||
|
|||||||
Reference in New Issue
Block a user