Loading policy/src/com/android/internal/policy/impl/PhoneWindow.java +19 −6 Original line number Diff line number Diff line Loading @@ -1683,7 +1683,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { @Override public boolean dispatchKeyEvent(KeyEvent event) { final int keyCode = event.getKeyCode(); final boolean isDown = event.getAction() == KeyEvent.ACTION_DOWN; final int action = event.getAction(); final boolean isDown = action == KeyEvent.ACTION_DOWN; /* * If the user hits another key within the play sound delay, then Loading Loading @@ -1740,6 +1741,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } // Back cancels action modes first. if (mActionMode != null && keyCode == KeyEvent.KEYCODE_BACK) { if (action == KeyEvent.ACTION_UP) { mActionMode.finish(); } return true; } final Callback cb = getCallback(); final boolean handled = cb != null && mFeatureId < 0 ? cb.dispatchKeyEvent(event) : super.dispatchKeyEvent(event); Loading Loading @@ -1976,7 +1985,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { mActionMode.finish(); } ActionMode mode = getCallback().onStartActionMode(callback); final ActionMode.Callback wrappedCallback = new ActionModeCallbackWrapper(callback); ActionMode mode = getCallback().onStartActionMode(wrappedCallback); if (mode != null) { mActionMode = mode; } else { Loading @@ -1989,13 +1999,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } else { ViewStub stub = (ViewStub) findViewById( com.android.internal.R.id.action_mode_bar_stub); if (stub != null) { mActionModeView = (ActionBarContextView) stub.inflate(); } } } if (mActionModeView != null) { mode = new StandaloneActionMode(getContext(), mActionModeView, new ActionModeCallbackWrapper(callback)); mode = new StandaloneActionMode(getContext(), mActionModeView, wrappedCallback); if (callback.onCreateActionMode(mode, mode.getMenu())) { mode.invalidate(); mActionModeView.initForMode(mode); Loading Loading @@ -2213,7 +2224,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { public void onDestroyActionMode(ActionMode mode) { mWrapped.onDestroyActionMode(mode); if (mActionModeView != null) { mActionModeView.removeAllViews(); } mActionMode = null; } } Loading Loading
policy/src/com/android/internal/policy/impl/PhoneWindow.java +19 −6 Original line number Diff line number Diff line Loading @@ -1683,7 +1683,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { @Override public boolean dispatchKeyEvent(KeyEvent event) { final int keyCode = event.getKeyCode(); final boolean isDown = event.getAction() == KeyEvent.ACTION_DOWN; final int action = event.getAction(); final boolean isDown = action == KeyEvent.ACTION_DOWN; /* * If the user hits another key within the play sound delay, then Loading Loading @@ -1740,6 +1741,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } // Back cancels action modes first. if (mActionMode != null && keyCode == KeyEvent.KEYCODE_BACK) { if (action == KeyEvent.ACTION_UP) { mActionMode.finish(); } return true; } final Callback cb = getCallback(); final boolean handled = cb != null && mFeatureId < 0 ? cb.dispatchKeyEvent(event) : super.dispatchKeyEvent(event); Loading Loading @@ -1976,7 +1985,8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { mActionMode.finish(); } ActionMode mode = getCallback().onStartActionMode(callback); final ActionMode.Callback wrappedCallback = new ActionModeCallbackWrapper(callback); ActionMode mode = getCallback().onStartActionMode(wrappedCallback); if (mode != null) { mActionMode = mode; } else { Loading @@ -1989,13 +1999,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } else { ViewStub stub = (ViewStub) findViewById( com.android.internal.R.id.action_mode_bar_stub); if (stub != null) { mActionModeView = (ActionBarContextView) stub.inflate(); } } } if (mActionModeView != null) { mode = new StandaloneActionMode(getContext(), mActionModeView, new ActionModeCallbackWrapper(callback)); mode = new StandaloneActionMode(getContext(), mActionModeView, wrappedCallback); if (callback.onCreateActionMode(mode, mode.getMenu())) { mode.invalidate(); mActionModeView.initForMode(mode); Loading Loading @@ -2213,7 +2224,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { public void onDestroyActionMode(ActionMode mode) { mWrapped.onDestroyActionMode(mode); if (mActionModeView != null) { mActionModeView.removeAllViews(); } mActionMode = null; } } Loading