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

Merge commit '6024ca5c90203b6c33acc6adfbf7e4e613549a0a' into froyo-plus-aosp

* commit '6024ca5c90203b6c33acc6adfbf7e4e613549a0a':
  Fix bug 2185026 - back button in context menu now calls onContextMenuClosed()
This commit is contained in:
Adam Powell
2010-04-02 16:20:54 -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;
}
}
}
}
}