1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 09:28:13 +00:00

fixup! chore(core): update core to reflect cache and context refactor [no changelog]

This commit is contained in:
M1nd3r 2024-11-20 10:38:33 +01:00
parent 91d477c3c4
commit efda21a2a7
3 changed files with 9 additions and 8 deletions

View File

@ -329,7 +329,7 @@ class Layout(Generic[T]):
def _paint(self) -> None: def _paint(self) -> None:
"""Paint the layout and ensure that homescreen cache is properly invalidated.""" """Paint the layout and ensure that homescreen cache is properly invalidated."""
import storage.cache_common as storage_cache import storage.cache as storage_cache
painted = self.layout.paint() painted = self.layout.paint()
if painted: if painted:

View File

@ -1,7 +1,8 @@
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
import storage.cache_common as storage_cache import storage.cache as storage_cache
import trezorui2 import trezorui2
from storage.cache_common import APP_COMMON_BUSY_DEADLINE_MS
from trezor import TR, ui from trezor import TR, ui
if TYPE_CHECKING: if TYPE_CHECKING:
@ -129,6 +130,6 @@ class Busyscreen(HomescreenBase):
# Handle timeout. # Handle timeout.
result = await super().get_result() result = await super().get_result()
assert result == trezorui2.CANCELLED assert result == trezorui2.CANCELLED
context.cache_delete(storage_cache.APP_COMMON_BUSY_DEADLINE_MS) context.cache_delete(APP_COMMON_BUSY_DEADLINE_MS)
set_homescreen() set_homescreen()
return result return result

View File

@ -1,7 +1,7 @@
import utime import utime
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
import storage.cache_common as cache_common import storage.cache as storage_cache
from trezor import log, loop from trezor import log, loop
from trezor.enums import MessageType from trezor.enums import MessageType
@ -153,7 +153,7 @@ def close_others() -> None:
if not task.is_running(): if not task.is_running():
task.close() task.close()
cache_common.homescreen_shown = None storage_cache.homescreen_shown = None
# if tasks were running, closing the last of them will run start_default # if tasks were running, closing the last of them will run start_default
@ -211,11 +211,11 @@ class IdleTimer:
time and saves it to storage.cache. This is done to avoid losing an time and saves it to storage.cache. This is done to avoid losing an
active timer when workflow restart happens and tasks are lost. active timer when workflow restart happens and tasks are lost.
""" """
if _restore_from_cache and cache_common.autolock_last_touch is not None: if _restore_from_cache and storage_cache.autolock_last_touch is not None:
now = cache_common.autolock_last_touch now = storage_cache.autolock_last_touch
else: else:
now = utime.ticks_ms() now = utime.ticks_ms()
cache_common.autolock_last_touch = now storage_cache.autolock_last_touch = now
for callback, task in self.tasks.items(): for callback, task in self.tasks.items():
timeout_us = self.timeouts[callback] timeout_us = self.timeouts[callback]