Is there a way to acquire wake lock in Android native service in Android automotive, I need to hold the device from not going to suspend to Ram mode until my service done with certain tasks.
I tried to check if there are any ndk APIs available to acquire wake lock or something similar but no luck.
I haven't personally needed to acquire a wakelock in native code, and I'm uncertain if NDK directly supports it. However, you can achieve wakelock functionality using the following files:
In adb shell environment, you can hold and release wakelocks like this:
If you need to use this functionality in native code, you may use the fstream library to manage both files.