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

Commit 27887b2c authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Adding some tracing for touch interaction

Change-Id: Ibbd54b5a0d397312e8f83bdcc2b7d93f309f8f7a
parent a3921c7b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.states.InternalStateHandler;
import com.android.launcher3.util.TraceHelper;
import com.android.systemui.shared.recents.model.RecentsTaskLoadPlan;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.Task.TaskKey;
@@ -153,11 +154,13 @@ public class NavBarSwipeInteractionHandler extends InternalStateHandler {

    @Override
    public void onLauncherResume() {
        TraceHelper.partitionSection("TouchInt", "Launcher On resume");
        mDragView.getViewTreeObserver().addOnPreDrawListener(new OnPreDrawListener() {
            @Override
            public boolean onPreDraw() {
                mDragView.getViewTreeObserver().removeOnPreDrawListener(this);
                mStateCallback.setState(STATE_LAUNCHER_READY);
                TraceHelper.partitionSection("TouchInt", "Launcher drawn");
                return true;
            }
        });
@@ -179,6 +182,7 @@ public class NavBarSwipeInteractionHandler extends InternalStateHandler {
        // Optimization
        mLauncher.getAppsView().setVisibility(View.GONE);
        mRecentsView.setVisibility(View.GONE);
        TraceHelper.partitionSection("TouchInt", "Launcher on new intent");
    }

    @UiThread
+4 −0
Original line number Diff line number Diff line
@@ -132,6 +132,7 @@ public class TouchInteractionService extends Service {
        }
        switch (ev.getActionMasked()) {
            case MotionEvent.ACTION_DOWN: {
                TraceHelper.beginSection("TouchInt");
                mActivePointerId = ev.getPointerId(0);
                mDownPos.set(ev.getX(), ev.getY());
                mLastPos.set(mDownPos);
@@ -194,6 +195,7 @@ public class TouchInteractionService extends Service {
            case MotionEvent.ACTION_CANCEL:
                // TODO: Should be different than ACTION_UP
            case MotionEvent.ACTION_UP: {
                TraceHelper.endSection("TouchInt");

                endInteraction();
                break;
@@ -210,6 +212,7 @@ public class TouchInteractionService extends Service {
        final Context context = this;
        final RecentsTaskLoadPlan loadPlan = new RecentsTaskLoadPlan(context);
        final int taskId = mRunningTask.id;
        TraceHelper.partitionSection("TouchInt", "Thershold crossed ");

        BackgroundExecutor.get().submit(() -> {
            // Get the snap shot before
@@ -218,6 +221,7 @@ public class TouchInteractionService extends Service {
            // Start the launcher activity with our custom handler
            Intent homeIntent = handler.addToIntent(new Intent(mHomeIntent));
            startActivity(homeIntent, ActivityOptions.makeCustomAnimation(this, 0, 0).toBundle());
            TraceHelper.partitionSection("TouchInt", "Home started");

            /*
            ActivityManagerWrapper.getInstance().startRecentsActivity(null, options,
+2 −3
Original line number Diff line number Diff line
@@ -33,9 +33,8 @@ public class TraceHelper {

    private static final boolean ENABLED = FeatureFlags.IS_DOGFOOD_BUILD;

    private static final boolean SYSTEM_TRACE = true;
    private static final ArrayMap<String, MutableLong> sUpTimes =
            ENABLED ? new ArrayMap<String, MutableLong>() : null;
    private static final boolean SYSTEM_TRACE = false;
    private static final ArrayMap<String, MutableLong> sUpTimes = ENABLED ? new ArrayMap<>() : null;

    public static void beginSection(String sectionName) {
        if (ENABLED) {