diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index e24adf9..f834c6a 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -150,7 +150,6 @@
     static final boolean DEBUG_WIDGETS = false;
     static final boolean DEBUG_STRICT_MODE = false;
     static final boolean DEBUG_RESUME_TIME = false;
-    static final boolean DEBUG_LOGGING = false;
 
     private static final int REQUEST_CREATE_SHORTCUT = 1;
     private static final int REQUEST_CREATE_APPWIDGET = 5;
@@ -628,29 +627,6 @@
         }
     }
 
-    /**
-     * Logger object is a singleton and does not have to be coupled with the foreground activity.
-     * Since most user event logging is done on the UI, the object is retrieved from the
-     * callback for convenience.
-     */
-    private UserEventDispatcher createUserEventDispatcher() {
-        return new UserEventDispatcher() {
-            @Override
-            public void dispatchUserEvent(LauncherLogProto.LauncherEvent ev, Intent intent) {
-                if (!DEBUG_LOGGING) {
-                    return;
-                }
-                Log.d("UserEvent", String.format(Locale.US,
-                        "action:%s\nchild:%s\nparent:%s\nelapsed container %d ms session %d ms",
-                        LoggerUtils.getActionStr(ev.action),
-                        LoggerUtils.getTargetStr(ev.srcTarget[0]),
-                        LoggerUtils.getTargetStr(ev.srcTarget[1]),
-                        ev.elapsedContainerMillis,
-                        ev.elapsedSessionMillis));
-            }
-        };
-    }
-
     public UserEventDispatcher getUserEventDispatcher() {
         if (mLauncherCallbacks != null) {
             UserEventDispatcher dispatcher = mLauncherCallbacks.getUserEventDispatcher();
@@ -659,8 +635,11 @@
             }
         }
 
+        // Logger object is a singleton and does not have to be coupled with the foreground
+        // activity. Since most user event logging is done on the UI, the object is retrieved
+        // from the callback for convenience.
         if (mUserEventDispatcher == null) {
-            mUserEventDispatcher = createUserEventDispatcher();
+            mUserEventDispatcher = new UserEventDispatcher();
         }
         return mUserEventDispatcher;
     }
diff --git a/src/com/android/launcher3/logging/UserEventDispatcher.java b/src/com/android/launcher3/logging/UserEventDispatcher.java
index e9a897e..0deee57 100644
--- a/src/com/android/launcher3/logging/UserEventDispatcher.java
+++ b/src/com/android/launcher3/logging/UserEventDispatcher.java
@@ -18,6 +18,7 @@
 
 import android.content.ComponentName;
 import android.content.Intent;
+import android.util.Log;
 import android.view.View;
 import android.view.ViewParent;
 
@@ -28,11 +29,14 @@
 import com.android.launcher3.util.ComponentKey;
 
 import java.util.List;
+import java.util.Locale;
 
 /**
  * Manages the creation of {@link LauncherEvent}.
  */
-public abstract class UserEventDispatcher {
+public class UserEventDispatcher {
+
+    private static final boolean DEBUG_LOGGING = false;
 
     private final static int MAXIMUM_VIEW_HIERARCHY_LEVEL = 5;
     /**
@@ -155,7 +159,17 @@
         mActionDurationMillis = System.currentTimeMillis();
     }
 
-    public abstract void dispatchUserEvent(LauncherEvent ev, Intent intent);
+    public void dispatchUserEvent(LauncherEvent ev, Intent intent) {
+        if (DEBUG_LOGGING) {
+            Log.d("UserEvent", String.format(Locale.US,
+                    "action:%s\nchild:%s\nparent:%s\nelapsed container %d ms session %d ms",
+                    LoggerUtils.getActionStr(ev.action),
+                    LoggerUtils.getTargetStr(ev.srcTarget[0]),
+                    LoggerUtils.getTargetStr(ev.srcTarget[1]),
+                    ev.elapsedContainerMillis,
+                    ev.elapsedSessionMillis));
+        }
+    }
 
     public int getPredictedRank(ComponentKey key) {
         if (mPredictedApps == null) return -1;
