chore: add some log
This commit is contained in:
parent
6fdce63359
commit
9521ac6adb
@ -439,6 +439,8 @@ class InputService : AccessibilityService() {
|
|||||||
|
|
||||||
var success = false
|
var success = false
|
||||||
|
|
||||||
|
Log.d(logTag, "existing text:$text textToCommit:$textToCommit textSelectionStart:$textSelectionStart textSelectionEnd:$textSelectionEnd")
|
||||||
|
|
||||||
if (textToCommit != null) {
|
if (textToCommit != null) {
|
||||||
var newText = ""
|
var newText = ""
|
||||||
|
|
||||||
@ -451,6 +453,7 @@ class InputService : AccessibilityService() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log.d(logTag, "inserting text new text:$newText")
|
||||||
val arguments = Bundle()
|
val arguments = Bundle()
|
||||||
arguments.putCharSequence(
|
arguments.putCharSequence(
|
||||||
AccessibilityNodeInfo.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE,
|
AccessibilityNodeInfo.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE,
|
||||||
@ -464,6 +467,7 @@ class InputService : AccessibilityService() {
|
|||||||
this.fakeEditTextForTextStateCalculation?.setText(text)
|
this.fakeEditTextForTextStateCalculation?.setText(text)
|
||||||
}
|
}
|
||||||
if (textSelectionStart != -1 && textSelectionEnd != -1) {
|
if (textSelectionStart != -1 && textSelectionEnd != -1) {
|
||||||
|
Log.d(logTag, "setting selection $textSelectionStart $textSelectionEnd")
|
||||||
this.fakeEditTextForTextStateCalculation?.setSelection(
|
this.fakeEditTextForTextStateCalculation?.setSelection(
|
||||||
textSelectionStart,
|
textSelectionStart,
|
||||||
textSelectionEnd
|
textSelectionEnd
|
||||||
@ -473,6 +477,7 @@ class InputService : AccessibilityService() {
|
|||||||
this.fakeEditTextForTextStateCalculation?.let {
|
this.fakeEditTextForTextStateCalculation?.let {
|
||||||
val inputConnection = it.onCreateInputConnection(EditorInfo())
|
val inputConnection = it.onCreateInputConnection(EditorInfo())
|
||||||
if (inputConnection != null) {
|
if (inputConnection != null) {
|
||||||
|
Log.d(logTag, "sending keyevent $event")
|
||||||
success = inputConnection.sendKeyEvent(event)
|
success = inputConnection.sendKeyEvent(event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -484,6 +489,7 @@ class InputService : AccessibilityService() {
|
|||||||
newText.toString()
|
newText.toString()
|
||||||
)
|
)
|
||||||
success = node.performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, arguments)
|
success = node.performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, arguments)
|
||||||
|
Log.d(logTag, "Update text to $newText success:$success")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (success && this.fakeEditTextForTextStateCalculation != null) {
|
if (success && this.fakeEditTextForTextStateCalculation != null) {
|
||||||
@ -501,6 +507,7 @@ class InputService : AccessibilityService() {
|
|||||||
selectionEnd
|
selectionEnd
|
||||||
)
|
)
|
||||||
success = node.performAction(AccessibilityNodeInfo.ACTION_SET_SELECTION, arguments)
|
success = node.performAction(AccessibilityNodeInfo.ACTION_SET_SELECTION, arguments)
|
||||||
|
Log.d(logTag, "Update selection to $selectionStart $selectionEnd success:$success")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user