Customizing Android Wear watch timeout programmatically
android, wear-os
Solution
First you have to listen to screen state event in a persistent service. You can achieve that with this code. Then, when the screen is in `STATE_ON` state, just acquire a wakelock and release it after the determined time. You can find how to do it here.
Please keep in mind that it will have a negative effect on the battery life, especially on Wear devices that have small batteries.
Problem
I would like to allow the users of my Android Wear app to customize the timeout length of the backlight for my watch face. I've found an app that is able to do so, but I am unable to figure out how it does it. Has anyone been able to adjust screen timeout on an android wear device?