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

How to use custom actions? #489

Closed
ghost opened this issue Feb 22, 2021 · 2 comments
Closed

How to use custom actions? #489

ghost opened this issue Feb 22, 2021 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 22, 2021

Where can I find a documentation on using custom actions?

I want to activate Do Not Disturb mode at a specific time.

@forrestguice
Copy link
Owner

forrestguice commented Feb 22, 2021

Here's some documentation aimed at developers; https://developer.android.com/reference/android/content/Intent .. The custom actions just exposes this api, allowing users to create and trigger their own intents.

However, I'm not entirely sure its possible to trigger Do Not Disturb via intent. This is something to be researched.

What is possible is to launch a specific app, or to trigger a specific action supported by that app. Another possibility is to allow the system to choose the app - this is what happens when the Intent has fields that are blank (referred to as an implicit intent). For example, an Intent with an Action android.intent.action.VIEW and Data containing a geo uri (e.g. geo:33,-112 will trigger the default map app at the given coordinates. To launch a specific app (instead of letting the system choose) we need to fill out the Class field.

You might try "Intent Intercept" available on F-Droid (https://f-droid.org/en/packages/de.k3b.android.intentintercept/). Its useful for exploring the Intents offered by various apps. Otherwise the only way to know about them (and what is possible) is to find official documentation. Hopefully the DnD functionality has been exposed this way, otherwise you might be out of luck.

@forrestguice
Copy link
Owner

Supposing Do Not Disturb can't be triggered with intent, it should be possible to get this done by writing a custom app that responds to an Intent and triggers it for you. Its possible to trigger Do Not Disturb with NotificationManager but requires special permission (https://stackoverflow.com/questions/31862753/android-how-to-turn-on-do-not-disturb-dnd-programmatically).

forrestguice added a commit that referenced this issue Feb 19, 2022
Adds 'online-help' button to actions help dialog; links to project wiki.
#489, #546
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

No branches or pull requests

1 participant