Merge "Don't construct the RP context for KM <= 4.1" into sc-dev am: 4d20aba79c

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/keymaster/+/15055438

Change-Id: I99000722bc4d23adb33e436ea1099d25016b7a1c
diff --git a/contexts/pure_soft_keymaster_context.cpp b/contexts/pure_soft_keymaster_context.cpp
index 18f4c93..c04475e 100644
--- a/contexts/pure_soft_keymaster_context.cpp
+++ b/contexts/pure_soft_keymaster_context.cpp
@@ -66,7 +66,10 @@
     if (security_level != KM_SECURITY_LEVEL_SOFTWARE) {
         pure_soft_secure_key_storage_ = std::make_unique<PureSoftSecureKeyStorage>(64);
     }
-    pure_soft_remote_provisioning_context_ = std::make_unique<PureSoftRemoteProvisioningContext>();
+    if (version >= KmVersion::KEYMINT_1) {
+        pure_soft_remote_provisioning_context_ =
+            std::make_unique<PureSoftRemoteProvisioningContext>();
+    }
 }
 
 PureSoftKeymasterContext::~PureSoftKeymasterContext() {}