am a6309c30: On BACK in search, hide just IME if IME is fullscreen

Merge commit 'a6309c30722ad3aee88ddc2394cea2a499168d99' into eclair-plus-aosp

* commit 'a6309c30722ad3aee88ddc2394cea2a499168d99':
  On BACK in search, hide just IME if IME is fullscreen
This commit is contained in:
Bjorn Bringert
2009-10-01 03:02:48 -07:00
committed by Android Git Automerger

View File

@@ -1812,7 +1812,18 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
@Override
public void onBackPressed() {
// If the input method is covering the search dialog completely,
// e.g. in landscape mode with no hard keyboard, dismiss just the input method
InputMethodManager imm = (InputMethodManager)getContext()
.getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null && imm.isFullscreenMode() &&
imm.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), 0)) {
return;
}
// Otherwise, go back to any previous source (e.g. back to QSB when
// pivoted into a source.
if (!backToPreviousComponent()) {
// If no previous source, close search dialog
cancel();
}
}