By default, the Android system does not operate for more than n minutes and automatically shuts down and goes into hibernation.
In fact, some projects require timeouts that do not hibernate, and if it's only for a single application, we can do it through the power management settings,
If you want to set the timeout for all applications, you can refer to the following methods:
Method One, adjust code:
Settings.System.putInt (Getcontentresolver (), android.provider.settings.system.screen_off_timeout,-1);
Permission:<uses-permission android:name= "Android.permission.WRITE_SETTINGS"/>
Method Two, adjust the database:
These settings for Android are stored in a SQL database, which means you can simply modify the database to keep Android from sleeping.
Sqlite3/data/data/com.android.providers.settings/databases/settings.db
Specific sql:
UPDATE system SET Value = '-1 ' WHERE name = ' Screen_off_timeout ';