Initial support for KaiOS device plugins
Summary: Introduces basic KaiOSDevice class. Since kaios phones support adb, it is inherited from AndroidDevice Reviewed By: jknoxville Differential Revision: D17608605 fbshipit-source-id: 6b2c5834a1f5862b864c8e76202d0d401e58cbcc
This commit is contained in:
committed by
Facebook Github Bot
parent
1c9fc75457
commit
dda800c4a3
16
src/devices/KaiOSDevice.tsx
Normal file
16
src/devices/KaiOSDevice.tsx
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 2018-present Facebook.
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
* @format
|
||||||
|
*/
|
||||||
|
|
||||||
|
import AndroidDevice from './AndroidDevice';
|
||||||
|
|
||||||
|
export default class KaiOSDevice extends AndroidDevice {
|
||||||
|
async screenCaptureAvailable() {
|
||||||
|
// The default way of capturing screenshots through adb does not seem to work
|
||||||
|
// There is a way of getting a screenshot through KaiOS dev tools though
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import AndroidDevice from '../devices/AndroidDevice';
|
import AndroidDevice from '../devices/AndroidDevice';
|
||||||
|
import KaiOSDevice from '../devices/KaiOSDevice';
|
||||||
import child_process from 'child_process';
|
import child_process from 'child_process';
|
||||||
import {Store} from '../reducers/index';
|
import {Store} from '../reducers/index';
|
||||||
import BaseDevice from '../devices/BaseDevice';
|
import BaseDevice from '../devices/BaseDevice';
|
||||||
@@ -33,11 +34,16 @@ function createDevice(
|
|||||||
if (type === 'emulator') {
|
if (type === 'emulator') {
|
||||||
name = (await getRunningEmulatorName(device.id)) || name;
|
name = (await getRunningEmulatorName(device.id)) || name;
|
||||||
}
|
}
|
||||||
const androidDevice = new AndroidDevice(device.id, type, name, adbClient);
|
const isKaiOSDevice = Object.keys(props).some(
|
||||||
|
name => name.startsWith('kaios') || name.startsWith('ro.kaios'),
|
||||||
|
);
|
||||||
|
const androidLikeDevice = new (isKaiOSDevice
|
||||||
|
? KaiOSDevice
|
||||||
|
: AndroidDevice)(device.id, type, name, adbClient);
|
||||||
if (ports) {
|
if (ports) {
|
||||||
androidDevice.reverse([ports.secure, ports.insecure]);
|
androidLikeDevice.reverse([ports.secure, ports.insecure]);
|
||||||
}
|
}
|
||||||
resolve(androidDevice);
|
resolve(androidLikeDevice);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user