@@ -48,8 +48,6 @@ import android.view.MotionEvent
4848import android.view.View
4949import android.view.WindowManager
5050import android.view.inputmethod.BaseInputConnection
51- import android.view.inputmethod.EditorInfo
52- import android.view.inputmethod.InputConnection
5351import android.widget.CheckBox
5452import android.widget.EditText
5553import android.widget.Toast
@@ -72,7 +70,6 @@ import org.wordpress.aztec.handlers.ListHandler
7270import org.wordpress.aztec.handlers.ListItemHandler
7371import org.wordpress.aztec.handlers.PreformatHandler
7472import org.wordpress.aztec.handlers.QuoteHandler
75- import org.wordpress.aztec.ime.EditorInfoUtils
7673import org.wordpress.aztec.plugins.IAztecPlugin
7774import org.wordpress.aztec.plugins.IToolbarButton
7875import org.wordpress.aztec.source.Format
@@ -121,7 +118,6 @@ import org.wordpress.aztec.watchers.event.text.BeforeTextChangedEventData
121118import org.wordpress.aztec.watchers.event.text.OnTextChangedEventData
122119import org.wordpress.aztec.watchers.event.text.TextWatcherEvent
123120import org.xml.sax.Attributes
124- import java.lang.ref.WeakReference
125121import java.security.MessageDigest
126122import java.security.NoSuchAlgorithmException
127123import java.util.ArrayList
@@ -296,9 +292,6 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
296292
297293 private var focusOnVisible = true
298294
299- var inputConnectionRef: WeakReference <InputConnection >? = null
300- var inputConnectionEditorInfo: EditorInfo ? = null
301-
302295 interface OnSelectionChangedListener {
303296 fun onSelectionChanged (selStart : Int , selEnd : Int )
304297 }
@@ -670,45 +663,6 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
670663 }
671664 }
672665
673- override fun onCreateInputConnection (outAttrs : EditorInfo ) : InputConnection {
674- // limiting the reuseInputConnection fix for Anroid 8.0.0 for now
675- if (Build .VERSION .SDK_INT == Build .VERSION_CODES .O ) {
676- return handleReuseInputConnection(outAttrs)
677- }
678-
679- return super .onCreateInputConnection(outAttrs)
680- }
681-
682- private fun handleReuseInputConnection (outAttrs : EditorInfo ) : InputConnection {
683- // initialize inputConnectionEditorInfo
684- if (inputConnectionEditorInfo == null ) {
685- inputConnectionEditorInfo = outAttrs
686- }
687-
688- // now init the InputConnection, or replace if EditorInfo contains anything different
689- if (inputConnectionRef?.get() == null || ! EditorInfoUtils .areEditorInfosTheSame(outAttrs, inputConnectionEditorInfo!! )) {
690- // we have a new InputConnection to create, save the new EditorInfo data and create it
691- // we make a copy of the parameters being received, because super.onCreateInputConnection may make changes
692- // to EditorInfo params being sent to it, and we want to preserve the same data we received in order
693- // to compare.
694- // (see https://android.googlesource.com/platform/frameworks/base/+/jb-mr0-release/core/java/android/widget/
695- // TextView.java#5404)
696- inputConnectionEditorInfo = EditorInfoUtils .copyEditorInfo(outAttrs)
697- val localInputConnection = super .onCreateInputConnection(outAttrs)
698- if (localInputConnection == null ) {
699- // in case super returns null, let's just observe the base implementation, no need to make
700- // an InputConnectionWrapper of a null target
701- return localInputConnection
702- }
703- // if non null, wrap the new InputConnection around our wrapper (used for logging purposes only)
704- // inputConnection = AztecTextInputConnectionWrapper(localInputConnection, this)
705- inputConnectionRef = WeakReference (localInputConnection)
706- }
707-
708- // return the existing inputConnection
709- return inputConnectionRef?.get()!!
710- }
711-
712666 override fun onRestoreInstanceState (state : Parcelable ? ) {
713667 disableTextChangedListener()
714668
0 commit comments