How can I disable the development setting which prevents screen from turning off when plugged in?
Basically I want to detect user inactivity on an Android device by detecting when screen goes off, but if this setting is enabled this will never happen.
From what I found, WRITE_SECURE_SETTINGS
permission should be used (rooting device/using private APIs is not a problem).