Loading core/java/android/app/Activity.java +17 −1 Original line number Diff line number Diff line Loading @@ -3882,7 +3882,9 @@ public class Activity extends ContextThemeWrapper * it will set up the dispatch to call {@link #onKeyUp} where the action * will be performed; for earlier applications, it will perform the * action immediately in on-down, as those versions of the platform * behaved. * behaved. This implementation will also take care of {@link KeyEvent#KEYCODE_ESCAPE} * by finishing the activity if it would be closed by touching outside * of it. * * <p>Other additional default key handling may be performed * if configured with {@link #setDefaultKeyMode}. Loading @@ -3904,6 +3906,11 @@ public class Activity extends ContextThemeWrapper return true; } if (keyCode == KeyEvent.KEYCODE_ESCAPE && mWindow.shouldCloseOnTouchOutside()) { event.startTracking(); return true; } if (mDefaultKeyMode == DEFAULT_KEYS_DISABLE) { return false; } else if (mDefaultKeyMode == DEFAULT_KEYS_SHORTCUT) { Loading Loading @@ -3999,6 +4006,15 @@ public class Activity extends ContextThemeWrapper return true; } } if (keyCode == KeyEvent.KEYCODE_ESCAPE && mWindow.shouldCloseOnTouchOutside() && event.isTracking() && !event.isCanceled()) { finish(); return true; } return false; } Loading core/java/android/view/Window.java +5 −0 Original line number Diff line number Diff line Loading @@ -1481,6 +1481,11 @@ public abstract class Window { } } /** @hide */ public boolean shouldCloseOnTouchOutside() { return mCloseOnTouchOutside; } /** @hide */ @SuppressWarnings("HiddenAbstractMethod") @UnsupportedAppUsage Loading Loading
core/java/android/app/Activity.java +17 −1 Original line number Diff line number Diff line Loading @@ -3882,7 +3882,9 @@ public class Activity extends ContextThemeWrapper * it will set up the dispatch to call {@link #onKeyUp} where the action * will be performed; for earlier applications, it will perform the * action immediately in on-down, as those versions of the platform * behaved. * behaved. This implementation will also take care of {@link KeyEvent#KEYCODE_ESCAPE} * by finishing the activity if it would be closed by touching outside * of it. * * <p>Other additional default key handling may be performed * if configured with {@link #setDefaultKeyMode}. Loading @@ -3904,6 +3906,11 @@ public class Activity extends ContextThemeWrapper return true; } if (keyCode == KeyEvent.KEYCODE_ESCAPE && mWindow.shouldCloseOnTouchOutside()) { event.startTracking(); return true; } if (mDefaultKeyMode == DEFAULT_KEYS_DISABLE) { return false; } else if (mDefaultKeyMode == DEFAULT_KEYS_SHORTCUT) { Loading Loading @@ -3999,6 +4006,15 @@ public class Activity extends ContextThemeWrapper return true; } } if (keyCode == KeyEvent.KEYCODE_ESCAPE && mWindow.shouldCloseOnTouchOutside() && event.isTracking() && !event.isCanceled()) { finish(); return true; } return false; } Loading
core/java/android/view/Window.java +5 −0 Original line number Diff line number Diff line Loading @@ -1481,6 +1481,11 @@ public abstract class Window { } } /** @hide */ public boolean shouldCloseOnTouchOutside() { return mCloseOnTouchOutside; } /** @hide */ @SuppressWarnings("HiddenAbstractMethod") @UnsupportedAppUsage Loading