summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvichal Rakesh <arakesh@google.com>2022-05-25 20:59:52 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-05-25 20:59:52 +0000
commitd60b447dd64a218c185cfa078e76471b1d7a9935 (patch)
treef1ec7092aaeae9421402e10d4e7d2f0946bdace9
parent96450c28013ab4f39c0ac21305783edebeb82690 (diff)
parent3b83dc695125192b07ca0b79bd91830f9859484a (diff)
downloadcamera-d60b447dd64a218c185cfa078e76471b1d7a9935.tar.gz
Return Status::ILLEGAL_ARGUMENT if callback is nullptr am: 3b83dc6951
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/camera/+/18566785 Change-Id: If556433671968fbb527156b9fba19d6d26d44c6b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--common/hal/aidl_service/aidl_camera_provider.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/hal/aidl_service/aidl_camera_provider.cc b/common/hal/aidl_service/aidl_camera_provider.cc
index 91bc2c4..7eac3f2 100644
--- a/common/hal/aidl_service/aidl_camera_provider.cc
+++ b/common/hal/aidl_service/aidl_camera_provider.cc
@@ -181,6 +181,12 @@ status_t AidlCameraProvider::Initialize() {
ScopedAStatus AidlCameraProvider::setCallback(
const std::shared_ptr<ICameraProviderCallback>& callback) {
+ if (callback == nullptr) {
+ ALOGE("AidlCameraProvider::setCallback() called with nullptr");
+ return ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Status::ILLEGAL_ARGUMENT));
+ }
+
bool first_time = false;
{
std::unique_lock<std::mutex> lock(callbacks_lock_);