mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Camera: Try adding a passthrough legacy service
Listing by interface on passthrough only devices doesn't return the legacy implementation that might be present. For this case try to connect to the legacy provider and check whether such implementation does in fact exist. Bug: 62835396 Test: vts-tradefed run commandAndExit vts --skip-all-system-status-check --skip-preconditions --module VtsHalCameraProviderV2_4Target -l INFO Change-Id: Ifdc1b15392f5418fd0d949953bb6bdb1f3612ee8
This commit is contained in:
@@ -100,6 +100,7 @@ using ::android::hardware::kSynchronizedReadWrite;
|
||||
using ResultMetadataQueue = MessageQueue<uint8_t, kSynchronizedReadWrite>;
|
||||
using ::android::hidl::manager::V1_0::IServiceManager;
|
||||
|
||||
const char kCameraPassthroughServiceName[] = "legacy/0";
|
||||
const char *kProviderFQName = "android.hardware.camera.provider@2.4::ICameraProvider";
|
||||
const uint32_t kMaxPreviewWidth = 1920;
|
||||
const uint32_t kMaxPreviewHeight = 1080;
|
||||
@@ -257,6 +258,20 @@ void CameraHidlEnvironment::SetUp() {
|
||||
}
|
||||
});
|
||||
|
||||
std::string legacyName;
|
||||
uint32_t legacyId;
|
||||
ASSERT_TRUE(parseProviderName(kCameraPassthroughServiceName,
|
||||
&legacyName /*out*/, &legacyId /*out*/));
|
||||
auto legacyIt = mProviders.find(legacyName);
|
||||
//Add any legacy passthrough implementations
|
||||
if (legacyIt == mProviders.end()) {
|
||||
sp<ICameraProvider> provider = ICameraProvider::tryGetService(
|
||||
kCameraPassthroughServiceName);
|
||||
if (nullptr != provider.get()) {
|
||||
mProviders.emplace(legacyName, provider);
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT_FALSE(mProviders.empty());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user