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

Commit 7d58acf9 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Remove legacy unused proto tracing code to prevent confusion" into udc-qpr-dev

parents a5af8b42 0605ca7b
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
@@ -107,8 +107,6 @@ import com.android.launcher3.statehandlers.DesktopVisibilityController;
import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.taskbar.TaskbarUIController;
import com.android.launcher3.tracing.InputConsumerProto;
import com.android.launcher3.tracing.SwipeHandlerProto;
import com.android.launcher3.uioverrides.QuickstepLauncher;
import com.android.launcher3.util.ActivityLifecycleCallbacksAdapter;
import com.android.launcher3.util.DisplayController;
@@ -126,7 +124,6 @@ import com.android.quickstep.util.AnimatorControllerWithResistance;
import com.android.quickstep.util.InputConsumerProxy;
import com.android.quickstep.util.InputProxyHandlerFactory;
import com.android.quickstep.util.MotionPauseDetector;
import com.android.quickstep.util.ProtoTracer;
import com.android.quickstep.util.RecentsOrientedState;
import com.android.quickstep.util.RectFSpringAnim;
import com.android.quickstep.util.StaggeredWorkspaceAnim;
@@ -2426,7 +2423,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
                taskViewSimulator.apply(remoteHandle.getTransformParams());
            }
        }
        ProtoTracer.INSTANCE.get(mContext).scheduleFrameUpdate();
    }

    // Scaling of RecentsView during quick switch based on amount of recents scroll
@@ -2496,26 +2492,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
                mRecentsAnimationTargets.nonApps, shown, null /* animatorHandler */);
    }

    /**
     * Used for winscope tracing, see launcher_trace.proto
     * @see com.android.systemui.shared.tracing.ProtoTraceable#writeToProto
     * @param inputConsumerProto The parent of this proto message.
     */
    public void writeToProto(InputConsumerProto.Builder inputConsumerProto) {
        SwipeHandlerProto.Builder swipeHandlerProto = SwipeHandlerProto.newBuilder();

        mGestureState.writeToProto(swipeHandlerProto);

        swipeHandlerProto.setIsRecentsAttachedToAppWindow(
                mAnimationFactory.isRecentsAttachedToAppWindow());
        swipeHandlerProto.setScrollOffset(mRecentsView == null
                ? 0
                : mRecentsView.getScrollOffset());
        swipeHandlerProto.setAppToOverviewProgress(mCurrentShift.value);

        inputConsumerProto.setSwipeHandler(swipeHandlerProto);
    }

    public interface Factory {
        AbsSwipeUpHandler newHandler(GestureState gestureState, long touchTimeMs);
    }
+7 −27
Original line number Diff line number Diff line
@@ -37,8 +37,6 @@ import android.view.RemoteAnimationTarget;

import com.android.launcher3.statemanager.BaseState;
import com.android.launcher3.statemanager.StatefulActivity;
import com.android.launcher3.tracing.GestureStateProto;
import com.android.launcher3.tracing.SwipeHandlerProto;
import com.android.quickstep.TopTaskTracker.CachedTaskInfo;
import com.android.quickstep.util.ActiveGestureErrorDetector;
import com.android.quickstep.util.ActiveGestureLog;
@@ -62,24 +60,21 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL
     * Defines the end targets of a gesture and the associated state.
     */
    public enum GestureEndTarget {
        HOME(true, LAUNCHER_STATE_HOME, false, GestureStateProto.GestureEndTarget.HOME),
        HOME(true, LAUNCHER_STATE_HOME, false),

        RECENTS(true, LAUNCHER_STATE_OVERVIEW, true, GestureStateProto.GestureEndTarget.RECENTS),
        RECENTS(true, LAUNCHER_STATE_OVERVIEW, true),

        NEW_TASK(false, LAUNCHER_STATE_BACKGROUND, true,
                GestureStateProto.GestureEndTarget.NEW_TASK),
        NEW_TASK(false, LAUNCHER_STATE_BACKGROUND, true),

        LAST_TASK(false, LAUNCHER_STATE_BACKGROUND, true,
                GestureStateProto.GestureEndTarget.LAST_TASK),
        LAST_TASK(false, LAUNCHER_STATE_BACKGROUND, true),

        ALL_APPS(true, LAUNCHER_STATE_ALLAPPS, false, GestureStateProto.GestureEndTarget.ALL_APPS);
        ALL_APPS(true, LAUNCHER_STATE_ALLAPPS, false);

        GestureEndTarget(boolean isLauncher, int containerType, boolean recentsAttachedToAppWindow,
                GestureStateProto.GestureEndTarget protoEndTarget) {
        GestureEndTarget(boolean isLauncher, int containerType,
                boolean recentsAttachedToAppWindow) {
            this.isLauncher = isLauncher;
            this.containerType = containerType;
            this.recentsAttachedToAppWindow = recentsAttachedToAppWindow;
            this.protoEndTarget = protoEndTarget;
        }

        /** Whether the target is in the launcher activity. Implicitly, if the end target is going
@@ -89,8 +84,6 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL
        public final int containerType;
        /** Whether RecentsView should be attached to the window as we animate to this target */
        public final boolean recentsAttachedToAppWindow;
        /** The GestureStateProto enum value, used for winscope tracing. See launcher_trace.proto */
        public final GestureStateProto.GestureEndTarget protoEndTarget;
    }

    private static final String TAG = "GestureState";
@@ -489,17 +482,4 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL
        pw.println("  lastStartedTaskId=" + mLastStartedTaskId);
        pw.println("  isRecentsAnimationRunning=" + isRecentsAnimationRunning());
    }

    /**
     * Used for winscope tracing, see launcher_trace.proto
     * @see com.android.systemui.shared.tracing.ProtoTraceable#writeToProto
     * @param swipeHandlerProto The parent of this proto message.
     */
    public void writeToProto(SwipeHandlerProto.Builder swipeHandlerProto) {
        GestureStateProto.Builder gestureStateProto = GestureStateProto.newBuilder();
        gestureStateProto.setEndTarget(mEndTarget == null
                ? GestureStateProto.GestureEndTarget.UNSET
                : mEndTarget.protoEndTarget);
        swipeHandlerProto.setGestureState(gestureStateProto);
    }
}
+0 −20
Original line number Diff line number Diff line
@@ -21,9 +21,6 @@ import android.view.InputEvent;
import android.view.KeyEvent;
import android.view.MotionEvent;

