From e115592da93241b368b2535d8cbcf89fdf043983 Mon Sep 17 00:00:00 2001 From: zhouyixun <291028775@qq.com> Date: Wed, 6 Oct 2021 23:53:30 +0800 Subject: [PATCH 1/3] per_update --- .../java/com/sonic/agent/automation/AndroidStepHandler.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/sonic/agent/automation/AndroidStepHandler.java b/src/main/java/com/sonic/agent/automation/AndroidStepHandler.java index 9ce08fba..962b6c99 100644 --- a/src/main/java/com/sonic/agent/automation/AndroidStepHandler.java +++ b/src/main/java/com/sonic/agent/automation/AndroidStepHandler.java @@ -257,7 +257,6 @@ public void getPerform() { if (!testPackage.equals("")) { List performanceData = Arrays.asList("memoryinfo", "batteryinfo"); for (String performName : performanceData) { - JSONObject memResult = new JSONObject(); List> re = androidDriver.getPerformanceData(testPackage, performName, 1); List mem; if (performName.equals("memoryinfo")) { @@ -269,8 +268,7 @@ public void getPerform() { for (Integer memNum : mem) { perform.put(re.get(0).get(memNum).toString(), re.get(1).get(memNum)); } - memResult.put("data", perform.toJSONString()); - log.sendPerLog(testPackage, performName.equals("memoryinfo") ? 1 : 2, memResult); + log.sendPerLog(testPackage, performName.equals("memoryinfo") ? 1 : 2, perform); } } } From 37408421e60e27289bf73ea052de5dac77838bb3 Mon Sep 17 00:00:00 2001 From: zhouyixun <291028775@qq.com> Date: Thu, 7 Oct 2021 00:34:07 +0800 Subject: [PATCH 2/3] save_perform --- src/main/java/com/sonic/agent/tools/LogTool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/sonic/agent/tools/LogTool.java b/src/main/java/com/sonic/agent/tools/LogTool.java index fe92c681..be154f67 100644 --- a/src/main/java/com/sonic/agent/tools/LogTool.java +++ b/src/main/java/com/sonic/agent/tools/LogTool.java @@ -137,7 +137,7 @@ public void sendPerLog(String packageName, int type, JSONObject detail) { JSONObject log = new JSONObject(); log.put("msg", "perform"); log.put("des", packageName); - log.put("log", detail); + log.put("log", detail.toJSONString()); log.put("status", type); send(log); } From 28c4391c3a6a55b445f01199aedaeea39a1d5a69 Mon Sep 17 00:00:00 2001 From: zhouyixun <291028775@qq.com> Date: Thu, 7 Oct 2021 16:47:58 +0800 Subject: [PATCH 3/3] update_match_point --- src/main/java/com/sonic/agent/cv/SIFTFinder.java | 2 +- src/main/java/com/sonic/agent/tests/AndroidTests.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sonic/agent/cv/SIFTFinder.java b/src/main/java/com/sonic/agent/cv/SIFTFinder.java index f4da72bb..b8315c07 100644 --- a/src/main/java/com/sonic/agent/cv/SIFTFinder.java +++ b/src/main/java/com/sonic/agent/cv/SIFTFinder.java @@ -62,7 +62,7 @@ public FindResult getSIFTFindResult(File temFile, File beforeFile) throws Except } } logger.info("处理后匹配数:" + goodMatches.size()); - if (goodMatches.size() == 0) { + if (goodMatches.size() <= 4) { temFile.delete(); beforeFile.delete(); return null; diff --git a/src/main/java/com/sonic/agent/tests/AndroidTests.java b/src/main/java/com/sonic/agent/tests/AndroidTests.java index b1a78302..98da89b5 100644 --- a/src/main/java/com/sonic/agent/tests/AndroidTests.java +++ b/src/main/java/com/sonic/agent/tests/AndroidTests.java @@ -196,6 +196,7 @@ public void run(Channel channel, long tag, JSONObject jsonObject) throws IOExcep if (isSupportRecord) { if (androidStepHandler.getStatus() == 3) { androidStepHandler.stopRecord(udId); + return; } else { androidStepHandler.getAndroidDriver().stopRecordingScreen(); } @@ -216,6 +217,7 @@ public void run(Channel channel, long tag, JSONObject jsonObject) throws IOExcep } catch (FrameRecorder.Exception e) { e.printStackTrace(); } + return; } } }