Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccdcb8b6 authored by Yin-Chia Yeh's avatar Yin-Chia Yeh
Browse files

Camera: fix first launch api level logic

Fall back to sdk_int when first api property is not set.

Test: partner device
Bug: 79133095
Change-Id: Ice78e42cd25d351586d0d2b16c0b555c504b9d4a
parent 89802f74
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1157,6 +1157,9 @@ hidl_vec<hidl_string> CameraHidlTest::getCameraDeviceNames(sp<ICameraProvider> p
TEST_F(CameraHidlTest, noHal1AfterP) {
    constexpr int32_t HAL1_PHASE_OUT_API_LEVEL = 28;
    int32_t firstApiLevel = property_get_int32("ro.product.first_api_level", /*default*/-1);
    if (firstApiLevel < 0) {
        firstApiLevel = property_get_int32("ro.build.version.sdk", /*default*/-1);
    }
    ASSERT_GT(firstApiLevel, 0); // first_api_level must exist

    if (firstApiLevel >= HAL1_PHASE_OUT_API_LEVEL) {