Skip to content

Commit

Permalink
fixup! Camera: Skip stream size check for whitelisted apps
Browse files Browse the repository at this point in the history
Change-Id: I29ae6e5d821163c2566e23ea83330bba065248d5
  • Loading branch information
elginsk8r authored and luk1337 committed Mar 20, 2024
1 parent dc23cea commit c8123dc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions services/camera/libcameraservice/api2/CameraDeviceClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#define ATRACE_TAG ATRACE_TAG_CAMERA
//#define LOG_NDEBUG 0

#include <android-base/properties.h>
#include <android-base/strings.h>
#include <com_android_internal_camera_flags.h>
#include <cutils/properties.h>
#include <utils/CameraThreadState.h>
Expand Down Expand Up @@ -115,12 +117,11 @@ CameraDeviceClient::CameraDeviceClient(const sp<CameraService>& 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<std::string> 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());
Expand Down

0 comments on commit c8123dc

Please sign in to comment.