Skip to content

Commit

Permalink
Add screensaver/lock screen workaround for legacy Rokus.
Browse files Browse the repository at this point in the history
We key off the screensaver to lock the screen. Legacy devices will show
the lock screen immediately, instead of keeping the screen saver in
view. This seems to also prevent the screensaver from running again,
keeping the lock screen displayed indefinitely. This fix (workaround)
will send an invalid keypress to the roku after the lockscreen is
displayed to reenable the internal roku idle timeouts, allowing the
screensaver to start again.
  • Loading branch information
ljunkie committed Jan 20, 2015
1 parent 101310b commit 27fd127
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Plex/source/HomeUsersScreen.brs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function createHomeUsersScreen(viewController as object) as object

obj.Show = homeusersShow
obj.HandleMessage = homeusersHandleMessage
obj.OnTimerExpired = homeusersOnTimerExpired

lsInitBaseListScreen(obj)

Expand Down Expand Up @@ -60,6 +61,14 @@ sub homeusersShow()

m.screen.SetFocusedListItem(focusedIndex)

' Workaround for screensaver/lockscreen issue on first gen Rokus
if NOT CheckMinimumVersion(GetGlobal("rokuVersionArr", [0]), [5, 1]) and GetGlobal("screenIsLocked") <> invalid then
timer = createTimer()
timer.Name = "legacyScreensaverLock"
timer.SetDuration(5000)
m.viewController.AddTimer(timer, m)
end if

m.screen.Show()
end sub

Expand Down Expand Up @@ -119,3 +128,10 @@ function homeusersHandleMessage(msg as object) as boolean

return handled
end function

Sub homeusersOnTimerExpired(timer)
if timer.Name = "legacyScreensaverLock" AND m.ViewController.IsActiveScreen(m) then
Debug("Send keypress to reenable internal Roku screensaver timeout")
SendEcpCommand("Lit_*")
end if
End Sub

0 comments on commit 27fd127

Please sign in to comment.