Skip running the test using `MAX_USES_PER_BOOT` on devices with
keymaster implementation.

Older devices with Keymaster implementation may use the key during
generateKey to export the generated public key (EC Key), leading to
an unnecessary increment of the key-associated counter. This can cause
the test to fail, so skipping this test on older devices to avoid test
failure.

Bug: 371503724
Bug: 376288058
Test: atest keystore2_client_tests
Change-Id: I1ce7b5f1b18486a1db0009c6c0972450111324bb
diff --git a/keystore2/tests/keystore2_client_authorizations_tests.rs b/keystore2/tests/keystore2_client_authorizations_tests.rs
index bd9dab9..504e6ab 100644
--- a/keystore2/tests/keystore2_client_authorizations_tests.rs
+++ b/keystore2/tests/keystore2_client_authorizations_tests.rs
@@ -472,6 +472,13 @@
 #[test]
 fn keystore2_gen_key_auth_max_uses_per_boot() {
     let sl = SecLevel::tee();
+    if sl.is_keymaster() {
+        // Older devices with Keymaster implementation may use the key during generateKey to export
+        // the generated public key (EC Key), leading to an unnecessary increment of the
+        // key-associated counter. This can cause the test to fail, so skipping this test on older
+        // devices to avoid test failure.
+        return;
+    }
     const MAX_USES_COUNT: i32 = 3;
 
     let gen_params = authorizations::AuthSetBuilder::new()