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