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

Commit 231bc9c5 authored by Winson's avatar Winson
Browse files

Adding view debug annotations to simplifying debugging state.

Change-Id: If90955f44be55ff09208998214bc1bb47f93a872
parent 8be1634a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.recents.misc;

import android.os.Handler;
import android.view.ViewDebug;

/**
 * A dozer is a class that fires a trigger after it falls asleep.
@@ -26,8 +27,11 @@ public class DozeTrigger {

    Handler mHandler;

    @ViewDebug.ExportedProperty(category="recents")
    boolean mIsDozing;
    @ViewDebug.ExportedProperty(category="recents")
    boolean mHasTriggered;
    @ViewDebug.ExportedProperty(category="recents")
    int mDozeDurationMilliseconds;
    Runnable mOnSleepRunnable;

+21 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.view.ViewDebug;

import com.android.systemui.recents.Recents;
import com.android.systemui.recents.misc.SystemServicesProxy;
@@ -48,11 +49,17 @@ public class Task {

    /* The Task Key represents the unique primary key for the task */
    public static class TaskKey {
        @ViewDebug.ExportedProperty(category="recents")
        public final int id;
        @ViewDebug.ExportedProperty(category="recents")
        public int stackId;
        @ViewDebug.ExportedProperty(category="recents")
        public final Intent baseIntent;
        @ViewDebug.ExportedProperty(category="recents")
        public final int userId;
        @ViewDebug.ExportedProperty(category="recents")
        public long firstActiveTime;
        @ViewDebug.ExportedProperty(category="recents")
        public long lastActiveTime;

        private int mHashCode;
@@ -105,17 +112,21 @@ public class Task {
        }
    }

    @ViewDebug.ExportedProperty(deepExport=true, prefix="key_")
    public TaskKey key;

    /**
     * The group will be computed separately from the initialization of the task
     */
    @ViewDebug.ExportedProperty(deepExport=true, prefix="group_")
    public TaskGrouping group;
    /**
     * The affiliationTaskId is the task id of the parent task or itself if it is not affiliated
     * with any task.
     */
    @ViewDebug.ExportedProperty(category="recents")
    public int affiliationTaskId;
    @ViewDebug.ExportedProperty(category="recents")
    public int affiliationColor;

    /**
@@ -124,16 +135,23 @@ public class Task {
     */
    public Drawable icon;
    public Bitmap thumbnail;
    @ViewDebug.ExportedProperty(category="recents")
    public String title;
    @ViewDebug.ExportedProperty(category="recents")
    public String contentDescription;
    @ViewDebug.ExportedProperty(category="recents")
    public String dismissDescription;
    @ViewDebug.ExportedProperty(category="recents")
    public int colorPrimary;
    @ViewDebug.ExportedProperty(category="recents")
    public int colorBackground;
    @ViewDebug.ExportedProperty(category="recents")
    public boolean useLightOnPrimaryColor;

    /**
     * The bounds of the task, used only if it is a freeform task.
     */
    @ViewDebug.ExportedProperty(category="recents")
    public Rect bounds;

    /**
@@ -144,8 +162,11 @@ public class Task {
    /**
     * The state isLaunchTarget will be set for the correct task upon launching Recents.
     */
    @ViewDebug.ExportedProperty(category="recents")
    public boolean isLaunchTarget;
    @ViewDebug.ExportedProperty(category="recents")
    public boolean isHistorical;
    @ViewDebug.ExportedProperty(category="recents")
    public boolean isSystemApp;

    private ArrayList<TaskCallbacks> mCallbacks = new ArrayList<>();
+6 −0
Original line number Diff line number Diff line
@@ -19,16 +19,22 @@ package com.android.systemui.recents.views;
import android.graphics.Outline;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewDebug;
import android.view.ViewOutlineProvider;

/* An outline provider that has a clip and outline that can be animated. */
public class AnimateableViewBounds extends ViewOutlineProvider {

    View mSourceView;
    @ViewDebug.ExportedProperty(category="recents")
    Rect mClipRect = new Rect();
    @ViewDebug.ExportedProperty(category="recents")
    Rect mClipBounds = new Rect();
    @ViewDebug.ExportedProperty(category="recents")
    Rect mLastClipBounds = new Rect();
    @ViewDebug.ExportedProperty(category="recents")
    int mCornerRadius;
    @ViewDebug.ExportedProperty(category="recents")
    float mAlpha = 1f;
    final float mMinAlpha = 0.25f;

+6 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.recents.views;

import static android.app.ActivityManager.StackId.INVALID_STACK_ID;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
@@ -32,6 +34,7 @@ import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewDebug;
import android.view.ViewOutlineProvider;
import android.view.ViewPropertyAnimator;
import android.view.WindowInsets;
@@ -79,8 +82,6 @@ import com.android.systemui.statusbar.FlingAnimationUtils;
import java.util.ArrayList;
import java.util.List;

import static android.app.ActivityManager.StackId.INVALID_STACK_ID;

/**
 * This view is the the top level layout that contains TaskStacks (which are laid out according
 * to their SpaceNode bounds.
@@ -103,6 +104,8 @@ public class RecentsView extends FrameLayout {

    private boolean mAwaitingFirstLayout = true;
    private boolean mLastTaskLaunchedWasFreeform;

    @ViewDebug.ExportedProperty(category="recents")
    private Rect mSystemInsets = new Rect();
    private int mDividerSize;

@@ -110,6 +113,7 @@ public class RecentsView extends FrameLayout {
    private Animator mBackgroundScrimAnimator;

    private RecentsTransitionHelper mTransitionHelper;
    @ViewDebug.ExportedProperty(deepExport=true, prefix="touch_")
    private RecentsViewTouchHandler mTouchHandler;
    private final FlingAnimationUtils mFlingAnimationUtils;

+7 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.res.Configuration;
import android.graphics.Point;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import android.view.ViewDebug;

import com.android.systemui.recents.Recents;
import com.android.systemui.recents.RecentsConfiguration;
@@ -61,12 +62,18 @@ public class RecentsViewTouchHandler {

    private RecentsView mRv;

    @ViewDebug.ExportedProperty(deepExport=true, prefix="drag_task")
    private Task mDragTask;
    @ViewDebug.ExportedProperty(deepExport=true, prefix="drag_task_view_")
    private TaskView mTaskView;

    @ViewDebug.ExportedProperty(category="recents")
    private Point mTaskViewOffset = new Point();
    @ViewDebug.ExportedProperty(category="recents")
    private Point mDownPos = new Point();
    @ViewDebug.ExportedProperty(category="recents")
    private boolean mDragRequested;
    @ViewDebug.ExportedProperty(category="recents")
    private boolean mIsDragging;
    private float mDragSlop;

Loading