Javascript to push an application to the forefront if not locked

MD
Maxim De Maeseneer
securitasclusterwest1

Hi all,

I'm looking for a javascript that I can run trough the task scheduler to a device that pushes an application to the forefront of the device every 5 minutes when the device is unlocked. (device is Android 14 / Xcover 6 pro Samsung)

I have a task scheduler running now with a legacy script that brings the app to the forefront every 5 min (script is: start package.name). The problem with this is, even when the user locks the device, the script will bring the app before the unlockscreen.

So i'm looking for a script that says:

If PDA locked

    no push application

else if pda unlocked

    start application every 5 min (bringing the application to the foreground every 5 min)

else

   no push application

end

Thank you for you help!

4 months ago
SOTI MobiControl
ANSWERS
RS
Rafael Schäfer
4 months ago

You really mean the lockscreen and not the lockdown? If that's so, there's no script i know of which gives you back this status.

If It's for lockdown it would be possible.

MD

Hi Rafael

I mean the lockscreen, i've also searched numerous sites but didn't find any solution because the lockscreen has no packagename of its own.. I've found one called com.android.systemui but this includes several system ui's (including the lockscreen).

Asked my TAM aswell and he also responded that this isn't possible due to Samsung. So i've come up with a different resolution.

RS
Rafael Schäfer
4 months ago

I don't think it's related to Samsung that it's not possible. It's just not possible because there's no JS available doing the relevant request (if possible).
I found something where they call the Keyguardmanager (inside of an app) up if that would (still) work (would be something to implement into the Soti agent being callde then via Agent JS API), i have no idea as i don't know about app development.

MD

No worries, I want to already thank you for the help so far!

A
AKMOD@SOTI
4 months ago

Hi Maxim De Maeseneer, 

Thanks for posting on SOTI Pulse, Thanks Rafael, for responding to the post, your expertise and willingness to help are greatly appreciated !

Have Rafael, successfully addressed your query? If not, or If you have any additional questions or concerns, please don't hesitate to reach out. We're dedicated to providing assistance and support.