@@ -49,8 +49,6 @@ import android.view.MotionEvent
4949import android.view.View
5050import android.view.WindowManager
5151import android.view.inputmethod.BaseInputConnection
52- import android.view.inputmethod.EditorInfo
53- import android.view.inputmethod.InputConnection
5452import android.widget.CheckBox
5553import android.widget.EditText
5654import android.widget.Toast
@@ -73,7 +71,6 @@ import org.wordpress.aztec.handlers.ListHandler
7371import org.wordpress.aztec.handlers.ListItemHandler
7472import org.wordpress.aztec.handlers.PreformatHandler
7573import org.wordpress.aztec.handlers.QuoteHandler
76- import org.wordpress.aztec.ime.EditorInfoUtils
7774import org.wordpress.aztec.plugins.IAztecPlugin
7875import org.wordpress.aztec.plugins.IToolbarButton
7976import org.wordpress.aztec.source.Format
@@ -122,7 +119,6 @@ import org.wordpress.aztec.watchers.event.text.BeforeTextChangedEventData
122119import org.wordpress.aztec.watchers.event.text.OnTextChangedEventData
123120import org.wordpress.aztec.watchers.event.text.TextWatcherEvent
124121import org.xml.sax.Attributes
125- import java.lang.ref.WeakReference
126122import java.security.MessageDigest
127123import java.security.NoSuchAlgorithmException
128124import java.util.ArrayList
@@ -297,9 +293,6 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
297293
298294 private var focusOnVisible = true
299295
300- var inputConnectionRef: WeakReference <InputConnection >? = null
301- var inputConnectionEditorInfo: EditorInfo ? = null
302-
303296 interface OnSelectionChangedListener {
304297 fun onSelectionChanged (selStart : Int , selEnd : Int )
305298 }
@@ -671,45 +664,6 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
671664 }
672665 }
673666
674- override fun onCreateInputConnection (outAttrs : EditorInfo ) : InputConnection {
675- // limiting the reuseInputConnection fix for Anroid 8.0.0 for now
676- if (Build .VERSION .SDK_INT == Build .VERSION_CODES .O ) {
677- return handleReuseInputConnection(outAttrs)
678- }
679-
680- return super .onCreateInputConnection(outAttrs)
681- }
682-
683- private fun handleReuseInputConnection (outAttrs : EditorInfo ) : InputConnection {
684- // initialize inputConnectionEditorInfo
685- if (inputConnectionEditorInfo == null ) {
686- inputConnectionEditorInfo = outAttrs
687- }
688-
689- // now init the InputConnection, or replace if EditorInfo contains anything different
690- if (inputConnectionRef?.get() == null || ! EditorInfoUtils .areEditorInfosTheSame(outAttrs, inputConnectionEditorInfo!! )) {
691- // we have a new InputConnection to create, save the new EditorInfo data and create it
692- // we make a copy of the parameters being received, because super.onCreateInputConnection may make changes
693- // to EditorInfo params being sent to it, and we want to preserve the same data we received in order
694- // to compare.
695- // (see https://android.googlesource.com/platform/frameworks/base/+/jb-mr0-release/core/java/android/widget/
696- // TextView.java#5404)
697- inputConnectionEditorInfo = EditorInfoUtils .copyEditorInfo(outAttrs)
698- val localInputConnection = super .onCreateInputConnection(outAttrs)
699- if (localInputConnection == null ) {
700- // in case super returns null, let's just observe the base implementation, no need to make
701- // an InputConnectionWrapper of a null target
702- return localInputConnection
703- }
704- // if non null, wrap the new InputConnection around our wrapper (used for logging purposes only)
705- // inputConnection = AztecTextInputConnectionWrapper(localInputConnection, this)
706- inputConnectionRef = WeakReference (localInputConnection)
707- }
708-
709- // return the existing inputConnection
710- return inputConnectionRef?.get()!!
711- }
712-
713667 // We are exposing this method in order to allow subclasses to set their own alpha value
714668 // for preformatted background
715669 open fun getPreformatBackgroundAlpha (styles : TypedArray ): Float {
0 commit comments