tasker: plugin tweaks

This commit is contained in:
Alexander Capehart 2024-05-17 21:07:41 -06:00
parent 830ac34b67
commit 51309ebabb
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 4 additions and 7 deletions

View file

@ -141,7 +141,7 @@
android:name=".tasker.StartConfigBasicAction" android:name=".tasker.StartConfigBasicAction"
android:exported="true" android:exported="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="My Tasker Action"> android:label="Start Auxio">
<intent-filter> <intent-filter>
<action android:name="com.twofortyfouram.locale.intent.action.EDIT_SETTING" /> <action android:name="com.twofortyfouram.locale.intent.action.EDIT_SETTING" />
</intent-filter> </intent-filter>

View file

@ -50,8 +50,8 @@ class StartActionHelper(config: TaskerPluginConfig<Unit>) :
override fun addToStringBlurb(input: TaskerInput<Unit>, blurbBuilder: StringBuilder) { override fun addToStringBlurb(input: TaskerInput<Unit>, blurbBuilder: StringBuilder) {
blurbBuilder.append( blurbBuilder.append(
"Starts the Auxio Service. This will block until the service is fully initialized." + "Starts the Auxio Service. This will block until the service is fully initialized." +
"You must start active playback/foreground state after this or Auxio may" + "You must start active playback/foreground state after this or Auxio may" +
"crash.") "crash.")
} }
} }
@ -70,10 +70,7 @@ class StartConfigBasicAction : Activity(), TaskerPluginConfigNoInput {
class StartActionRunner : TaskerPluginRunnerActionNoOutputOrInput() { class StartActionRunner : TaskerPluginRunnerActionNoOutputOrInput() {
override fun run(context: Context, input: TaskerInput<Unit>): TaskerPluginResult<Unit> { override fun run(context: Context, input: TaskerInput<Unit>): TaskerPluginResult<Unit> {
ContextCompat.startForegroundService(context, Intent(context, AuxioService::class.java)) ContextCompat.startForegroundService(context, Intent(context, AuxioService::class.java))
while (!serviceRunning) { while (!serviceRunning) {}
Thread.sleep(100)
}
return TaskerPluginResultSucess() return TaskerPluginResultSucess()
} }
} }