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

Commit 5cc3767e authored by Jagrut Desai's avatar Jagrut Desai
Browse files

Stop Active Gesture Error Detection for Non Gestural Navigation Mode

Bug: 290266108
Bug: 294926731
Test: Presubmit
Flag: not needed
Change-Id: I111d60fbedbeb7e8b553cdeadc0e3f39a9a351b2
parent a84e5041
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ import com.android.launcher3.util.DisplayController.Info;
import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.SettingsCache;
import com.android.quickstep.TopTaskTracker.CachedTaskInfo;
import com.android.quickstep.util.ActiveGestureLog;
import com.android.quickstep.util.NavBarPosition;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.QuickStepContract;
@@ -239,6 +240,7 @@ public class RecentsAnimationDeviceState implements DisplayInfoChangeListener {
    public void onDisplayInfoChanged(Context context, Info info, int flags) {
        if ((flags & (CHANGE_ROTATION | CHANGE_NAVIGATION_MODE)) != 0) {
            mMode = info.navigationMode;
            ActiveGestureLog.INSTANCE.setIsFullyGesturalNavMode(isFullyGesturalNavMode());
            mNavBarPosition = new NavBarPosition(mMode, info);

            if (mMode == NO_BUTTON) {
+5 −0
Original line number Diff line number Diff line
@@ -74,6 +74,11 @@ public class ActiveGestureErrorDetector {
            @NonNull PrintWriter writer,
            @NonNull ActiveGestureLog.EventLog eventLog) {
        writer.println(prefix + "Error messages for gesture ID: " + eventLog.logId);
        if (!eventLog.mIsFullyGesturalNavMode) {
            writer.println(prefix
                    + "\tSkipping gesture error detection because gesture navigation not enabled");
            return;
        }

        boolean errorDetected = false;
        // Use a Set since the order is inherently checked in the loop.
+10 −2
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ public class ActiveGestureLog {

    public static final ActiveGestureLog INSTANCE = new ActiveGestureLog();

    private boolean mIsFullyGesturalNavMode;

    /**
     * NOTE: This value should be kept same as
     * ActivityTaskManagerService#INTENT_EXTRA_LOG_TRACE_ID in platform
@@ -127,7 +129,7 @@ public class ActiveGestureLog {
            @Nullable ActiveGestureErrorDetector.GestureEvent gestureEvent) {
        EventLog lastEventLog = logs[(nextIndex + logs.length - 1) % logs.length];
        if (lastEventLog == null || mCurrentLogId != lastEventLog.logId) {
            EventLog eventLog = new EventLog(mCurrentLogId);
            EventLog eventLog = new EventLog(mCurrentLogId, mIsFullyGesturalNavMode);
            EventEntry eventEntry = new EventEntry();

            eventEntry.update(type, event, extras, compoundString, gestureEvent);
@@ -214,6 +216,10 @@ public class ActiveGestureLog {
        return mCurrentLogId++;
    }

    public void setIsFullyGesturalNavMode(boolean isFullyGesturalNavMode) {
        mIsFullyGesturalNavMode = isFullyGesturalNavMode;
    }

    /** Returns the current log ID. This should be used when a log trace is being reused. */
    public int getLogId() {
        return mCurrentLogId;
@@ -277,9 +283,11 @@ public class ActiveGestureLog {

        protected final List<EventEntry> eventEntries = new ArrayList<>();
        protected final int logId;
        protected final boolean mIsFullyGesturalNavMode;

        private EventLog(int logId) {
        private EventLog(int logId, boolean isFullyGesturalNavMode) {
            this.logId = logId;
            mIsFullyGesturalNavMode = isFullyGesturalNavMode;
        }
    }