import com.android.launcher3.tracing.InputConsumerProto;
import com.android.launcher3.tracing.TouchInteractionServiceProto;

@TargetApi(Build.VERSION_CODES.O)
public interface InputConsumer {

@@ -129,21 +126,4 @@ public interface InputConsumer {
        }
        return name.toString();
    }

    /**
     * Used for winscope tracing, see launcher_trace.proto
     * @see com.android.systemui.shared.tracing.ProtoTraceable#writeToProto
     * @param serviceProto The parent of this proto message.
     */
    default void writeToProto(TouchInteractionServiceProto.Builder serviceProto) {
        InputConsumerProto.Builder inputConsumerProto = InputConsumerProto.newBuilder();
        inputConsumerProto.setName(getName());
        writeToProtoInternal(inputConsumerProto);
        serviceProto.setInputConsumer(inputConsumerProto);
    }

    /**
     * @see #writeToProto - allows subclasses to write additional info to the proto.
     */
    default void writeToProtoInternal(InputConsumerProto.Builder inputConsumerProto) {}
}
+0 −15
Original line number Diff line number Diff line
@@ -38,8 +38,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.launcher3.R;
import com.android.launcher3.tracing.OverviewComponentObserverProto;
import com.android.launcher3.tracing.TouchInteractionServiceProto;
import com.android.launcher3.util.SimpleBroadcastReceiver;
import com.android.systemui.shared.system.PackageManagerWrapper;

@@ -275,19 +273,6 @@ public final class OverviewComponentObserver {
        pw.println("  homeIntent=" + mCurrentHomeIntent);
    }

    /**
     * Used for winscope tracing, see launcher_trace.proto
     * @see com.android.systemui.shared.tracing.ProtoTraceable#writeToProto
     * @param serviceProto The parent of this proto message.
     */
    public void writeToProto(TouchInteractionServiceProto.Builder serviceProto) {
        OverviewComponentObserverProto.Builder overviewComponentObserver =
                OverviewComponentObserverProto.newBuilder();
        overviewComponentObserver.setOverviewActivityStarted(mActivityInterface.isStarted());
        overviewComponentObserver.setOverviewActivityResumed(mActivityInterface.isResumed());
        serviceProto.setOverviewComponentObvserver(overviewComponentObserver);
    }

    /**
     * Starts the intent for the current home activity.
     */
