Fix for IndexOutOfBounds in text pasting.
Fix for IndexOutOfBounds in text pasting.

Made paste safe even in case of replace problems due to filters.

Bug 3042016

Change-Id: I9be34fa41fa6117502bbd959f91c562f28fb4237

xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base,xorware/android_frameworks_base