Start Tracking Service externally

AntonK2 months ago

I'm implementing a kind of automation on my Android-phone (Android 6.0) with Automate app, and I want to start the Traccar Client service (Tracking Service) from corresponding controlling block.
Unfortunately this step fails with the exception:

java.lang.SecurityException: Not allowed to start service Intent { cmp=org.traccar.client/.TrackingService }
   without permission not exported from uid 10150

I guess, the service is marked as private. Can it be made public?

Is there any other way to start the service? Maybe with an intent?

Anton Tananaev2 months ago

Use shortcut intents instead.

AntonK2 months ago

Thanks a lot for quick reply!
I wasn't aware of the functionality with shortcuts.
Anyway it works great with one minor issue: the client doesn't see the service state change (or does it with significant delay), so the app should be restarted.
And the client window is brought to foreground, but that could be a side-effect of App start shortcut block.