Add/use watchdog with standard timeout
Almost all uses of the watchdog use the same 500ms timeout, so add a new
method that assumes that.
Test: CtsKeystoreTestCases
Change-Id: Idf7852400a58ba954e4a71e5e2282734a0960072
diff --git a/keystore2/src/raw_device.rs b/keystore2/src/raw_device.rs
index 44d805c..a8a88d2 100644
--- a/keystore2/src/raw_device.rs
+++ b/keystore2/src/raw_device.rs
@@ -211,13 +211,10 @@
KeyBlob::NonSensitive(key_blob_vec),
|key_blob| {
map_km_error({
- let _wp = wd::watch_millis(
- concat!(
- "In KeyMintDevice::lookup_or_generate_key: ",
- "calling getKeyCharacteristics."
- ),
- 500,
- );
+ let _wp = wd::watch(concat!(
+ "In KeyMintDevice::lookup_or_generate_key: ",
+ "calling getKeyCharacteristics."
+ ));
self.km_dev.getKeyCharacteristics(key_blob, &[], &[])
})
},
@@ -308,7 +305,7 @@
let (begin_result, _) = self
.upgrade_keyblob_if_required_with(db, key_id_guard, key_blob, |blob| {
map_km_error({
- let _wp = wd::watch_millis("In use_key_in_one_step: calling: begin", 500);
+ let _wp = wd::watch("In use_key_in_one_step: calling: begin");
self.km_dev.begin(purpose, blob, operation_parameters, auth_token)
})
})
@@ -316,7 +313,7 @@
let operation: Strong<dyn IKeyMintOperation> =
begin_result.operation.ok_or_else(Error::sys).context(ks_err!("Operation missing"))?;
map_km_error({
- let _wp = wd::watch_millis("In use_key_in_one_step: calling: finish", 500);
+ let _wp = wd::watch("In use_key_in_one_step: calling: finish");
operation.finish(Some(input), None, None, None, None)
})
.context(ks_err!("Failed to finish operation."))