diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp index 8f8b209749..0aa41f06ee 100644 --- a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp +++ b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp @@ -18,6 +18,8 @@ #define ATRACE_TAG ATRACE_TAG_CAMERA //#define LOG_NDEBUG 0 +#include +#include #include #include #include @@ -115,12 +117,11 @@ CameraDeviceClient::CameraDeviceClient(const sp& cameraService, mOverrideForPerfClass(overrideForPerfClass), mOriginalCameraId(originalCameraId) { - char value[PROPERTY_VALUE_MAX]; - property_get("persist.vendor.camera.privapp.list", value, ""); - String16 packagelist(value); - if (packagelist.contains(clientPackageName.string())) { - mPrivilegedClient = true; - } + std::vector privilegedClientList = android::base::Split( + android::base::GetProperty("persist.vendor.camera.privapp.list", ""), ","); + auto it = std::find(privilegedClientList.begin(), privilegedClientList.end(), + clientPackageName); + mPrivilegedClient = it != privilegedClientList.end(); ATRACE_CALL(); ALOGI("CameraDeviceClient %s: Opened", cameraId.c_str());