am 128f1a87: am 6024ca5c: Fix bug 2185026 - back button in context menu now calls onContextMenuClosed()

Merge commit '128f1a87c55a291109ce521a92308c186e5d2db5' into kraken

* commit '128f1a87c55a291109ce521a92308c186e5d2db5':
  Fix bug 2185026 - back button in context menu now calls onContextMenuClosed()
This commit is contained in:
Adam Powell
2010-04-02 16:25:33 -07:00
committed by Android Git Automerger

View File

@@ -101,11 +101,19 @@ public class MenuDialogHelper implements DialogInterface.OnKeyListener, DialogIn
}
}
}
} else if (event.getAction() == KeyEvent.ACTION_UP
&& event.isTracking() && !event.isCanceled()) {
mMenu.close(true);
dialog.dismiss();
return true;
} else if (event.getAction() == KeyEvent.ACTION_UP && !event.isCanceled()) {
Window win = mDialog.getWindow();
if (win != null) {
View decor = win.getDecorView();
if (decor != null) {
KeyEvent.DispatcherState ds = decor.getKeyDispatcherState();
if (ds != null && ds.isTracking(event)) {
mMenu.close(true);
dialog.dismiss();
return true;
}
}
}
}
}