Loading system/gd/rust/common/src/init_flags.rs +12 −0 Original line number Diff line number Diff line Loading @@ -186,6 +186,7 @@ init_flags!( irk_rotation, logging_debug_enabled_for_all, pass_phy_update_callback = true, redact_log = true, sdp_serialization = true, } // extra_fields are not a 1 to 1 match with "INIT_*" flags Loading Loading @@ -283,4 +284,15 @@ mod tests { assert!(!is_debug_logging_enabled_for_tag("unknown_flag")); assert!(!logging_debug_enabled_for_all_is_enabled()); } #[test] fn test_redact_logging() { let _guard = ASYNC_LOCK.lock().unwrap(); assert!(redact_log_is_enabled()); // default is true test_load(vec!["INIT_redact_log=false"]); assert!(!redact_log_is_enabled()); // turned off test_load(vec!["INIT_redact_log=foo"]); assert!(redact_log_is_enabled()); // invalid value, interpreted as default, true test_load(vec!["INIT_redact_log=true"]); assert!(redact_log_is_enabled()); // turned on } } system/gd/rust/shim/src/init_flags.rs +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ mod ffi { fn is_debug_logging_enabled_for_tag(tag: &str) -> bool; fn logging_debug_enabled_for_all_is_enabled() -> bool; fn pass_phy_update_callback_is_enabled() -> bool; fn redact_log_is_enabled() -> bool; fn sdp_serialization_is_enabled() -> bool; } } Loading Loading
system/gd/rust/common/src/init_flags.rs +12 −0 Original line number Diff line number Diff line Loading @@ -186,6 +186,7 @@ init_flags!( irk_rotation, logging_debug_enabled_for_all, pass_phy_update_callback = true, redact_log = true, sdp_serialization = true, } // extra_fields are not a 1 to 1 match with "INIT_*" flags Loading Loading @@ -283,4 +284,15 @@ mod tests { assert!(!is_debug_logging_enabled_for_tag("unknown_flag")); assert!(!logging_debug_enabled_for_all_is_enabled()); } #[test] fn test_redact_logging() { let _guard = ASYNC_LOCK.lock().unwrap(); assert!(redact_log_is_enabled()); // default is true test_load(vec!["INIT_redact_log=false"]); assert!(!redact_log_is_enabled()); // turned off test_load(vec!["INIT_redact_log=foo"]); assert!(redact_log_is_enabled()); // invalid value, interpreted as default, true test_load(vec!["INIT_redact_log=true"]); assert!(redact_log_is_enabled()); // turned on } }
system/gd/rust/shim/src/init_flags.rs +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ mod ffi { fn is_debug_logging_enabled_for_tag(tag: &str) -> bool; fn logging_debug_enabled_for_all_is_enabled() -> bool; fn pass_phy_update_callback_is_enabled() -> bool; fn redact_log_is_enabled() -> bool; fn sdp_serialization_is_enabled() -> bool; } } Loading