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

Commit d1bfd566 authored by Holly Sun's avatar Holly Sun
Browse files

[omni] Read long press duration from AppSearch and override server configured value.

Notify the appsearch values to systemui through SystemUiProxy.
See http://shortn/_WqYj0buH7R  for summary

Bug: 330446188
Test: manual. Side load agsa apk to read the value from AppSearch
Flag: legacy CUSTOM_LPNH_THRESHOLDS enabled
Change-Id: I7bd2688178da48ae8eb9e62e135304cba2fec8ce
parent c36076d7
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -454,6 +454,17 @@ public class SystemUiProxy implements ISystemUiProxy, NavHandle {
        }
    }

    @Override
    public void setOverrideHomeButtonLongPress(long duration, float slopMultiplier) {
        if (mSystemUiProxy != null) {
            try {
                mSystemUiProxy.setOverrideHomeButtonLongPress(duration, slopMultiplier);
            } catch (RemoteException e) {
                Log.w(TAG, "Failed call setOverrideHomeButtonLongPress", e);
            }
        }
    }

    @Override
    public void notifyAccessibilityButtonClicked(int displayId) {
        if (mSystemUiProxy != null) {
+4 −2
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import com.android.quickstep.InputConsumer;
import com.android.quickstep.NavHandle;
import com.android.quickstep.RecentsAnimationDeviceState;
import com.android.quickstep.TopTaskTracker;
import com.android.quickstep.util.AssistStateManager;
import com.android.systemui.shared.system.InputMonitorCompat;

/**
@@ -64,8 +65,9 @@ public class NavHandleLongPressInputConsumer extends DelegateInputConsumer {
        super(delegate, inputMonitor);
        mScreenWidth = DisplayController.INSTANCE.get(context).getInfo().currentSize.x;
        mDeepPressEnabled = FeatureFlags.ENABLE_LPNH_DEEP_PRESS.get();
        if (FeatureFlags.CUSTOM_LPNH_THRESHOLDS.get()) {
            mLongPressTimeout = FeatureFlags.LPNH_TIMEOUT_MS.get();
        AssistStateManager assistStateManager = AssistStateManager.INSTANCE.get(context);
        if (assistStateManager.getLPNHDurationMillis().isPresent()) {
            mLongPressTimeout = assistStateManager.getLPNHDurationMillis().get().intValue();
        } else {
            mLongPressTimeout = ViewConfiguration.getLongPressTimeout();
        }
+10 −0
Original line number Diff line number Diff line
@@ -52,6 +52,16 @@ public class AssistStateManager implements ResourceBasedOverride {
        return Optional.empty();
    }

    /** Get the Launcher overridden long press duration to trigger Assistant. */
    public Optional<Long> getLPNHDurationMillis() {
        return Optional.empty();
    }

    /** Get the Launcher overridden long press touch slop multiplier to trigger Assistant. */
    public Optional<Long> getLPNHCustomSlopMultiplier() {
        return Optional.empty();
    }

    /** Return {@code true} if the Settings toggle is enabled. */
    public boolean isSettingsAllEntrypointsEnabled() {
        return false;
+10 −1
Original line number Diff line number Diff line
@@ -132,7 +132,16 @@ public final class FeatureFlags {

    public static final BooleanFlag CUSTOM_LPNH_THRESHOLDS =
            getReleaseFlag(301680992, "CUSTOM_LPNH_THRESHOLDS", ENABLED,
                    "Add dev options to customize the LPNH trigger slop and milliseconds");
                    "Add dev options and server side control to customize the LPNH "
                            + "trigger slop and milliseconds");

    public static final BooleanFlag CUSTOM_LPH_THRESHOLDS = getReleaseFlag(331800576,
            "CUSTOM_LPH_THRESHOLDS", DISABLED,
            "Server side control to customize LPH timeout and touch slop");

    public static final BooleanFlag OVERRIDE_LPNH_LPH_THRESHOLDS = getReleaseFlag(331799727,
            "OVERRIDE_LPNH_LPH_THRESHOLDS", DISABLED,
            "Enable AGSA override for LPNH and LPH timeout and touch slop");

    public static final BooleanFlag ANIMATE_LPNH =
            getReleaseFlag(308693847, "ANIMATE_LPNH", TEAMFOOD,