Loading services/camera/libcameraservice/common/CameraProviderManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -642,7 +642,7 @@ status_t CameraProviderManager::openAidlSession(const std::string &id, removeRef(DeviceMode::CAMERA, id); ALOGE("%s: Transaction error opening a session for camera device %s: %s", __FUNCTION__, id.c_str(), ret.getMessage()); return DEAD_OBJECT; return AidlProviderInfo::mapToStatusT(ret); } return OK; } Loading services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp +24 −2 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -45,8 +45,30 @@ using HalDeviceStatusType = aidl::android::hardware::camera::common::CameraDevic using ICameraProvider = aidl::android::hardware::camera::provider::ICameraProvider; using StatusListener = CameraProviderManager::StatusListener; static status_t mapExceptionCodeToStatusT(binder_exception_t binderException) { switch (binderException) { case EX_NONE: return OK; case EX_ILLEGAL_ARGUMENT: case EX_NULL_POINTER: case EX_BAD_PARCELABLE: case EX_ILLEGAL_STATE: return BAD_VALUE; case EX_UNSUPPORTED_OPERATION: return INVALID_OPERATION; case EX_TRANSACTION_FAILED: return DEAD_OBJECT; default: return UNKNOWN_ERROR; } } status_t AidlProviderInfo::mapToStatusT(const ndk::ScopedAStatus& s) { using Status = aidl::android::hardware::camera::common::Status; auto exceptionCode = s.getExceptionCode(); if (exceptionCode != EX_SERVICE_SPECIFIC) { return mapExceptionCodeToStatusT(exceptionCode); } Status st = static_cast<Status>(s.getServiceSpecificError()); switch (st) { case Status::OK: Loading Loading
services/camera/libcameraservice/common/CameraProviderManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -642,7 +642,7 @@ status_t CameraProviderManager::openAidlSession(const std::string &id, removeRef(DeviceMode::CAMERA, id); ALOGE("%s: Transaction error opening a session for camera device %s: %s", __FUNCTION__, id.c_str(), ret.getMessage()); return DEAD_OBJECT; return AidlProviderInfo::mapToStatusT(ret); } return OK; } Loading
services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp +24 −2 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -45,8 +45,30 @@ using HalDeviceStatusType = aidl::android::hardware::camera::common::CameraDevic using ICameraProvider = aidl::android::hardware::camera::provider::ICameraProvider; using StatusListener = CameraProviderManager::StatusListener; static status_t mapExceptionCodeToStatusT(binder_exception_t binderException) { switch (binderException) { case EX_NONE: return OK; case EX_ILLEGAL_ARGUMENT: case EX_NULL_POINTER: case EX_BAD_PARCELABLE: case EX_ILLEGAL_STATE: return BAD_VALUE; case EX_UNSUPPORTED_OPERATION: return INVALID_OPERATION; case EX_TRANSACTION_FAILED: return DEAD_OBJECT; default: return UNKNOWN_ERROR; } } status_t AidlProviderInfo::mapToStatusT(const ndk::ScopedAStatus& s) { using Status = aidl::android::hardware::camera::common::Status; auto exceptionCode = s.getExceptionCode(); if (exceptionCode != EX_SERVICE_SPECIFIC) { return mapExceptionCodeToStatusT(exceptionCode); } Status st = static_cast<Status>(s.getServiceSpecificError()); switch (st) { case Status::OK: Loading