Bug 5313754: SpellCheckSession is released when the window loses focus.
When an EditText is initialized with text, a new spell check is initiated
and previous spell check spans are removed.
Requires a new flag to prevent this from happening when the window focus
change comes from the suggestion popup window being shown.
Also fixes bug 5329588: handle spell check language change.
This change has been reverted. This amended change defers the creation
of the SpellChecker, so that it is only created for editable TextView.
Patch 3: Bug 5332065, the spell check session is closed in onDetachedFromWindow, which is
called when the window is destroyed (like on rotation), which was not the case with
onWindowFocusChanged.
Patch 5: Fixed life cycle. A view can be created and never attached to the hierarchy. As
a result, the spellCheck session would not be closed. Moved spell check to onAttach and
perform a spell check when text is changed by setText only if the view has previously
been attached (and the spellChecker has been created).
Change-Id: Ic2cfbfc0d3f23c589dd9e37f02e4afc1d625615d