How to detect the Input Method Picker visibility without the Accessibility permission
This should be a comment, but i can't comment yet.
You could use xposed
to achive that, but that would require a rooted device, and I guess thats out of discussion.
This is a thing the accessibility api is ment for. You already said you don't want to use the dirty way, so I would recommend you to just use said api.
There shouldn't be a way to do this for security concerns (and isn't afaik).