wakelock
This commit is contained in:
		| @@ -36,6 +36,7 @@ import android.view.KeyEvent; | ||||
| import android.widget.Toast; | ||||
|  | ||||
| import androidx.annotation.RequiresApi; | ||||
| import androidx.legacy.content.WakefulBroadcastReceiver; | ||||
|  | ||||
| import com.jens.automation2.actions.wifi_router.MyOnStartTetheringCallback; | ||||
| import com.jens.automation2.actions.wifi_router.MyOreoWifiManager; | ||||
| @@ -1141,7 +1142,24 @@ public class Actions | ||||
| 	{ | ||||
| 		Miscellaneous.logEvent("i", "waitBeforeNextAction", "waitBeforeNextAction for " + String.valueOf(waitTime) + " milliseconds.", 4); | ||||
|  | ||||
|  | ||||
| 		try | ||||
| 		{ | ||||
| 			PowerManager powerManager = (PowerManager) Miscellaneous.getAnyContext().getSystemService(Context.POWER_SERVICE); | ||||
| 			PowerManager.WakeLock fullWakeLock = powerManager.newWakeLock((PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP), "Loneworker - FULL WAKE LOCK"); | ||||
| 			fullWakeLock.acquire(); // turn on | ||||
| 			try | ||||
| 			{ | ||||
| 				Thread.sleep(60000); // turn on duration | ||||
| 			} | ||||
| 			catch (InterruptedException e) | ||||
| 			{ | ||||
| 				e.printStackTrace(); | ||||
| 			} | ||||
| 			fullWakeLock.release(); | ||||
| 		} | ||||
| 		catch (Exception e) | ||||
| 		{ | ||||
| 		} | ||||
|  | ||||
| 		try | ||||
| 		{ | ||||
|   | ||||
| @@ -689,7 +689,7 @@ | ||||
|     <string name="screenIs">lo schermo è %1$s</string> | ||||
|     <string name="sendEmailToDev">Invia email allo sviluppatore</string> | ||||
|     <string name="controlCenter">Centro di controllo</string> | ||||
|     <string name="emailContactNotice">L\'e-mail è il mio metodo di contatto preferito per segnalare bug, porre domande o fare proposte. Vai al centro di controllo per saperne di più.\nMolte domande non possono essere risolte immediatamente, ma richiedono alcune ricerche tecniche. Quindi, per favore, abbiate un po' di pazienza.</string> | ||||
|     <string name="emailContactNotice">L\'e-mail è il mio metodo di contatto preferito per segnalare bug, porre domande o fare proposte. Vai al centro di controllo per saperne di più.\nMolte domande non possono essere risolte immediatamente, ma richiedono alcune ricerche tecniche. Quindi, per favore, abbiate un po\' di pazienza.</string> | ||||
|     <string name="musicPlaying">La musica è in riproduzione</string> | ||||
|     <string name="musicIsPlaying">la musica è in riproduzione</string> | ||||
|     <string name="musicIsNotPlaying">la musica non viene riprodotta</string> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user