Fix NPE when pasting non-text from Clipboard

When copying a link from a bookmark and then pasting it into
a textfield a NullPointerException will occur.
A ClipData.Item is not guaranteed to always contain a text string
and therefore getText() can be set to null.

Using method coerceToText() instead of getText() makes sure that
a text string is always returned.

Change-Id: I81343c0371835a3a7a52045dcd1760e69e59a967
Can not mark the same content of browser page after copy

Marking a text on the web page and then press copy works,
but trying to mark the same text again does not work.
The reason for this is that the selection never gets
cleared in webkit.
The fix, calling cleaSelection in the onDestroyActionMode.
Also added clearSelection when getting an
onConfigurationChange.

Change-Id: I59b384cb5441b6a3a05007ea7e77f9699889a87c
FIX Null Pointer Exception on dialog cancel

Null Pointer Exception occurs because mWebViewCore instance
is made to null while calling destroyJava(). When
1.webview hosting activity goest to background, without calling webview onPause().
2. If app is launched again (having launchmode:singletask ) and another activity (not  webview hosting) comes on top top.
3. It destorys the previous activity holding webview which internally tries to cancel the dialog, but webviewcore instance is null.
Null pointer exception is raised.

Change-Id: Idbcd30d0b0d4a35819444bbaa5c73cced8bb35a3
Signed-off-by: Amit Kumar <amitkecian@gmail.com>
Email force close when pressing back key after selecting characters

Email and Browser will be forced closed after selecting a text
and then press the back key, tilting the screen or trying to
share or copy the text. This is because a previouse fix
is using a part of the code that Google has removed.
Fix: clearSelection will now use its own EventHub id,
CLEAR_SELECT_TEXT.

This part describes the previous fix.
Marking a text on the web page and then press copy works,
but trying to mark the same text again does not work.
The reason for this is that the selection never gets
cleared in webkit.
The fix, calling cleaSelection in the onDestroyActionMode.
Also added clearSelection when getting an
onConfigurationChange.

FIX=DMS01503793

Change-Id: I5e5673bac4efb3d28e9fc613da4bf636f8ab3c39