Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df424e14 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Allow runtime debug logs in TouchExplorer

To make it easier to debug, add the ability to enable TouchExplorer logs
at runtime.

Bug: 223849581
Test: adb shell setprop log.tag.TouchExplorer DEBUG
Change-Id: Ic86467ce514f04684b47d77462a03342beb2fd1e
parent 506646c2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import android.content.Context;
import android.graphics.Region;
import android.os.Handler;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.Slog;
import android.view.Display;
import android.view.InputDevice;
@@ -84,12 +85,14 @@ import java.util.List;
public class TouchExplorer extends BaseEventStreamTransformation
        implements GestureManifold.Listener {

    static final boolean DEBUG = false;
    private static final long LOGGING_FLAGS = FLAGS_GESTURE | FLAGS_INPUT_FILTER;

    // Tag for logging received events.
    private static final String LOG_TAG = "TouchExplorer";

    // To enable these logs, run: 'adb shell setprop log.tag.TouchExplorer DEBUG' (requires restart)
    static final boolean DEBUG = Log.isLoggable(LOG_TAG, Log.DEBUG);

    // The maximum of the cosine between the vectors of two moving
    // pointers so they can be considered moving in the same direction.
    private static final float MAX_DRAGGING_ANGLE_COS = 0.525321989f; // cos(pi/4)