Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get notification shade name in current system language for event.text matching ( #23 ) #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EmiyaSyahriel
Copy link

@EmiyaSyahriel EmiyaSyahriel commented Jun 13, 2024

This should fix #23 , but I am using a APIs that is discouraged by Android documentation.

How this works is we load System UI resources, get the string for the notification shade name in current system language and then return it for event.text matching. It will fallback to "Notification shade" in case the string resource is no longer named this way. and this call should be compatible from Android API 19 KitKat (or maybe older) up to the latest Android API 34.

The loading System UI resource part would require some additional RAM, therefore there might be some hiccup on some lower-end device.

EDIT : I have to sign my commit and force-push it, I forgot to setup my git client here 🙂

What do you think about this?

Signed-off-by: Syahriel Ibnu Irfansyah <[email protected]>
@EmiyaSyahriel EmiyaSyahriel changed the title Add system shade name getter ( #23 ) Get notification shade name in current system language for event.text matching ( #23 ) Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ineffective notification shade event detection against system UI languages other than english
1 participant