' Check Lock Screen
Sub ComprobarBloqueoPantalla As Boolean
LogColor("ComprobarBloqueoPantalla",Colors.Blue)
Dim ok As Boolean
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "keyguard", "java.lang.String")
ok= r.RunMethod("inKeyguardRestrictedInputMode")
LogColor("ComprobarBloqueoPantalla ok " & ok,Colors.Blue)
Return ok
End Sub
' unlock screen
Sub DesbloquearPantallaBloqueo
LogColor("Desbloquear",Colors.Blue)
r.Target = r.GetActivity
r.Target = r.RunMethod("getWindow")
r.RunMethod2("addFlags", 6815872, "java.lang.int")
End Sub
' lock screen
Sub BloquearPantallaBloqueo
' volver a bloquear pantalla (poner como estaba)
LogColor("Bloquear",Colors.Blue)
r.Target = r.GetActivity
r.Target = r.RunMethod("getWindow")
r.RunMethod2 ("clearFlags", 0, "java.lang.int")
End Sub