From 77e44075a65c7fa70e7c44c8f084358737f3ccbc Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 3 Jan 2022 19:20:31 +0800 Subject: [PATCH] add debug help to tokens, remove the unused RTC token entry --- services/gam/src/tokens.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/services/gam/src/tokens.rs b/services/gam/src/tokens.rs index 272fdf9b0..ac0c91748 100644 --- a/services/gam/src/tokens.rs +++ b/services/gam/src/tokens.rs @@ -12,14 +12,13 @@ use xous_ipc::String; */ // if you add more UxContexts, and you want them authorized by the GAM, add their names here. -const TOKEN_SLOTS: usize = 10; +const TOKEN_SLOTS: usize = 9; const EXPECTED_BOOT_CONTEXTS: [&'static str; TOKEN_SLOTS] = [ "shellchat", "main menu", "status", "emoji menu", "rootkeys modal", - "rtc modal", "rootkeys menu", "test modal", "pddb modal", @@ -50,6 +49,16 @@ impl<'a> TokenManager { allow = false } } + // throw a bone to the dev who has to debug this error. This typically only triggers after a major + // refactor and some UX element was removed and we forgot to update it in this table here. + if !allow { + log::info!("Occupied token slots:"); + for t in self.tokens.iter() { + if let Some(s) = t { + log::info!("{}", s.name); + } + } + } allow } pub(crate) fn claim_token(&mut self, name: &str) -> Option<[u32; 4]> {