Give InputMode the package name as extra variable.
This commit is contained in:
parent
fcb15459d0
commit
add9d0d020
@ -6,7 +6,6 @@ import android.inputmethodservice.InputMethodService
|
||||
import android.media.AudioManager
|
||||
import android.media.MediaRecorder
|
||||
import android.net.Uri
|
||||
import android.opengl.ETC1.getHeight
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.text.InputType
|
||||
@ -780,6 +779,10 @@ class WKT9: InputMethodService(), SpellCheckerSession.SpellCheckerSessionListene
|
||||
}
|
||||
}
|
||||
|
||||
attribute?.packageName?.let {
|
||||
inputMode?.packageName(it)
|
||||
}
|
||||
|
||||
updateInputStatus()
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ open class BaseInputMode: InputMode {
|
||||
protected var newKey = true
|
||||
protected var keyIndex = 0
|
||||
protected var lastKey: Key? = null
|
||||
protected var packageName: String? = null
|
||||
|
||||
protected open val keyCommandResolver: KeyCommandResolver = KeyCommandResolver.getBasic()
|
||||
|
||||
@ -43,6 +44,10 @@ open class BaseInputMode: InputMode {
|
||||
return KeyEventResult()
|
||||
}
|
||||
|
||||
override fun packageName(packageName: String) {
|
||||
this.packageName = packageName
|
||||
}
|
||||
|
||||
override fun restart() {
|
||||
Log.d(tag, "Restart should be handled by individual input modes")
|
||||
}
|
||||
|
@ -17,5 +17,7 @@ interface InputMode {
|
||||
|
||||
fun afterKeyLongDown(key: Key, keyDownMS: Long, composing: Boolean): KeyEventResult
|
||||
|
||||
fun packageName(packageName: String)
|
||||
|
||||
fun restart()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user