Sub PE_ScreenOff (Intent As Intent)
Log("ScreenOff")
Log(Intent.ExtrasToString)
Dim result As Int
result = Msgbox2("SWITCH OFF YOUR TABLET?", "Assistant", "SWITCH OFF", "NO", "",LoadBitmap (File.DirAssets, "notification-logo.png"))
If result = DialogResponse.Positive Then ' Close the WebSocket and Shutdown
Log("Switch OFF")
If WebSocket.ws.Connected Then
If WebSocket.tmrReConnect.Enabled = True Then
WebSocket.tmrReConnect.Enabled = False
End If
Log("Closing WebSocket")
WebSocket.ws.Close
Log("Socket State: " & WebSocket.ws.Connected)
End If
ToastMessageShow("Shutting Down", True)
Starter.csu.CallSubPlus(HomePage, "Shutdown", 1000)
Else
' Close message box
End If
End Sub