Add fallback handling for gesture nav mode switch and launcher destroyed mid-gesture
If the gesture nav mode switches to button nav mode mid gesture, specifically while a recents animation start is pending, then we never invalidate AbsSwipeUpHandler. This leaves the LauncherInitListener registered in the ActivityTracker until the AbsSwipeUpHandler is invalidated by something like a quick switch. Since the AbsSwipeUpHandler is not invalidated by pressing the home button, this leaves the home button seeming unresponsive. Also added some clean up logic and debug logging to AbsSwipeUpHandler.onTasksAppeared since this path was confusing this investigation. Flag: NONE code clean up, debug logs and bug fix Fixes: 340748907 Test: adb shell cmd overlay enable-exclusive --category com.android.internal.systemui.navbar.threebutton && adb shell am start -n <component> while mid-gesture Change-Id: I72f0656a2a2b92006d2d13ba5868062f2f0aec33
This commit is contained in:
1 parent
810cab2e9c
commit
0b15d98271
4 files changed
+62
-22
No files matched your search
@@ -42,6 +42,7 @@ import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent
|
||||
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_DOWN;
|
||||
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_MOVE;
|
||||
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_UP;
|
||||
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.NAVIGATION_MODE_SWITCHED;
|
||||
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.RECENTS_ANIMATION_START_PENDING;
|
||||
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY;
|
||||
@@ -70,7 +71,6 @@ import android.hardware.input.InputManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.Looper;
|
||||
import android.os.RemoteException;
|
||||
import android.os.SystemClock;
|
||||
import android.os.Trace;
|
||||
import android.util.ArraySet;
|
||||
@@ -102,6 +102,7 @@ import com.android.launcher3.testing.shared.ResourceUtils;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
import com.android.launcher3.util.DisplayController;
|
||||
import com.android.launcher3.util.LockedUserState;
|
||||
import com.android.launcher3.util.NavigationMode;
|
||||
import com.android.launcher3.util.PluginManagerWrapper;
|
||||
import com.android.launcher3.util.SafeCloseable;
|
||||
import com.android.launcher3.util.ScreenOnTracker;
|
||||
@@ -622,6 +623,8 @@ public class TouchInteractionService extends Service {
|
||||
private InputManager mInputManager;
|
||||
private final Set<Integer> mTrackpadsConnected = new ArraySet<>();
|
||||
|
||||
private NavigationMode mGestureStartNavMode = null;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
@@ -836,14 +839,26 @@ public class TouchInteractionService extends Service {
|
||||
TestLogging.recordMotionEvent(
|
||||
TestProtocol.SEQUENCE_TIS, "TouchInteractionService.onInputEvent", event);
|
||||
|
||||
boolean isUserUnlocked = LockedUserState.get(this).isUserUnlocked();
|
||||
if (!isUserUnlocked || (mDeviceState.isButtonNavMode()
|
||||
&& !isTrackpadMotionEvent(event))) {
|
||||
if (!LockedUserState.get(this).isUserUnlocked()) {
|
||||
ActiveGestureLog.INSTANCE.addLog(new CompoundString("TIS.onInputEvent: ")
|
||||
.append("Cannot process input event: user is locked"));
|
||||
return;
|
||||
}
|
||||
|
||||
NavigationMode currentNavMode = mDeviceState.getMode();
|
||||
if (mGestureStartNavMode != null && mGestureStartNavMode != currentNavMode) {
|
||||
ActiveGestureLog.INSTANCE.addLog(new CompoundString("TIS.onInputEvent: ")
|
||||
.append("Navigation mode switched mid-gesture (")
|
||||
.append(mGestureStartNavMode.name())
|
||||
.append(" -> ")
|
||||
.append(currentNavMode.name())
|
||||
.append("); cancelling gesture."),
|
||||
NAVIGATION_MODE_SWITCHED);
|
||||
event.setAction(ACTION_CANCEL);
|
||||
} else if (mDeviceState.isButtonNavMode() && !isTrackpadMotionEvent(event)) {
|
||||
ActiveGestureLog.INSTANCE.addLog(new CompoundString("TIS.onInputEvent: ")
|
||||
.append("Cannot process input event: ")
|
||||
.append(!isUserUnlocked
|
||||
? "user is locked"
|
||||
: "using 3-button nav and event is not a trackpad event"));
|
||||
.append("using 3-button nav and event is not a trackpad event"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -870,6 +885,12 @@ public class TouchInteractionService extends Service {
|
||||
}
|
||||
}
|
||||
|
||||
if (action == ACTION_DOWN || isHoverActionWithoutConsumer) {
|
||||
mGestureStartNavMode = currentNavMode;
|
||||
} else if (action == ACTION_UP || action == ACTION_CANCEL) {
|
||||
mGestureStartNavMode = null;
|
||||
}
|
||||
|
||||
SafeCloseable traceToken = TraceHelper.INSTANCE.allowIpcs("TIS.onInputEvent");
|
||||
|
||||
CompoundString reasonString = action == ACTION_DOWN
|
||||
|
||||
Reference in new issue
Block a user