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

Commit dee687c3 authored by Brandon Dayauon's avatar Brandon Dayauon
Browse files

Play original haptic when feature flag is off. Rename feature flag

- Remove the Utilities.atLeast check since it's no longer relevant as there is no new haptics being played
in the original haptic..

When FeatureFlag is off, the haptic for all apps and qsb is played in one place. So when
FeatureFlag is on, we need to isolate where the haptic call gets played so we disable calling it from two places
and play the haptics at the respective areas.
flag: ENABLE_PREMIUM_HAPTICS_ALL_APPS=false


bug: 270634265
test: Manual
Change-Id: I7b92c427e880b196130270ed9709cf1ea0e19e0a
parent e8319618
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -191,7 +191,7 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch
            // need to manually set the duration to a reasonable value.
            // need to manually set the duration to a reasonable value.
            animator.setDuration(HINT_STATE.getTransitionDuration(mLauncher, true /* isToState */));
            animator.setDuration(HINT_STATE.getTransitionDuration(mLauncher, true /* isToState */));
        }
        }
        if (FeatureFlags.ENABLE_HAPTICS_ALL_APPS.get() &&
        if (FeatureFlags.ENABLE_PREMIUM_HAPTICS_ALL_APPS.get() &&
                ((mFromState == NORMAL && mToState == ALL_APPS)
                ((mFromState == NORMAL && mToState == ALL_APPS)
                        || (mFromState == ALL_APPS && mToState == NORMAL)) && isFling) {
                        || (mFromState == ALL_APPS && mToState == NORMAL)) && isFling) {
            mVibratorWrapper.vibrateForDragBump();
            mVibratorWrapper.vibrateForDragBump();
+4 −3
Original line number Original line Diff line number Diff line
@@ -355,7 +355,7 @@ public class AllAppsTransitionController
            });
            });
        }
        }


        if(FeatureFlags.ENABLE_HAPTICS_ALL_APPS.get() && config.userControlled
        if(FeatureFlags.ENABLE_PREMIUM_HAPTICS_ALL_APPS.get() && config.userControlled
                && Utilities.ATLEAST_S) {
                && Utilities.ATLEAST_S) {
            if (toState == ALL_APPS) {
            if (toState == ALL_APPS) {
                builder.addOnFrameListener(
                builder.addOnFrameListener(
@@ -385,8 +385,9 @@ public class AllAppsTransitionController
        builder.add(anim);
        builder.add(anim);


        setAlphas(toState, config, builder);
        setAlphas(toState, config, builder);

        // This controls both haptics for tapping on QSB and going to all apps.
        if (ALL_APPS.equals(toState) && mLauncher.isInState(NORMAL) && !(Utilities.ATLEAST_S)) {
        if (ALL_APPS.equals(toState) && mLauncher.isInState(NORMAL) &&
                !FeatureFlags.ENABLE_PREMIUM_HAPTICS_ALL_APPS.get()) {
            mLauncher.getAppsView().performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
            mLauncher.getAppsView().performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
                    HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
                    HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
        }
        }
+3 −2
Original line number Original line Diff line number Diff line
@@ -352,8 +352,9 @@ public final class FeatureFlags {
            "Enable the ability to tap a staged app during split select to launch it in full screen"
            "Enable the ability to tap a staged app during split select to launch it in full screen"
    );
    );


    public static final BooleanFlag ENABLE_HAPTICS_ALL_APPS = getDebugFlag(270396358,
    public static final BooleanFlag ENABLE_PREMIUM_HAPTICS_ALL_APPS = getDebugFlag(270396358,
            "ENABLE_HAPTICS_ALL_APPS", false, "Enables haptics opening/closing All apps");
            "ENABLE_PREMIUM_HAPTICS_ALL_APPS", false,
            "Enables haptics opening/closing All apps");


    public static final BooleanFlag ENABLE_FORCED_MONO_ICON = getDebugFlag(270396209,
    public static final BooleanFlag ENABLE_FORCED_MONO_ICON = getDebugFlag(270396209,
            "ENABLE_FORCED_MONO_ICON", false,
            "ENABLE_FORCED_MONO_ICON", false,