fix null device reference

Summary:
Force device type from BaseDevice to AndroidDevice, because we need to access adb inside AndroidDevice.
In long term, we should use DeviceShell from BaseDevice, but that need much more changes.

Differential Revision: D8876082

fbshipit-source-id: 0772a0ac361c5e3eca9c7a590281ffa786501e15
This commit is contained in:
Barney Huang
2018-07-20 03:27:12 -07:00
committed by Facebook Github Bot
parent bfc8bfc164
commit fcfa0409e4

View File

@@ -19,7 +19,9 @@ import {
} from 'sonar';
type ADBClient = any;
type AndroidDevice = any;
type AndroidDevice = {
adb: ADBClient,
};
type TableRows = any;
// we keep vairable name with underline for to physical path mappings on device
@@ -102,7 +104,6 @@ export default class CPUFrequencyTable extends SonarDevicePlugin<CPUState> {
adbClient: ADBClient;
intervalID: ?IntervalID;
device: AndroidDevice;
state = {
cpuFreq: [],
@@ -111,7 +112,8 @@ export default class CPUFrequencyTable extends SonarDevicePlugin<CPUState> {
};
init() {
this.adbClient = this.device.adb;
let device = ((this.device: any): AndroidDevice);
this.adbClient = device.adb;
// check how many cores we have on this device
this.executeShell((output: string) => {