Hi,
I was looking to see if anyone was aware of a script for Android that would essentially unlock the device or perform the same thing as a swipe up on the device?
The reason for this script is I'm writing some javascript that will check if a particular application is running in the foreground and then perform an update if it is not running. When the device screen times out and goes black, the script can no longer return what is in the foreground. We don't have passwords/PINs on the devices, so the screen timeout is activating and just requires a home button and swipe up (page up in remote) to get back into the device.
If anyone knows of a better way to go about doing this in general, I'm all ears. For context, my Javascript looks like below:
var ABC = 'com.abc';
var foregroundActivities = mobicontrol.app.foregroundActivities;
if (foregroundActivities != null) {
foregroundActivities.forEach(function (activity) {
if (activity.packageName = ABC) {mobicontrol.log.info("App is running, not upgrading automatically. Perform update manually.")}
if (activity.packageName != ABC) {
mobicontrol.log.info("App is not running, upgrading.")
mobicontrol.app.stop('com.abc');
mobicontrol.packages.install('/mnt/sdcard/MobiControl/Packages/LatestRelease.pcg');
}
});
}
function onFinish(result) {
if (result.isSuccessful) {
mobicontrol.app.start('com.abc');
mobicontrol.log.info("App has been updated.")
}
}