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

Add SetProfile Activity for external use #11

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

Blacky-Toggle
Copy link
Contributor

First of all great thanks to you @saiho for the great app.

I don't know if you find this useful and if the code style fits your needs. But in the case you or someone else finds this useful I've decided to create this PR.

This api.SetProfile activity can be triggered from external app (e.g. Tasker).

Issues #6 (@bbbco) and #7 (@landry314) can then be circumvented by using the activity directly from Tasker and create a widget using this Task in an external widget supporting activites.
So it is possible to change LineageOS profiles programmatically without the need to have a rooted device.

The activity needs to be used as follows:

intent:
android.intent.action.MAIN
package name:
com.saiho.togglelineageprofiles
class name:
com.saiho.togglelineageprofiles.api.SetProfile

extra:
string com.saiho.togglelineageprofiles.api.profileName

It's tested with LOS 18.1 and 19.1 with E-Robot.

@saiho
Copy link
Owner

saiho commented Aug 3, 2022

Thanks a lot, your contribution is appreciated. I will merge your changes.
I am just preparing a new version. I was just cleaning the code by removing support for the old Cyanogenmod. When ready, your changes can be part of the new release. However, I will not be able to properly test them because I do not use Tasker. I hope you can provide some feedback.

@saiho saiho merged commit 7aceb3d into saiho:master Aug 3, 2022
@harphere
Copy link

harphere commented Nov 30, 2022

@Blacky-Toggle, can you please clarify the Tasker intent format please? Here's my latest attempt:
Task: Test Task
A1: Send Intent [
Action: android.intent.action.MAIN
Cat: None
Extra: com.saiho.togglelineageprofiles.api.wifidisconnect
Package: com.saiho.togglelineageprofiles.api
Class: com.saiho.togglelineageprofiles.api.SetProfile
Target: Activity ]

@mrplumber
Copy link

@Blacky-Toggle, can you please clarify the Tasker intent format please? Here's my latest attempt: Task: Test Task A1: Send Intent [ Action: android.intent.action.MAIN Cat: None Extra: com.saiho.togglelineageprofiles.api.wifidisconnect Package: com.saiho.togglelineageprofiles.api Class: com.saiho.togglelineageprofiles.api.SetProfile Target: Activity ]

@nickelnine, try this:

Task: Test Task
A1: Send Intent [
Action: android.intent.action.MAIN
Cat: None (may try some other value)
Extra: com.saiho.togglelineageprofiles.api.profileName:wifidisconnect
Package: com.saiho.togglelineageprofiles.api
Class: com.saiho.togglelineageprofiles.api.SetProfile
Target: Activity ]

Take a look at Tasker Intents documentation here.

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.

None yet

4 participants