I want to setup some tablets in a way that they automatically turn on and open my application when connected in a power source. Those tablets will be all COSU devices and my application is a single app. I have read the docs and the closest policy that I have found was stayOnPluggedModes in this page, and the description is not very clear (at least to me).
Unfortunately, at the moment, I am unable to test if this policy works. So, is the stayOnPluggedModes policy the right one for what I need? If not, what are my options (excluding everything bellow, because it voids the device warrant)?
- Use RTC wake alarm
- Replacing the battery animation script
- Alter off-mode-charge with Fastboot
- Delete system/bin/charge_only_mode
- Change the bootloader
And also this one doesn't work because it requires the device to be asleep.
You can use Kiosk Mode, any apps defined in the policy will be launched automatically when a device boots. They run in full-screen mode and are typically pinned to the home screen in a way that prevents users from leaving the app.
"kioskCustomLauncherEnabled": trueOr Lock task mode which hides the Home and Recents buttons on a device, preventing users from escaping the app. To create a policy that supports an app with lock task mode.
Note: Lock task mode is only compatible with Android 6.0+ devices.
--- Edit ---Here's what you can try.
"powerManagementEventsEnabled"available in the"StatusReportingSettings"of the policy. This will log events related to power source such as charger connected, disconnected etc.