From 9ba990999caa2bd2be9a7bdb92e93333ff21279e Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 6 Apr 2020 06:34:33 -0700 Subject: [PATCH] Fix connection with old SDKs Summary: D20559197 inadvertantly broke support for old SDKs by properly handling an exception that we previously ignored. However, this meant that Android versions that don't support reverse-proxying will not fail to get registered although they're otherwise supported. Changelog: Fix connections on Android devices with older SDKs (19) Reviewed By: jknoxville Differential Revision: D20868923 fbshipit-source-id: 409fe20a0875dc26ecc971d33264a1145012d586 --- desktop/app/src/dispatcher/androidDevice.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/desktop/app/src/dispatcher/androidDevice.tsx b/desktop/app/src/dispatcher/androidDevice.tsx index d9d12056b..d3f9fb0a1 100644 --- a/desktop/app/src/dispatcher/androidDevice.tsx +++ b/desktop/app/src/dispatcher/androidDevice.tsx @@ -46,7 +46,15 @@ function createDevice( ? KaiOSDevice : AndroidDevice)(device.id, type, name, adbClient); if (ports) { - await androidLikeDevice.reverse([ports.secure, ports.insecure]); + await androidLikeDevice + .reverse([ports.secure, ports.insecure]) + // We may not be able to establish a reverse connection, e.g. for old Android SDKs. + // This is *generally* fine, because we hard-code the ports on the SDK side. + .catch((e) => { + console.warn( + `Failed to reverse-proxy ports on device ${androidLikeDevice.serial}: ${e}`, + ); + }); } resolve(androidLikeDevice); } catch (e) {