Disable gesture logging

We're reconsidering how this feature operates, and will be redesigning
it over the coming months.

This breaks the touch tests, which rely on the logging mechanism.
They'll be fixed in an upcoming CL.

BUG=b:184385681,chromium:1196261
TEST=use the touchpad, create a system logs ZIP, and check that no
     touches or gestures are recorded

Change-Id: Ia8724c8227a4412fa5b51694bac6496371024808
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/2818205
Tested-by: Harry Cutts <hcutts@chromium.org>
Auto-Submit: Harry Cutts <hcutts@chromium.org>
Reviewed-by: Sean O'Brien <seobrien@chromium.org>
Commit-Queue: Harry Cutts <hcutts@chromium.org>
(cherry picked from commit 1ab35cbc47c6a6abc16d349684ff4720ec3ac483)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/2821638
Commit-Queue: Sean O'Brien <seobrien@chromium.org>
diff --git a/include/interpreter.h b/include/interpreter.h
index 6f76bfa..d899ad4 100644
--- a/include/interpreter.h
+++ b/include/interpreter.h
@@ -91,7 +91,6 @@
  private:
   const char* name_;
   Tracer* tracer_;
-  void LogOutputs(const Gesture* result, stime_t* timeout, const char* action);
 };
 }  // namespace gestures
 
diff --git a/src/interpreter.cc b/src/interpreter.cc
index 0f5913d..3098fbb 100644
--- a/src/interpreter.cc
+++ b/src/interpreter.cc
@@ -49,36 +49,23 @@
 void Interpreter::SyncInterpret(HardwareState* hwstate,
                                     stime_t* timeout) {
   AssertWithReturn(initialized_);
-  if (log_.get() && hwstate) {
-    Trace("log: start: ", "LogHardwareState");
-    log_->LogHardwareState(*hwstate);
-    Trace("log: end: ", "LogHardwareState");
-  }
   if (own_metrics_)
     own_metrics_->Update(*hwstate);
 
   Trace("SyncInterpret: start: ", name());
   SyncInterpretImpl(hwstate, timeout);
   Trace("SyncInterpret: end: ", name());
-  LogOutputs(NULL, timeout, "SyncLogOutputs");
 }
 
 void Interpreter::HandleTimer(stime_t now, stime_t* timeout) {
   AssertWithReturn(initialized_);
-  if (log_.get()) {
-    Trace("log: start: ", "LogTimerCallback");
-    log_->LogTimerCallback(now);
-    Trace("log: end: ", "LogTimerCallback");
-  }
   Trace("HandleTimer: start: ", name());
   HandleTimerImpl(now, timeout);
   Trace("HandleTimer: end: ", name());
-  LogOutputs(NULL, timeout, "TimerLogOutputs");
 }
 
 void Interpreter::ProduceGesture(const Gesture& gesture) {
   AssertWithReturn(initialized_);
-  LogOutputs(&gesture, NULL, "ProduceGesture");
   consumer_->ConsumeGesture(gesture);
 }
 
@@ -143,17 +130,4 @@
     free(full_name);
   }
 }
-
-void Interpreter::LogOutputs(const Gesture* result,
-                             stime_t* timeout,
-                             const char* action) {
-  if (!log_.get())
-    return;
-  Trace("log: start: ", action);
-  if (result)
-    log_->LogGesture(*result);
-  if (timeout && *timeout >= 0.0)
-    log_->LogCallbackRequest(*timeout);
-  Trace("log: end: ", action);
-}
 }  // namespace gestures
diff --git a/src/interpreter_unittest.cc b/src/interpreter_unittest.cc
index 6653cca..9ad77e3 100644
--- a/src/interpreter_unittest.cc
+++ b/src/interpreter_unittest.cc
@@ -125,64 +125,5 @@
   ASSERT_LT(timeout, 0);
   EXPECT_EQ(1, base_interpreter->interpret_call_count_);
   EXPECT_EQ(1, base_interpreter->handle_timer_call_count_);
