Merge "drm aidl vts: proper skip tests without vendor module" am: da4d0bcb15 am: 9cff591ab5 am: 59dca75155

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2379488

Change-Id: Ife70524d6962b8cf62fe2b8ac34fbee20011b47a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/drm/aidl/vts/drm_hal_common.cpp b/drm/aidl/vts/drm_hal_common.cpp
index 7de8167..f5ef0e7 100644
--- a/drm/aidl/vts/drm_hal_common.cpp
+++ b/drm/aidl/vts/drm_hal_common.cpp
@@ -187,6 +187,12 @@
     auto svc = GetParamService();
     const string drmInstance = HalFullName(kDrmIface, svc);
 
+    if (!vendorModule) {
+        ASSERT_NE(drmInstance, HalFullName(kDrmIface, "widevine")) << "Widevine requires vendor module.";
+        ASSERT_NE(drmInstance, HalFullName(kDrmIface, "clearkey")) << "Clearkey requires vendor module.";
+        GTEST_SKIP() << "No vendor module installed";
+    }
+
     if (drmInstance.find("IDrmFactory") != std::string::npos) {
         drmFactory = IDrmFactory::fromBinder(
                 ::ndk::SpAIBinder(AServiceManager_waitForService(drmInstance.c_str())));
@@ -195,12 +201,6 @@
         cryptoPlugin = createCryptoPlugin();
     }
 
-    if (!vendorModule) {
-        ASSERT_NE(drmInstance, "widevine") << "Widevine requires vendor module.";
-        ASSERT_NE(drmInstance, "clearkey") << "Clearkey requires vendor module.";
-        GTEST_SKIP() << "No vendor module installed";
-    }
-
     ASSERT_EQ(HalBaseName(drmInstance), vendorModule->getServiceName());
     contentConfigurations = vendorModule->getContentConfigurations();