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

Commit 6b476d8b authored by Shawn Lee's avatar Shawn Lee Committed by Android (Google) Code Review
Browse files

Merge "Filling in holes in shade touch handling logging" into udc-dev

parents f9a90ca9 ca1b4851
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4936,6 +4936,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
            }

            handled |= handleTouch(event);
            mShadeLog.logOnTouchEventLastReturn(event, !mDozing, handled);
            return !mDozing || handled;
        }

@@ -5118,6 +5119,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
                    }
                    break;
            }
            mShadeLog.logHandleTouchLastReturn(event, !mGestureWaitForTouchSlop, mTracking);
            return !mGestureWaitForTouchSlop || mTracking;
        }

+76 −0
Original line number Diff line number Diff line
@@ -316,4 +316,80 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) {
            { "QSC NotificationsClippingTopBound set to $int1 - $int2" }
        )
    }

    fun logOnTouchEventLastReturn(
        event: MotionEvent,
        dozing: Boolean,
        handled: Boolean,
    ) {
        buffer.log(
            TAG,
            LogLevel.VERBOSE,
            {
                bool1 = dozing
                bool2 = handled
                long1 = event.eventTime
                long2 = event.downTime
                int1 = event.action
                int2 = event.classification
                double1 = event.y.toDouble()
            },
            {
                "NPVC onTouchEvent last return: !mDozing: $bool1 || handled: $bool2 " +
                        "\neventTime=$long1,downTime=$long2,y=$double1,action=$int1,class=$int2"
            }
        )
    }

    fun logHandleTouchLastReturn(
        event: MotionEvent,
        gestureWaitForTouchSlop: Boolean,
        tracking: Boolean,
    ) {
        buffer.log(
            TAG,
            LogLevel.VERBOSE,
            {
                bool1 = gestureWaitForTouchSlop
                bool2 = tracking
                long1 = event.eventTime
                long2 = event.downTime
                int1 = event.action
                int2 = event.classification
                double1 = event.y.toDouble()
            },
            {
                "NPVC handleTouch last return: !mGestureWaitForTouchSlop: $bool1 " +
                        "|| mTracking: $bool2 " +
                        "\neventTime=$long1,downTime=$long2,y=$double1,action=$int1,class=$int2"
            }
        )
    }

    fun logUpdateNotificationPanelTouchState(
        disabled: Boolean,
        isGoingToSleep: Boolean,
        shouldControlScreenOff: Boolean,
        deviceInteractive: Boolean,
        isPulsing: Boolean,
        isFrpActive: Boolean,
    ) {
        buffer.log(
            TAG,
            LogLevel.VERBOSE,
            {
                bool1 = disabled
                bool2 = isGoingToSleep
                bool3 = shouldControlScreenOff
                bool4 = deviceInteractive
                str1 = isPulsing.toString()
                str2 = isFrpActive.toString()
            },
            {
                "CentralSurfaces updateNotificationPanelTouchState set disabled to: $bool1\n" +
                        "isGoingToSleep: $bool2, !shouldControlScreenOff: $bool3," +
                        "!mDeviceInteractive: $bool4, !isPulsing: $str1, isFrpActive: $str2"
            }
        )
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@ import com.android.systemui.shade.ShadeController;
import com.android.systemui.shade.ShadeExpansionChangeEvent;
import com.android.systemui.shade.ShadeExpansionStateManager;
import com.android.systemui.shared.recents.utilities.Utilities;
import com.android.systemui.shade.ShadeLogger;
import com.android.systemui.statusbar.AutoHideUiElement;
import com.android.systemui.statusbar.BackDropView;
import com.android.systemui.statusbar.CircleReveal;
@@ -505,6 +506,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
    /** Controller for the Shade. */
    @VisibleForTesting
    NotificationPanelViewController mNotificationPanelViewController;
    private final ShadeLogger mShadeLogger;

    // settings
    private QSPanelController mQSPanelController;
@@ -738,6 +740,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
            KeyguardViewMediator keyguardViewMediator,
            DisplayMetrics displayMetrics,
            MetricsLogger metricsLogger,
            ShadeLogger shadeLogger,
            @UiBackground Executor uiBgExecutor,
            NotificationMediaManager notificationMediaManager,
            NotificationLockscreenUserManager lockScreenUserManager,
@@ -830,6 +833,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
        mKeyguardViewMediator = keyguardViewMediator;
        mDisplayMetrics = displayMetrics;
        mMetricsLogger = metricsLogger;
        mShadeLogger = shadeLogger;
        mUiBgExecutor = uiBgExecutor;
        mMediaManager = notificationMediaManager;
        mLockscreenUserManager = lockScreenUserManager;
@@ -3672,6 +3676,10 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
        boolean disabled = (!mDeviceInteractive && !mDozeServiceHost.isPulsing())
                || goingToSleepWithoutAnimation
                || mDeviceProvisionedController.isFrpActive();
        mShadeLogger.logUpdateNotificationPanelTouchState(disabled, isGoingToSleep(),
                !mDozeParameters.shouldControlScreenOff(), !mDeviceInteractive,
                !mDozeServiceHost.isPulsing(), mDeviceProvisionedController.isFrpActive());

        mNotificationPanelViewController.setTouchAndAnimationDisabled(disabled);
        mNotificationIconAreaController.setAnimationsEnabled(!disabled);
    }
+3 −0
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ import com.android.systemui.shade.QuickSettingsController;
import com.android.systemui.shade.ShadeController;
import com.android.systemui.shade.ShadeControllerImpl;
import com.android.systemui.shade.ShadeExpansionStateManager;
import com.android.systemui.shade.ShadeLogger;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.KeyguardIndicationController;
import com.android.systemui.statusbar.LockscreenShadeTransitionController;
@@ -221,6 +222,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
    @Mock private NotificationListContainer mNotificationListContainer;
    @Mock private HeadsUpManagerPhone mHeadsUpManager;
    @Mock private NotificationPanelViewController mNotificationPanelViewController;
    @Mock private ShadeLogger mShadeLogger;
    @Mock private NotificationPanelView mNotificationPanelView;
    @Mock private QuickSettingsController mQuickSettingsController;
    @Mock private IStatusBarService mBarService;
@@ -469,6 +471,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
                mKeyguardViewMediator,
                new DisplayMetrics(),
                mMetricsLogger,
                mShadeLogger,
                mUiBgExecutor,
                mNotificationMediaManager,
                mLockscreenUserManager,