From 9b1dae1cda804b4ddd3a0bdcc9df259f95650957 Mon Sep 17 00:00:00 2001 From: Maria Guseva Date: Tue, 24 May 2016 10:44:02 +0300 Subject: [PATCH] SRADA-656: StopTraceManager.run() fixed to work in CLI mode. Wraped UI-related parts with Global.isGUIMode() checks. Also fixed ReplayManager.resetStopAlarm() the same way as it is called in StopTraceManager.run(). Conflicts: org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/control/StopTraceManager.java Change-Id: Ia9c6c73fe28b05bca4a8c9060ec478e26ab4f2e6 --- .../tizen/dynamicanalyzer/control/StopTraceManager.java | 15 ++++++++++----- .../org/tizen/dynamicanalyzer/handlers/ReplayManager.java | 6 ++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/control/StopTraceManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/control/StopTraceManager.java index 3944ca1..5ec3912 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/control/StopTraceManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/control/StopTraceManager.java @@ -84,7 +84,9 @@ public class StopTraceManager implements Runnable { Thread stopTimers = new Thread(new Runnable() { public void run() { - Toolbar.INSTANCE.stopTimer(); + if (Global.isGUIMode()) { + Toolbar.INSTANCE.stopTimer(); + } // stop replay timer ReplayManager.resetStopAlarm(); // stop screenshot timer @@ -147,7 +149,9 @@ public class StopTraceManager implements Runnable { Project project = Global.getProject(); if (project != null && project.isValid()) { - project.setTotalStopTime(Toolbar.INSTANCE.getTime()); + if (Global.isGUIMode()) { + project.setTotalStopTime(Toolbar.INSTANCE.getTime()); + } } else { Logger.error("project is not valid to save"); } @@ -184,9 +188,10 @@ public class StopTraceManager implements Runnable { progressDlg.setOkEnabled(true); } } - - updateHeapDataManager(); - updateToolbar(); + if (Global.isGUIMode()) { + updateHeapDataManager(); + updateToolbar(); + } } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/ReplayManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/ReplayManager.java index 25ede43..54b9b68 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/ReplayManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/ReplayManager.java @@ -28,8 +28,8 @@ package org.tizen.dynamicanalyzer.handlers; import org.tizen.dynamicanalyzer.common.DAResult; -import org.tizen.dynamicanalyzer.common.Global; import org.tizen.dynamicanalyzer.common.DAResult.ErrorCode; +import org.tizen.dynamicanalyzer.common.Global; import org.tizen.dynamicanalyzer.model.DATime; import org.tizen.dynamicanalyzer.setting.FlatPreferences; import org.tizen.dynamicanalyzer.setting.SettingDataManager; @@ -69,7 +69,9 @@ public class ReplayManager { } public static void resetStopAlarm() { - Toolbar.INSTANCE.removeTimerAlarm(); + if (Global.isGUIMode()) { + Toolbar.INSTANCE.removeTimerAlarm(); + } reset(); } -- 2.7.4