-
-  // Now, get the log
-  string initial_log = base_interpreter->Encode();
-  // Make a new interpreter and push the log through it
-  PropRegistry prop_reg2;
-  InterpreterTestInterpreter* base_interpreter2 =
-      new InterpreterTestInterpreter(&prop_reg2);
-  base_interpreter2->return_value_ = base_interpreter->return_value_;
-  base_interpreter2->expected_interpreter_name_ = interpreter_name;
-  MetricsProperties mprops2(&prop_reg2);
-
-  ActivityReplay replay(&prop_reg2);
-  replay.Parse(initial_log);
-
-  base_interpreter2->expected_hwstate_ = &hardware_state;
-
-  replay.Replay(base_interpreter2, &mprops2);
-  string final_log = base_interpreter2->Encode();
-  EXPECT_EQ(initial_log, final_log);
-  EXPECT_EQ(1, base_interpreter2->interpret_call_count_);
-  EXPECT_EQ(1, base_interpreter2->handle_timer_call_count_);
-}
-
-class InterpreterResetLogTestInterpreter : public Interpreter {
- public:
-  InterpreterResetLogTestInterpreter() : Interpreter(NULL, NULL, true) {
-    log_.reset(new ActivityLog(NULL));
-  }
- protected:
-  virtual void SyncInterpretImpl(HardwareState* hwstate,
-                                     stime_t* timeout) {}
-
-  virtual void HandleTimerImpl(stime_t now, stime_t* timeout) {}
-};
-
-TEST(InterpreterTest, ResetLogTest) {
-  PropRegistry prop_reg;
-  InterpreterResetLogTestInterpreter* base_interpreter =
-      new InterpreterResetLogTestInterpreter();
-  TestInterpreterWrapper wrapper(base_interpreter);
-
-  FingerState finger_state = {
-    // TM, Tm, WM, Wm, Press, Orientation, X, Y, TrID
-    0, 0, 0, 0, 10, 0, 50, 50, 1, 0
-  };
-  HardwareState hardware_state = make_hwstate(200000, 0, 1, 1, &finger_state);
-  stime_t timeout = NO_DEADLINE;
-  wrapper.SyncInterpret(&hardware_state, &timeout);
-  EXPECT_EQ(base_interpreter->log_->size(), 1);
-
-  wrapper.SyncInterpret(&hardware_state, &timeout);
-  EXPECT_EQ(base_interpreter->log_->size(), 2);
-
-  // Assume the ResetLog property is set.
-  base_interpreter->Clear();
-  EXPECT_EQ(base_interpreter->log_->size(), 0);
-
-  wrapper.SyncInterpret(&hardware_state, &timeout);
-  EXPECT_EQ(base_interpreter->log_->size(), 1);
 }
 }  // namespace gestures
diff --git a/src/logging_filter_interpreter_unittest.cc b/src/logging_filter_interpreter_unittest.cc
index c058222..3e190c0 100644
--- a/src/logging_filter_interpreter_unittest.cc
+++ b/src/logging_filter_interpreter_unittest.cc
@@ -18,54 +18,4 @@
 
 class LoggingFilterInterpreterTest : public ::testing::Test {};
 
-class LoggingFilterInterpreterResetLogTestInterpreter : public Interpreter {
- public:
-  LoggingFilterInterpreterResetLogTestInterpreter()
-      : Interpreter(NULL, NULL, false) {}
- protected:
-  virtual void SyncInterpretImpl(HardwareState* hwstate,
-                                     stime_t* timeout) {}
-  virtual void SetHardwarePropertiesImpl(const HardwareProperties& hw_props) {
-  }
-  virtual void HandleTimerImpl(stime_t now, stime_t* timeout) {}
-};
-
-TEST(LoggingFilterInterpreterTest, LogResetHandlerTest) {
-  PropRegistry prop_reg;
-  LoggingFilterInterpreterResetLogTestInterpreter* base_interpreter =
-      new LoggingFilterInterpreterResetLogTestInterpreter();
-  LoggingFilterInterpreter interpreter(&prop_reg, base_interpreter, NULL);
-
-  HardwareProperties hwprops = {
-    0, 0, 100, 100,  // left, top, right, bottom
-    10,  // x res (pixels/mm)
-    10,  // y res (pixels/mm)
-    133, 133,  // scrn DPI X, Y
-    -1,  // orientation minimum
-    2,   // orientation maximum
-    2, 5,  // max fingers, max_touch,
-    1, 0, 0,  // t5r2, semi, button pad
-    0, 0,  // has wheel, vertical wheel is high resolution
-  };
-
-  TestInterpreterWrapper wrapper(&interpreter, &hwprops);
-  FingerState finger_state = {
-    // TM, Tm, WM, Wm, Press, Orientation, X, Y, TrID
-    0, 0, 0, 0, 10, 0, 50, 50, 1, 0
-  };
-  HardwareState hardware_state = make_hwstate(200000, 0, 1, 1, &finger_state);
-  stime_t timeout = NO_DEADLINE;
-  wrapper.SyncInterpret(&hardware_state, &timeout);
-  EXPECT_EQ(interpreter.log_->size(), 1);
-
-  wrapper.SyncInterpret(&hardware_state, &timeout);
-  EXPECT_EQ(interpreter.log_->size(), 2);
-
-  // Assume the ResetLog property is set.
-  interpreter.logging_reset_.HandleGesturesPropWritten();
-  EXPECT_EQ(interpreter.log_->size(), 0);
-
-  wrapper.SyncInterpret(&hardware_state, &timeout);
-  EXPECT_EQ(interpreter.log_->size(), 1);
-}
 }  // namespace gestures