Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion androidtv/basetv/basetv_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""

import logging
import asyncio

from .basetv import BaseTV
from .. import constants
Expand Down Expand Up @@ -378,10 +379,12 @@ async def screen_on_awake_wake_lock_size(self):

# Power service might sometimes reply with "Failed to write while dumping service". If this happens,
# retry the request, up to three times.
retries_left = 3
retries_left = 20
while output is not None and "Failed to write while dumping service" in output and retries_left > 0:
output = await self._adb.shell(constants.CMD_SCREEN_ON_AWAKE_WAKE_LOCK_SIZE)
retries_left -= 1
if "Failed to write while dumping service" in output and retries_left > 0:
await asyncio.sleep(0.5)

return self._screen_on_awake_wake_lock_size(output)

Expand Down
2 changes: 1 addition & 1 deletion androidtv/basetv/basetv_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def screen_on_awake_wake_lock_size(self):

# Power service might sometimes reply with "Failed to write while dumping service". If this happens,
# retry the request, up to three times.
retries_left = 3
retries_left = 20
while output is not None and "Failed to write while dumping service" in output and retries_left > 0:
output = self._adb.shell(constants.CMD_SCREEN_ON_AWAKE_WAKE_LOCK_SIZE)
retries_left -= 1
Expand Down
Loading