Set device features on device initialization
Summary: 1. Identify if device supports screenshots/screen recording when it is created. 2. Disable screen recording/screenshot buttons when they are not supported Reviewed By: passy Differential Revision: D34611133 fbshipit-source-id: 82ad2d67e4af482d9becf7995187667b5d99bc36
This commit is contained in:
committed by
Facebook GitHub Bot
parent
04e7c7282b
commit
6c74f2dd18
@@ -44,25 +44,19 @@ export abstract class ServerDevice {
|
||||
*/
|
||||
disconnect(): void {
|
||||
this.connected = false;
|
||||
this.info.features.screenCaptureAvailable = false;
|
||||
this.info.features.screenshotAvailable = false;
|
||||
this.logListener.stop();
|
||||
this.crashWatcher.stop();
|
||||
this.flipperServer.pluginManager.stopAllServerAddOns(this.info.serial);
|
||||
}
|
||||
|
||||
async screenshotAvailable(): Promise<boolean> {
|
||||
return false;
|
||||
}
|
||||
|
||||
screenshot(): Promise<Buffer> {
|
||||
return Promise.reject(
|
||||
new Error('No screenshot support for current device'),
|
||||
);
|
||||
}
|
||||
|
||||
async screenCaptureAvailable(): Promise<boolean> {
|
||||
return false;
|
||||
}
|
||||
|
||||
async startScreenCapture(_destination: string): Promise<void> {
|
||||
throw new Error('startScreenCapture not implemented on BaseDevice ');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user