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

Commit 6534424c authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Fix notification drag and drop flag

Test: manual
Change-Id: I296cf64e76e82486353f2ea3f3b34cfa474677f2
parent b468e3d4
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ import android.view.ViewConfiguration;
import android.view.accessibility.AccessibilityEvent;

import com.android.systemui.animation.Interpolators;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
@@ -82,6 +84,7 @@ public class SwipeHelper implements Gefingerpoken {
    private final int mSwipeDirection;
    private final VelocityTracker mVelocityTracker;
    private final FalsingManager mFalsingManager;
    private final FeatureFlags mFeatureFlags;

    private float mInitialTouchPos;
    private float mPerpendicularInitialTouchPos;
@@ -128,7 +131,8 @@ public class SwipeHelper implements Gefingerpoken {

    public SwipeHelper(
            int swipeDirection, Callback callback, Resources resources,
            ViewConfiguration viewConfiguration, FalsingManager falsingManager) {
            ViewConfiguration viewConfiguration, FalsingManager falsingManager,
            FeatureFlags featureFlags) {
        mCallback = callback;
        mHandler = new Handler();
        mSwipeDirection = swipeDirection;
@@ -146,6 +150,7 @@ public class SwipeHelper implements Gefingerpoken {
        mFadeDependingOnAmountSwiped = resources.getBoolean(
                R.bool.config_fadeDependingOnAmountSwiped);
        mFalsingManager = falsingManager;
        mFeatureFlags = featureFlags;
        mFlingAnimationUtils = new FlingAnimationUtils(resources.getDisplayMetrics(),
                getMaxEscapeAnimDuration() / 1000f);
    }
@@ -795,7 +800,7 @@ public class SwipeHelper implements Gefingerpoken {
    }

    private boolean isAvailableToDragAndDrop(View v) {
        if (v.getResources().getBoolean(R.bool.config_notificationToContents)) {
        if (mFeatureFlags.isEnabled(Flags.NOTIFICATION_DRAG_TO_CONTENTS)) {
            if (v instanceof ExpandableNotificationRow) {
                ExpandableNotificationRow enr = (ExpandableNotificationRow) v;
                boolean canBubble = enr.getEntry().canBubble();
+3 −3
Original line number Diff line number Diff line
@@ -46,9 +46,6 @@ public class Flags {
    public static final BooleanFlag NOTIFICATION_PIPELINE_DEVELOPER_LOGGING =
            new BooleanFlag(103, false);

    public static final ResourceBooleanFlag NOTIFICATION_SHADE_DRAG =
            new ResourceBooleanFlag(104, R.bool.config_enableNotificationShadeDrag);

    public static final BooleanFlag NSSL_DEBUG_LINES =
            new BooleanFlag(105, false);

@@ -58,6 +55,9 @@ public class Flags {
    public static final BooleanFlag NEW_PIPELINE_CRASH_ON_CALL_TO_OLD_PIPELINE =
            new BooleanFlag(107, false);

    public static final ResourceBooleanFlag NOTIFICATION_DRAG_TO_CONTENTS =
            new ResourceBooleanFlag(108, R.bool.config_notificationToContents);

    /***************************************/
    // 200 - keyguard/lockscreen

+6 −2
Original line number Diff line number Diff line
@@ -27,8 +27,9 @@ import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.systemui.R;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
@@ -89,6 +90,7 @@ public class ExpandableNotificationRowController implements NotifViewController
    private final OnUserInteractionCallback mOnUserInteractionCallback;
    private final FalsingManager mFalsingManager;
    private final FalsingCollector mFalsingCollector;
    private final FeatureFlags mFeatureFlags;
    private final boolean mAllowLongPress;
    private final PeopleNotificationIdentifier mPeopleNotificationIdentifier;
    private final Optional<BubblesManager> mBubblesManagerOptional;
@@ -119,6 +121,7 @@ public class ExpandableNotificationRowController implements NotifViewController
            OnUserInteractionCallback onUserInteractionCallback,
            FalsingManager falsingManager,
            FalsingCollector falsingCollector,
            FeatureFlags featureFlags,
            PeopleNotificationIdentifier peopleNotificationIdentifier,
            Optional<BubblesManager> bubblesManagerOptional,
            ExpandableNotificationRowDragController dragController) {
@@ -145,6 +148,7 @@ public class ExpandableNotificationRowController implements NotifViewController
        mOnFeedbackClickListener = mNotificationGutsManager::openGuts;
        mAllowLongPress = allowLongPress;
        mFalsingCollector = falsingCollector;
        mFeatureFlags = featureFlags;
        mPeopleNotificationIdentifier = peopleNotificationIdentifier;
        mBubblesManagerOptional = bubblesManagerOptional;
        mDragController = dragController;
@@ -179,7 +183,7 @@ public class ExpandableNotificationRowController implements NotifViewController
        );
        mView.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
        if (mAllowLongPress) {
            if (mView.getResources().getBoolean(R.bool.config_notificationToContents)) {
            if (mFeatureFlags.isEnabled(Flags.NOTIFICATION_DRAG_TO_CONTENTS)) {
                mView.setDragController(mDragController);
            }

+8 −4
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.jank.InteractionJankMonitor;
import com.android.systemui.SwipeHelper;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
@@ -66,9 +67,10 @@ class NotificationSwipeHelper extends SwipeHelper implements NotificationSwipeAc

    NotificationSwipeHelper(
            Resources resources, ViewConfiguration viewConfiguration,
            FalsingManager falsingManager, int swipeDirection, NotificationCallback callback,
            FalsingManager falsingManager, FeatureFlags featureFlags,
            int swipeDirection, NotificationCallback callback,
            NotificationMenuRowPlugin.OnMenuEventListener menuListener) {
        super(swipeDirection, callback, resources, viewConfiguration, falsingManager);
        super(swipeDirection, callback, resources, viewConfiguration, falsingManager, featureFlags);
        mMenuListener = menuListener;
        mCallback = callback;
        mFalsingCheck = () -> resetExposedMenuView(true /* animate */, true /* force */);
@@ -508,16 +510,18 @@ class NotificationSwipeHelper extends SwipeHelper implements NotificationSwipeAc
        private final Resources mResources;
        private final ViewConfiguration mViewConfiguration;
        private final FalsingManager mFalsingManager;
        private final FeatureFlags mFeatureFlags;
        private int mSwipeDirection;
        private NotificationCallback mNotificationCallback;
        private NotificationMenuRowPlugin.OnMenuEventListener mOnMenuEventListener;

        @Inject
        Builder(@Main Resources resources, ViewConfiguration viewConfiguration,
                FalsingManager falsingManager) {
                FalsingManager falsingManager, FeatureFlags featureFlags) {
            mResources = resources;
            mViewConfiguration = viewConfiguration;
            mFalsingManager = falsingManager;
            mFeatureFlags = featureFlags;
        }

        Builder setSwipeDirection(int swipeDirection) {
@@ -538,7 +542,7 @@ class NotificationSwipeHelper extends SwipeHelper implements NotificationSwipeAc

        NotificationSwipeHelper build() {
            return new NotificationSwipeHelper(mResources, mViewConfiguration, mFalsingManager,
                    mSwipeDirection, mNotificationCallback, mOnMenuEventListener);
                    mFeatureFlags, mSwipeDirection, mNotificationCallback, mOnMenuEventListener);
        }
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -806,7 +806,6 @@ public class NotificationPanelViewController extends PanelViewController
            QsFrameTranslateController qsFrameTranslateController,
            KeyguardUnlockAnimationController keyguardUnlockAnimationController) {
        super(view,
                featureFlags,
                falsingManager,
                dozeLog,
                keyguardStateController,
Loading