From f89a0fbaa97b7362048f9b0f46b68c1dbb87c0ce Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Tue, 22 Feb 2022 22:04:11 -0800 Subject: [PATCH] Winscope: Introduce ProxyClient class Use new class to share device auth states, adb proxy state and expose functions to talk to proxy. This is the first step before adding new functionality to winscope that will convert transaction traces to layer traces. This functionality needs to be added in DataInput.vue so this class will make it easier to read the proxy state and use the proxy. There should be no functional change in this cl. Test: collect winscope traces via proxy Bug: 200284593 Change-Id: Ic1f492ebec6c8dfd667d0828bb2d6779665b89c2 --- tools/winscope/src/DataAdb.vue | 256 ++++-------------- tools/winscope/src/proxyclient/ProxyClient.ts | 216 +++++++++++++++ 2 files changed, 268 insertions(+), 204 deletions(-) create mode 100644 tools/winscope/src/proxyclient/ProxyClient.ts diff --git a/tools/winscope/src/DataAdb.vue b/tools/winscope/src/DataAdb.vue index 0b1eb8bcf..bb653d94f 100644 --- a/tools/winscope/src/DataAdb.vue +++ b/tools/winscope/src/DataAdb.vue @@ -39,7 +39,7 @@ update The version of Winscope ADB Connect proxy running on your machine is incopatibile with Winscope.
-

Please update the proxy to version {{ WINSCOPE_PROXY_VERSION }}

+

Please update the proxy to version {{ proxyClient.VERSION }}

Run:

python3 $ANDROID_BUILD_TOP/development/tools/winscope/adb_proxy/winscope_proxy.py

Or get it from the AOSP repository.

@@ -54,7 +54,7 @@ Proxy authorisation required - +
The proxy token is printed to console on proxy launch, copy and paste it above.
@@ -62,9 +62,9 @@
-
{{ Object.keys(devices).length > 0 ? "Connected devices:" : "No devices detected" }}
+
{{ Object.keys(proxyClient.devices).length > 0 ? "Connected devices:" : "No devices detected" }}
- + {{ device.authorised ? "smartphone" : "screen_lock_portrait" }} {{ device.authorised ? device.model : "unauthorised" }} ({{ id }}) @@ -76,7 +76,7 @@ smartphone - {{ devices[selectedDevice].model }} ({{ selectedDevice }}) + {{ proxyClient.devices[proxyClient.selectedDevice].model }} ({{ proxyClient.selectedDevice }}) Change device @@ -84,12 +84,12 @@

Trace targets:

- {{ DYNAMIC_TRACES[traceKey].name }} + {{ DYNAMIC_TRACES[traceKey].name }}

Surface Flinger config

- {{config}} + {{config}}
@@ -116,7 +116,7 @@

Dump targets:

- {{DUMPS[dumpKey].name}} + {{DUMPS[dumpKey].name}}
Dump state @@ -145,36 +145,9 @@