Keystore 2.0: add entropy feeder on idle
In AsyncTask, if both the high and low priority job queues are empty
then run any registered idle callbacks once, passing them the shelf
to play with. After this, the idle callbacks will only be called again
when some other job is queued.
Register an idle callback that feeds entropy to all known KeyMint
devices, provided that sufficient time (30s) has elapsed since the
last time entropy was fed.
Bug: 171703867
Test: keystore2_test, subset of CtsKeystoreTestCases with extra logging
Change-Id: Ic21cd1906ee24bb6c050ce17b104d8000c6aed14
diff --git a/keystore2/src/lib.rs b/keystore2/src/lib.rs
index 8fef6cf..0e51eff 100644
--- a/keystore2/src/lib.rs
+++ b/keystore2/src/lib.rs
@@ -20,6 +20,7 @@
pub mod authorization;
pub mod database;
pub mod enforcements;
+pub mod entropy;
pub mod error;
pub mod globals;
/// Internal Representation of Key Parameter and convenience functions.