From 7361ecc080abb89baa4ff6ad8bc1705f4bdbc3e3 Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Tue, 9 Feb 2021 04:12:09 -0800 Subject: [PATCH] Disable CPU plugin on archived devices Summary: Changelog: CPU plugin will no longer show up for archived devices CPU plugin did show up on imported devices, but would always result in exceptions as no `adb` connection is available for them. Reviewed By: jknoxville Differential Revision: D26249575 fbshipit-source-id: c4fa7b3fec895f9c4ab9e31dce2f61fb23e9195b --- desktop/plugins/cpu/index.tsx | 6 +++++- desktop/plugins/cpu/package.json | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/desktop/plugins/cpu/index.tsx b/desktop/plugins/cpu/index.tsx index 04cc3105b..587a24770 100644 --- a/desktop/plugins/cpu/index.tsx +++ b/desktop/plugins/cpu/index.tsx @@ -143,7 +143,11 @@ export default class CPUFrequencyTable extends FlipperDevicePlugin< }; static supportsDevice(device: Device) { - return device.os === 'Android' && device.deviceType === 'physical'; + return ( + device.os === 'Android' && + device.deviceType === 'physical' && + !device.isArchived + ); } init() { diff --git a/desktop/plugins/cpu/package.json b/desktop/plugins/cpu/package.json index e59634c00..39eddf86e 100644 --- a/desktop/plugins/cpu/package.json +++ b/desktop/plugins/cpu/package.json @@ -4,7 +4,11 @@ "id": "DeviceCPU", "pluginType": "device", "supportedDevices": [ - {"os": "Android", "type": "physical"} + { + "os": "Android", + "type": "physical", + "archived": false + } ], "version": "0.0.0", "main": "dist/bundle.js",