Loading core/java/android/view/KeyEvent.java +6 −0 Original line number Original line Diff line number Diff line Loading @@ -1216,6 +1216,12 @@ public class KeyEvent extends InputEvent implements Parcelable { */ */ public static final int FLAG_FALLBACK = 0x400; public static final int FLAG_FALLBACK = 0x400; /** * Private flag that indicates that event was sent from EdgeBackGestureHandler. * @hide */ public static final int FLAG_LONG_SWIPE = 0x800; /** /** * Signifies that the key is being predispatched. * Signifies that the key is being predispatched. * @hide * @hide Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -235,9 +235,9 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa @Override @Override public void triggerBack(boolean isLongPress) { public void triggerBack(boolean isLongPress) { sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK, sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK, isLongPress ? KeyEvent.FLAG_LONG_PRESS : 0); isLongPress ? KeyEvent.FLAG_LONG_SWIPE : 0); sendEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK, sendEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK, isLongPress ? KeyEvent.FLAG_LONG_PRESS : 0); isLongPress ? KeyEvent.FLAG_LONG_SWIPE : 0); mOverviewProxyService.notifyBackAction(true, (int) mDownPoint.x, mOverviewProxyService.notifyBackAction(true, (int) mDownPoint.x, (int) mDownPoint.y, false /* isButton */, !mIsOnLeftEdge); (int) mDownPoint.y, false /* isButton */, !mIsOnLeftEdge); Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +1 −3 Original line number Original line Diff line number Diff line Loading @@ -719,8 +719,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { private PendingIntent mTorchOffPendingIntent; private PendingIntent mTorchOffPendingIntent; private boolean mLongSwipeDown; private boolean mLongSwipeDown; private static final int LONG_SWIPE_FLAGS = KeyEvent.FLAG_LONG_PRESS | KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY; private LineageHardwareManager mLineageHardware; private LineageHardwareManager mLineageHardware; Loading Loading @@ -4263,7 +4261,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Handle special keys. // Handle special keys. switch (keyCode) { switch (keyCode) { case KeyEvent.KEYCODE_BACK: { case KeyEvent.KEYCODE_BACK: { boolean isLongSwipe = (event.getFlags() & LONG_SWIPE_FLAGS) == LONG_SWIPE_FLAGS; boolean isLongSwipe = (event.getFlags() & KeyEvent.FLAG_LONG_SWIPE) != 0; if (mLongSwipeDown && isLongSwipe && !down) { if (mLongSwipeDown && isLongSwipe && !down) { // Trigger long swipe action // Trigger long swipe action performKeyAction(mEdgeLongSwipeAction, event); performKeyAction(mEdgeLongSwipeAction, event); Loading Loading
core/java/android/view/KeyEvent.java +6 −0 Original line number Original line Diff line number Diff line Loading @@ -1216,6 +1216,12 @@ public class KeyEvent extends InputEvent implements Parcelable { */ */ public static final int FLAG_FALLBACK = 0x400; public static final int FLAG_FALLBACK = 0x400; /** * Private flag that indicates that event was sent from EdgeBackGestureHandler. * @hide */ public static final int FLAG_LONG_SWIPE = 0x800; /** /** * Signifies that the key is being predispatched. * Signifies that the key is being predispatched. * @hide * @hide Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -235,9 +235,9 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa @Override @Override public void triggerBack(boolean isLongPress) { public void triggerBack(boolean isLongPress) { sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK, sendEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK, isLongPress ? KeyEvent.FLAG_LONG_PRESS : 0); isLongPress ? KeyEvent.FLAG_LONG_SWIPE : 0); sendEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK, sendEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK, isLongPress ? KeyEvent.FLAG_LONG_PRESS : 0); isLongPress ? KeyEvent.FLAG_LONG_SWIPE : 0); mOverviewProxyService.notifyBackAction(true, (int) mDownPoint.x, mOverviewProxyService.notifyBackAction(true, (int) mDownPoint.x, (int) mDownPoint.y, false /* isButton */, !mIsOnLeftEdge); (int) mDownPoint.y, false /* isButton */, !mIsOnLeftEdge); Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +1 −3 Original line number Original line Diff line number Diff line Loading @@ -719,8 +719,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { private PendingIntent mTorchOffPendingIntent; private PendingIntent mTorchOffPendingIntent; private boolean mLongSwipeDown; private boolean mLongSwipeDown; private static final int LONG_SWIPE_FLAGS = KeyEvent.FLAG_LONG_PRESS | KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY; private LineageHardwareManager mLineageHardware; private LineageHardwareManager mLineageHardware; Loading Loading @@ -4263,7 +4261,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Handle special keys. // Handle special keys. switch (keyCode) { switch (keyCode) { case KeyEvent.KEYCODE_BACK: { case KeyEvent.KEYCODE_BACK: { boolean isLongSwipe = (event.getFlags() & LONG_SWIPE_FLAGS) == LONG_SWIPE_FLAGS; boolean isLongSwipe = (event.getFlags() & KeyEvent.FLAG_LONG_SWIPE) != 0; if (mLongSwipeDown && isLongSwipe && !down) { if (mLongSwipeDown && isLongSwipe && !down) { // Trigger long swipe action // Trigger long swipe action performKeyAction(mEdgeLongSwipeAction, event); performKeyAction(mEdgeLongSwipeAction, event); Loading