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

Commit 42c6e200 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "NotificationPanelViewController: separate DEBUG flag for drawable" into...

Merge "NotificationPanelViewController: separate DEBUG flag for drawable" into tm-dev am: cbad8729 am: ded2889e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18586451



Change-Id: I54dc5f845ec5fda1bb4d3b89523e4d8368391e39
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3512c00c ded2889e
Loading
Loading
Loading
Loading
+20 −19
Original line number Diff line number Diff line
@@ -216,7 +216,8 @@ import javax.inject.Provider;
@CentralSurfacesComponent.CentralSurfacesScope
public class NotificationPanelViewController extends PanelViewController {

    private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
    private static final boolean DEBUG_LOGCAT = Log.isLoggable(TAG, Log.DEBUG);
    private static final boolean DEBUG_DRAWABLE = false;

    /**
     * The parallax amount of the quick settings translation when dragging down the panel
@@ -816,7 +817,7 @@ public class NotificationPanelViewController extends PanelViewController {
        mSettingsChangeObserver = new SettingsChangeObserver(handler);
        mSplitShadeEnabled =
                LargeScreenUtils.shouldUseSplitNotificationShade(mResources);
        mView.setWillNotDraw(!DEBUG);
        mView.setWillNotDraw(!DEBUG_DRAWABLE);
        mLargeScreenShadeHeaderController = largeScreenShadeHeaderController;
        mLayoutInflater = layoutInflater;
        mFeatureFlags = featureFlags;
@@ -890,7 +891,7 @@ public class NotificationPanelViewController extends PanelViewController {

        mView.setOnApplyWindowInsetsListener(new OnApplyWindowInsetsListener());

        if (DEBUG) {
        if (DEBUG_DRAWABLE) {
            mView.getOverlay().add(new DebugDrawable());
        }

@@ -1189,7 +1190,7 @@ public class NotificationPanelViewController extends PanelViewController {
    }

    private void reInflateViews() {
        if (DEBUG) Log.d(TAG, "reInflateViews");
        if (DEBUG_LOGCAT) Log.d(TAG, "reInflateViews");
        // Re-inflate the status view group.
        KeyguardStatusView keyguardStatusView =
                mNotificationContainerParent.findViewById(R.id.keyguard_status_view);
@@ -1743,7 +1744,7 @@ public class NotificationPanelViewController extends PanelViewController {
    }

    private boolean onQsIntercept(MotionEvent event) {
        if (DEBUG) Log.d(TAG, "onQsIntercept");
        if (DEBUG_LOGCAT) Log.d(TAG, "onQsIntercept");
        int pointerIndex = event.findPointerIndex(mTrackingPointer);
        if (pointerIndex < 0) {
            pointerIndex = 0;
@@ -1798,7 +1799,7 @@ public class NotificationPanelViewController extends PanelViewController {
                if ((h > getTouchSlop(event) || (h < -getTouchSlop(event) && mQsExpanded))
                        && Math.abs(h) > Math.abs(x - mInitialTouchX)
                        && shouldQuickSettingsIntercept(mInitialTouchX, mInitialTouchY, h)) {
                    if (DEBUG) Log.d(TAG, "onQsIntercept - start tracking expansion");
                    if (DEBUG_LOGCAT) Log.d(TAG, "onQsIntercept - start tracking expansion");
                    mView.getParent().requestDisallowInterceptTouchEvent(true);
                    mQsTracking = true;
                    traceQsJank(true /* startTracing */, false /* wasCancelled */);
