Small refactor last exit info

This commit is contained in:
Brahim Hadriche committed 2024-05-06 21:04:21 -04:00
1 parent 18445fdcc4
commit b254a1fe93
1 file changed
+3 -12
+3 -12
View File
@@ -131,11 +131,12 @@ end function
function GetLastExitInfo() as dynamic
' roAppManager.GetLastExitInfo() is only available on Roku OS 13 and above
if not IsOs13OrHigher()
appManager = CreateObject("roAppManager")
hasMethod = FindMemberFunction(appManager, "GetLastExitInfo") <> invalid
if not hasMethod
return invalid
end if
appManager = CreateObject("roAppManager")
lastExitInfo = appManager.GetLastExitInfo()
if lastExitInfo = invalid
return invalid
@@ -143,13 +144,3 @@ function GetLastExitInfo() as dynamic
return ToString(lastExitInfo)
end function
function IsOs13OrHigher() as boolean
deviceInfo = CreateObject("roDeviceInfo")
osVersion = deviceInfo.GetOSVersion()
if osVersion = invalid or StringUtils.IsNullOrEmpty(osVersion.major)
return false
end if
return ValidInt(osVersion.major.ToInt()) >= 13
end function