+1 −40
Original line number Diff line number Diff line
@@ -92,8 +92,6 @@ import com.android.launcher3.taskbar.TaskbarManager;
import com.android.launcher3.testing.TestLogging;
import com.android.launcher3.testing.shared.ResourceUtils;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.tracing.LauncherTraceProto;
import com.android.launcher3.tracing.TouchInteractionServiceProto;
import com.android.launcher3.uioverrides.flags.FlagsFactory;
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
import com.android.launcher3.util.DisplayController;
@@ -117,7 +115,6 @@ import com.android.quickstep.inputconsumers.TaskbarUnstashInputConsumer;
import com.android.quickstep.inputconsumers.TrackpadStatusBarInputConsumer;
import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.util.ActiveGestureLog.CompoundString;
import com.android.quickstep.util.ProtoTracer;
import com.android.quickstep.util.ProxyScreenStatusProvider;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
@@ -126,7 +123,6 @@ import com.android.systemui.shared.system.InputChannelCompat.InputEventReceiver;
import com.android.systemui.shared.system.InputConsumerController;
import com.android.systemui.shared.system.InputMonitorCompat;
import com.android.systemui.shared.system.smartspace.ISysuiUnlockAnimationController;
import com.android.systemui.shared.tracing.ProtoTraceable;
import com.android.systemui.unfold.progress.IUnfoldAnimation;
import com.android.wm.shell.back.IBackAnimation;
import com.android.wm.shell.bubbles.IBubbles;
@@ -149,8 +145,7 @@ import java.util.function.Function;
 * Service connected by system-UI for handling touch interaction.
 */
@TargetApi(Build.VERSION_CODES.R)
public class TouchInteractionService extends Service
        implements ProtoTraceable<LauncherTraceProto.Builder> {
public class TouchInteractionService extends Service {

    private static final String SUBSTRING_PREFIX = "; ";
    private static final String NEWLINE_PREFIX = "\n\t\t\t-> ";
@@ -491,8 +486,6 @@ public class TouchInteractionService extends Service
        LockedUserState.get(this).runOnUserUnlocked(this::onUserUnlocked);
        LockedUserState.get(this).runOnUserUnlocked(mTaskbarManager::onUserUnlocked);
        mDeviceState.addNavigationModeChangedCallback(this::onNavigationModeChanged);

        ProtoTracer.INSTANCE.get(this).add(this);
        sConnected = true;
    }

@@ -617,19 +610,6 @@ public class TouchInteractionService extends Service
                // overview.
                mTaskAnimationManager.endLiveTile();
            }

            if ((lastSysUIFlags & SYSUI_STATE_TRACING_ENABLED) !=
                    (systemUiStateFlags & SYSUI_STATE_TRACING_ENABLED)) {
                // Update the tracing state
                if ((systemUiStateFlags & SYSUI_STATE_TRACING_ENABLED) != 0) {
                    Log.d(TAG, "Starting tracing.");
                    ProtoTracer.INSTANCE.get(this).start();
                } else {
                    Log.d(TAG, "Stopping tracing. Dumping to file="
                            + ProtoTracer.INSTANCE.get(this).getTraceFile());
                    ProtoTracer.INSTANCE.get(this).stop();
                }
            }
        }
    }

@@ -652,8 +632,6 @@ public class TouchInteractionService extends Service
        disposeEventHandlers("TouchInteractionService onDestroy()");
        mDeviceState.destroy();
        SystemUiProxy.INSTANCE.get(this).clearProxy();
        ProtoTracer.INSTANCE.get(this).stop();
        ProtoTracer.INSTANCE.get(this).remove(this);

        getSystemService(AccessibilityManager.class)
                .unregisterSystemAction(GLOBAL_ACTION_ACCESSIBILITY_ALL_APPS);
@@ -781,7 +759,6 @@ public class TouchInteractionService extends Service
            reset();
        }
        traceToken.close();
        ProtoTracer.INSTANCE.get(this).scheduleFrameUpdate();
    }

    private InputConsumer tryCreateAssistantInputConsumer(
@@ -1302,8 +1279,6 @@ public class TouchInteractionService extends Service
        pw.println("  mConsumer=" + mConsumer.getName());
        ActiveGestureLog.INSTANCE.dump("", pw);
        RecentsModel.INSTANCE.get(this).dump("", pw);
        pw.println("ProtoTrace:");
        pw.println("  file=" + ProtoTracer.INSTANCE.get(this).getTraceFile());
        if (createdOverviewActivity != null) {
            createdOverviewActivity.getDeviceProfile().dump(this, "", pw);
        }
@@ -1323,18 +1298,4 @@ public class TouchInteractionService extends Service
                gestureState, touchTimeMs, mTaskAnimationManager.isRecentsAnimationRunning(),
                mInputConsumer);
    }

    @Override
    public void writeToProto(LauncherTraceProto.Builder proto) {
        TouchInteractionServiceProto.Builder serviceProto =
            TouchInteractionServiceProto.newBuilder();
        serviceProto.setServiceConnected(true);

        if (mOverviewComponentObserver != null) {
            mOverviewComponentObserver.writeToProto(serviceProto);
        }
        mConsumer.writeToProto(serviceProto);

        proto.setTouchInteractionService(serviceProto);
    }
}
Loading