@@ -2075,7 +2076,7 @@ public class NotificationPanelViewController extends PanelViewController {
    private void handleQsDown(MotionEvent event) {
        if (event.getActionMasked() == MotionEvent.ACTION_DOWN && shouldQuickSettingsIntercept(
                event.getX(), event.getY(), -1)) {
            if (DEBUG) Log.d(TAG, "handleQsDown");
            if (DEBUG_LOGCAT) Log.d(TAG, "handleQsDown");
            mFalsingCollector.onQsDown();
            mQsTracking = true;
            onQsExpansionStarted();
@@ -2189,7 +2190,7 @@ public class NotificationPanelViewController extends PanelViewController {
                break;

            case MotionEvent.ACTION_MOVE:
                if (DEBUG) Log.d(TAG, "onQSTouch move");
                if (DEBUG_LOGCAT) Log.d(TAG, "onQSTouch move");
                setQsExpansion(h + mInitialHeightOnTouch);
                if (h >= getFalsingThreshold()) {
                    mQsTouchAboveFalsingThreshold = true;
@@ -2341,7 +2342,7 @@ public class NotificationPanelViewController extends PanelViewController {
            mCentralSurfaces.executeRunnableDismissingKeyguard(null, null /* cancelAction */,
                    false /* dismissShade */, true /* afterKeyguardGone */, false /* deferred */);
        }
        if (DEBUG) {
        if (DEBUG_DRAWABLE) {
            mView.invalidate();
        }
    }
@@ -2998,7 +2999,7 @@ public class NotificationPanelViewController extends PanelViewController {
            // This is a circular dependency and should be avoided, otherwise we'll have
            // a stack overflow.
            if (mStackScrollerMeasuringPass > 2) {
                if (DEBUG) Log.d(TAG, "Unstable notification panel height. Aborting.");
                if (DEBUG_LOGCAT) Log.d(TAG, "Unstable notification panel height. Aborting.");
            } else {
                positionClockAndNotifications();
            }
@@ -3032,7 +3033,7 @@ public class NotificationPanelViewController extends PanelViewController {
        updateNotificationTranslucency();
        updatePanelExpanded();
        updateGestureExclusionRect();
        if (DEBUG) {
        if (DEBUG_DRAWABLE) {
            mView.invalidate();
        }
    }
@@ -3675,7 +3676,7 @@ public class NotificationPanelViewController extends PanelViewController {
        public void onQsPanelScrollChanged(int scrollY) {
            mLargeScreenShadeHeaderController.setQsScrollY(scrollY);
            if (scrollY > 0 && !mQsFullyExpanded) {
                if (DEBUG) Log.d(TAG, "Scrolling while not expanded. Forcing expand");
                if (DEBUG_LOGCAT) Log.d(TAG, "Scrolling while not expanded. Forcing expand");
                // If we are scrolling QS, we should be fully expanded.
                expandWithQs();
            }
@@ -4070,7 +4071,7 @@ public class NotificationPanelViewController extends PanelViewController {
    }

    public void setHeaderDebugInfo(String text) {
        if (DEBUG) mHeaderDebugInfo = text;
        if (DEBUG_DRAWABLE) mHeaderDebugInfo = text;
    }

    public void onThemeChanged() {
@@ -4112,7 +4113,7 @@ public class NotificationPanelViewController extends PanelViewController {
                }

                if (!isFullyCollapsed() && onQsIntercept(event)) {
                    if (DEBUG) Log.d(TAG, "onQsIntercept true");
                    if (DEBUG_LOGCAT) Log.d(TAG, "onQsIntercept true");
                    return true;
                }
                return super.onInterceptTouchEvent(event);
@@ -4183,7 +4184,7 @@ public class NotificationPanelViewController extends PanelViewController {
                handled |= mHeadsUpTouchHelper.onTouchEvent(event);

                if (!mHeadsUpTouchHelper.isTrackingHeadsUp() && handleQsTouch(event)) {
                    if (DEBUG) Log.d(TAG, "handleQsTouch true");
                    if (DEBUG_LOGCAT) Log.d(TAG, "handleQsTouch true");
                    return true;
                }
                if (event.getActionMasked() == MotionEvent.ACTION_DOWN && isFullyCollapsed()) {
@@ -4623,7 +4624,7 @@ public class NotificationPanelViewController extends PanelViewController {
    private class ConfigurationListener implements ConfigurationController.ConfigurationListener {
        @Override
        public void onThemeChanged() {
            if (DEBUG) Log.d(TAG, "onThemeChanged");
            if (DEBUG_LOGCAT) Log.d(TAG, "onThemeChanged");
            mThemeResId = mView.getContext().getThemeResId();
            reInflateViews();
        }
@@ -4631,7 +4632,7 @@ public class NotificationPanelViewController extends PanelViewController {
        @Override
        public void onSmallestScreenWidthChanged() {
            Trace.beginSection("onSmallestScreenWidthChanged");
            if (DEBUG) Log.d(TAG, "onSmallestScreenWidthChanged");
            if (DEBUG_LOGCAT) Log.d(TAG, "onSmallestScreenWidthChanged");

            // Can affect multi-user switcher visibility as it depends on screen size by default:
            // it is enabled only for devices with large screens (see config_keyguardUserSwitcher)
@@ -4648,7 +4649,7 @@ public class NotificationPanelViewController extends PanelViewController {

        @Override
        public void onDensityOrFontScaleChanged() {
            if (DEBUG) Log.d(TAG, "onDensityOrFontScaleChanged");
            if (DEBUG_LOGCAT) Log.d(TAG, "onDensityOrFontScaleChanged");
            reInflateViews();
        }
    }
@@ -4661,7 +4662,7 @@ public class NotificationPanelViewController extends PanelViewController {

        @Override
        public void onChange(boolean selfChange) {
            if (DEBUG) Log.d(TAG, "onSettingsChanged");
            if (DEBUG_LOGCAT) Log.d(TAG, "onSettingsChanged");

            // Can affect multi-user switcher visibility
            reInflateViews();