From e87418749c815ceadcf02b1186b266a96a3fa080 Mon Sep 17 00:00:00 2001 From: Eason <291028775@qq.com> Date: Fri, 9 Jun 2023 22:37:15 +0800 Subject: [PATCH] fix: fix some unuse yml params, see https://sonic-cloud.wiki/d/3268-253configapplication-sonic-agent253 --- .../agent/transport/TransportClient.java | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/cloud/sonic/agent/transport/TransportClient.java b/src/main/java/org/cloud/sonic/agent/transport/TransportClient.java index cff9918d..24c5aec7 100755 --- a/src/main/java/org/cloud/sonic/agent/transport/TransportClient.java +++ b/src/main/java/org/cloud/sonic/agent/transport/TransportClient.java @@ -63,8 +63,6 @@ public class TransportClient extends WebSocketClient { String host = String.valueOf(SpringTool.getPropertiesValue("sonic.agent.host")); String version = String.valueOf(SpringTool.getPropertiesValue("spring.version")); Integer port = Integer.valueOf(SpringTool.getPropertiesValue("sonic.agent.port")); - Boolean isEnableAndroid = Boolean.valueOf(SpringTool.getPropertiesValue("modules.android.enable")); - Boolean isEnableIOS = Boolean.valueOf(SpringTool.getPropertiesValue("modules.ios.enable")); public TransportClient(URI serverUri) { super(serverUri); @@ -256,26 +254,22 @@ public void onMessage(String s) { agentInfo.put("host", host); agentInfo.put("hasHub", PHCTool.isSupport() ? 1 : 0); TransportWorker.client.send(agentInfo.toJSONString()); - if (isEnableAndroid) { - IDevice[] iDevices = AndroidDeviceBridgeTool.getRealOnLineDevices(); - for (IDevice d : iDevices) { - String status = AndroidDeviceManagerMap.getStatusMap().get(d.getSerialNumber()); - if (status != null) { - AndroidDeviceLocalStatus.send(d.getSerialNumber(), status); - } else { - AndroidDeviceLocalStatus.send(d.getSerialNumber(), d.getState() == null ? null : d.getState().toString()); - } + IDevice[] iDevices = AndroidDeviceBridgeTool.getRealOnLineDevices(); + for (IDevice d : iDevices) { + String status = AndroidDeviceManagerMap.getStatusMap().get(d.getSerialNumber()); + if (status != null) { + AndroidDeviceLocalStatus.send(d.getSerialNumber(), status); + } else { + AndroidDeviceLocalStatus.send(d.getSerialNumber(), d.getState() == null ? null : d.getState().toString()); } } - if (isEnableIOS) { - List udIds = SibTool.getDeviceList(); - for (String u : udIds) { - String status = IOSDeviceManagerMap.getMap().get(u); - if (status != null) { - IOSDeviceLocalStatus.send(u, status); - } else { - IOSDeviceLocalStatus.send(u, DeviceStatus.ONLINE); - } + List udIds = SibTool.getDeviceList(); + for (String u : udIds) { + String status = IOSDeviceManagerMap.getMap().get(u); + if (status != null) { + IOSDeviceLocalStatus.send(u, status); + } else { + IOSDeviceLocalStatus.send(u, DeviceStatus.ONLINE); } } } else {