[WifiSettings] Submit Wi-Fi dialog with enter key

Add a OnKeyListener for hardware keyboards and an
OnEditorActionListener for on-screen IMEs to submit the Wi-Fi dialog
with the currently entered information.

Before committing the action, check for whether the dialog is
submittable -- that is checking whether all necessary information has
been entered. If not the enter key behaves the same as it is before
the change.

Bug: 22211604
Bug: 25357079
Change-Id: Ia332435bc96414db9c6835612bc4c7d29c7c3669
Original-Change-Id: Idede4233a7385d3bcd8fd6614948270280536bf1
[cernekee: backported from master]
5 files changed