2
Solved

Clipboard monitoring makes keyboard to glitch

Hi.
As always, huge thanks for continuing developing Tasker.
Want to report bug. Latest 5.15.3-beta, Android 11 (LineageOS 18.1).

Steps to reproduce:
0. Important: bug "activates" only after some time after Tasker was launched, like few hours
1. Create single task with any single action which use %CLIP variable, e.g. make Tasker to monitor it (via workaround, yeah)
2. While typing anywhere mark text and press Copy / Cut, e.g. change clipboard
2.1 Even enough modify clipboard via shell: service call clipboard 2 s16 "text"
3. For a second *any* keyboard hides and appears again (shown on attached video)
4. Also if set profile which monitor clipboard changes, action starts after ~2 seconds delay
5. Force stop, then launch Tasker and bug gone for a while

While inspecting /log/tasker.txt found that Tasker for some reason starts to change current keyboard on its own which results in this glitch. Please, can you take a look into this?

Log when all ok:

26-11-2021 ClipboardGetter: 11.24.42#m#ClipboardGetter: Detected clipboard change: 1637918682.844 1125 2179 E ClipboardService: Denying clipboard access to net.dinglisch.android.taskerm, application is not in focus nor is it a system service for user 0
26-11-2021 MyClip: 11.24.42#m#MyClip: getClipText: trying with rx from thread: main
26-11-2021 MyClip: 11.24.42#m#MyClip: getClipText: gotten with rx: android.content.ClipboardManager@169813e
26-11-2021 ClipboardGetter: 11.24.42#m#ClipboardGetter: mon: true - Got clipboard after overlay: text
26-11-2021 ClipboardGetter: 11.24.42#m#ClipboardGetter: mon: true - Is monitoring so caching gotten clipboard
26-11-2021 M: 11.24.42#m#M: Clipboard changed. Broadcasting variable change
26-11-2021 WakeLockManager: 11.24.42#b#WakeLockManager: acquired partial lock for M flags: 1 autorelease: true warn: true
26-11-2021 M: 11.24.42.992#m#M: handleStart: finished handling ID 215
26-11-2021 WakeLockManager: 11.24.42#m#WakeLockManager: release: M
26-11-2021 M: 11.24.42.993#b#M: process inbox, size 1 startID: 215 ecode 9996
26-11-2021 : 11.24.42#b#: eventType / 9996 (java.lang.Integer)
26-11-2021 : 11.24.42#b#: eventAct / net.dinglisch.android.tasker.VSETUM (java.lang.String)
26-11-2021 : 11.24.42#b#: eventExt (Bundle)
26-11-2021 : 11.24.42#b#: vname / %CLIP (java.lang.String)
26-11-2021 WakeLockManager: 11.24.42.993#m#WakeLockManager: cancel clear alarm, lastSetTime 1637918682935
26-11-2021 WakeLockManager: 11.24.42.995#m#WakeLockManager: cancelled clear alarm
26-11-2021 M: 11.24.42.997#b#M: checkMatchStates: handleChanges: true handle:
26-11-2021 M: 11.24.42#b#M: occurred event count: 1 with action: net.dinglisch.android.tasker.VSETUM
26-11-2021 M: 11.24.42#b#M: handleSystemEvent: no profiles

Log when bug kicks in:

26-11-2021 ClipboardGetter: 11.16.54#m#ClipboardGetter: Detected clipboard change: 1637918214.012 1125 5458 E ClipboardService: Denying clipboard access to com.google.android.gms, application is not in focus nor is it a system service for user 0
26-11-2021 ClipboardGetter: 11.16.54#m#ClipboardGetter: mon: true - Not trying with overlay because previously failed
26-11-2021 ClipboardGetter: 11.16.54#m#ClipboardGetter: Current Keyboard is inputmethod.latin.perfectkeyboard/com.android.inputmethod.latin.LatinIME
26-11-2021 ClipboardGetter: 11.16.55#m#ClipboardGetter: Set keyboard to net.dinglisch.android.taskerm/com.joaomgcd.taskerm.keyboard.InputMethodServiceTasker
26-11-2021 ClipboardGetter: 11.16.55#m#ClipboardGetter: mon: true - Set keyboard to net.dinglisch.android.taskerm/com.joaomgcd.taskerm.keyboard.InputMethodServiceTasker
26-11-2021 MyClip: 11.16.55#m#MyClip: getClipText: trying with rx from thread: main
26-11-2021 MyClip: 11.16.55#m#MyClip: getClipText: gotten with rx: android.content.ClipboardManager@309f577

In logcat all identical for both states:

D androidtc: Initializing SystemTextClassifier, type = System
W androidtc: TextClassifier called on main thread
D androidtc: Initializing SystemTextClassifier, type = System
W androidtc: TextClassifier called on main thread
W androidtc: TextClassifier called on main thread
E ClipboardService: Denying clipboard access to net.dinglisch.android.taskerm, application is not in focus nor is it a system service for user 0
E ClipboardService: Denying clipboard access to com.google.android.gms, application is not in focus nor is it a system service for user 0

3 replies

U

Only now noticed obvious line: "Not trying with overlay because previously failed".

So Tasker falls back to other method to read clipboard by temporary setting itself as keyboard which is not restricted. Okay, how to prevent this?

I tried to disable com.joaomgcd.taskerm.keyboard.InputMethodServiceTasker, but then after copying normal keyboard not appears.

#

Same issue here. Tasker 5.14.6, Android 10 (Hydrogen OS 10).

It has been bothering me for a long time.

As you mentioned, this only happens if for some reason Tasker is not able to get the clipboard with the overlay, so it falls back to the keyboard hack.

Unfortunately if I didn't do this it would simply stop working at times because for some reason sometimes it just won't work with the overlay.

Topic is closed for comments