Magictext text for foreground app consistently returns different results compared to dumpsys and other plugins after certain situation. A bug?

sampleuserhere

Active member
Current behaviour

{fg_app_name} and {fg_app_package} return current occupying foreground app. However if an overlay recently has just popped up or been interacted with, it returns that last overlay app instead.

Demo.


Expected behaviour

{fg_app_name} and {fg_app_package} return current occupying foreground app, similar to what AutoInput Query, TouchTask Read Screen, and the following dumpsys command line dumpsys activity activities | grep "mResumedActivity" | cut -d "{" -f2 | cut -d " " -f3 | sed "s/\///g" (appActivity) return.

I'm running the latest beta.


Anyway, Is there some sort of way I could query the app name (label) with the package name natively?

I'm perfectly good with utilizing plugin, which what I have been doing so far. However I had just refactored the action block so It could run pure native with Read Screen Content action. If possible, I'd prefer to not write it all over again. It was my mistakes editing without making a copy first.

TIA.
 

Attachments

  • BroadcastID[1].macro
    29.5 KB · Views: 1

Endercraft

Moderator (& bug finder :D)
My suspicion is that because the foreground app is queried with accessibility services it also returns overlay package, but honestly I don't know much about this other than the behavior. @MacroDroidDev surely knows about this.
 

sampleuserhere

Active member
My suspicion is that because the foreground app is queried with accessibility services it also returns overlay package, but honestly I don't know much about this other than the behavior. @MacroDroidDev surely knows about this.
It must be. TouchTask is pretty much doing the same stuff. You can even see the details about the windows as well.


Windows types
It can be: application, overlay, system, input, split screen divider

The difference is that TouchTask returns `application` window type when the output for "Window names" is assigned to a string variable.
 
Top