Lines Matching refs:cameraId

205     for (auto& cameraId : deviceIds) {  in enumerateProviders()  local
206 String8 id8 = String8(cameraId.c_str()); in enumerateProviders()
238 void CameraService::broadcastTorchModeStatus(const String8& cameraId, TorchModeStatus status) { in broadcastTorchModeStatus() argument
242 i.second->getListener()->onTorchStatusChanged(mapToInterface(status), String16{cameraId}); in broadcastTorchModeStatus()
264 std::string cameraId(id.c_str()); in addStates() local
266 status_t res = mCameraProviderManager->getResourceCost(cameraId, &cost); in addStates()
382 void CameraService::onTorchStatusChanged(const String8& cameraId, in onTorchStatusChanged() argument
385 onTorchStatusChangedLocked(cameraId, newStatus); in onTorchStatusChanged()
388 void CameraService::onTorchStatusChangedLocked(const String8& cameraId, in onTorchStatusChangedLocked() argument
391 __FUNCTION__, cameraId.string(), newStatus); in onTorchStatusChangedLocked()
394 status_t res = getTorchStatusLocked(cameraId, &status); in onTorchStatusChangedLocked()
397 __FUNCTION__, cameraId.string(), strerror(-res), res); in onTorchStatusChangedLocked()
404 res = setTorchStatusLocked(cameraId, newStatus); in onTorchStatusChangedLocked()
414 auto iter = mTorchUidMap.find(cameraId); in onTorchStatusChangedLocked()
422 notifier.noteFlashlightOff(cameraId, oldUid); in onTorchStatusChangedLocked()
425 notifier.noteFlashlightOn(cameraId, newUid); in onTorchStatusChangedLocked()
431 notifier.noteFlashlightOn(cameraId, oldUid); in onTorchStatusChangedLocked()
433 notifier.noteFlashlightOff(cameraId, oldUid); in onTorchStatusChangedLocked()
439 broadcastTorchModeStatus(cameraId, newStatus); in onTorchStatusChangedLocked()
461 Status CameraService::getCameraInfo(int cameraId, in getCameraInfo() argument
471 if (cameraId < 0 || cameraId >= mNumberOfCameras) { in getCameraInfo()
478 cameraIdIntToStrLocked(cameraId), cameraInfo); in getCameraInfo()
481 "Error retrieving camera info from device %d: %s (%d)", cameraId, in getCameraInfo()
503 Status CameraService::getCameraCharacteristics(const String16& cameraId, in getCameraCharacteristics() argument
520 String8(cameraId).string(), cameraInfo); in getCameraCharacteristics()
523 "characteristics for device %s: %s (%d)", String8(cameraId).string(), in getCameraCharacteristics()
534 mCameraProviderManager->getProviderTagIdLocked(String8(cameraId).string()), in getCameraCharacteristics()
540 String8(cameraId).string(), strerror(-res), res); in getCameraCharacteristics()
550 "keys needing permission for device %s: %s (%d)", String8(cameraId).string(), in getCameraCharacteristics()
596 int CameraService::getDeviceVersion(const String8& cameraId, int* facing) { in getDeviceVersion() argument
603 res = mCameraProviderManager->getHighestSupportedVersion(cameraId.string(), in getDeviceVersion()
610 res = mCameraProviderManager->getCameraInfo(cameraId.string(), &info); in getDeviceVersion()
636 const sp<IInterface>& cameraCb, const String16& packageName, const String8& cameraId, in makeClient() argument
655 cameraId.string(), deviceVersion); in makeClient()
667 cameraId, api1CameraId, in makeClient()
673 *client = new CameraDeviceClient(cameraService, tmp, packageName, cameraId, in makeClient()
682 cameraId.string(), deviceVersion); in makeClient()
701 cameraId.string(), deviceVersion, halVersion); in makeClient()
781 Status CameraService::initializeShimMetadata(int cameraId) { in initializeShimMetadata() argument
785 String8 id = String8::format("%d", cameraId); in initializeShimMetadata()
789 sp<ICameraClient>{nullptr}, id, cameraId, in initializeShimMetadata()
799 Status CameraService::getLegacyParametersLazy(int cameraId, in getLegacyParametersLazy() argument
803 ALOGV("%s: for cameraId: %d", __FUNCTION__, cameraId); in getLegacyParametersLazy()
812 String8 id = String8::format("%d", cameraId); in getLegacyParametersLazy()
832 ret = initializeShimMetadata(cameraId); in getLegacyParametersLazy()
892 Status CameraService::validateConnectLocked(const String8& cameraId, in validateConnectLocked() argument
902 Status allowed = validateClientPermissionsLocked(cameraId, clientName8, clientUid, clientPid, in validateConnectLocked()
915 "No camera HAL module available to open camera device \"%s\"", cameraId.string()); in validateConnectLocked()
918 if (getCameraState(cameraId) == nullptr) { in validateConnectLocked()
920 cameraId.string()); in validateConnectLocked()
922 "No camera device with ID \"%s\" available", cameraId.string()); in validateConnectLocked()
925 status_t err = checkIfDeviceIsUsable(cameraId); in validateConnectLocked()
931 "No camera device with ID \"%s\" currently available", cameraId.string()); in validateConnectLocked()
934 "Unknown error connecting to ID \"%s\"", cameraId.string()); in validateConnectLocked()
940 Status CameraService::validateClientPermissionsLocked(const String8& cameraId, in validateClientPermissionsLocked() argument
955 callingPid, callingUid, cameraId.string(), in validateClientPermissionsLocked()
968 callingPid, callingUid, cameraId.string(), in validateClientPermissionsLocked()
978 clientName8.string(), clientUid, clientPid, cameraId.string()); in validateClientPermissionsLocked()
989 clientName8.string(), clientUid, clientPid, cameraId.string(), in validateClientPermissionsLocked()
998 "is enabled", clientName8.string(), clientUid, clientPid, cameraId.string()); in validateClientPermissionsLocked()
1017 clientUserId, cameraId.string()); in validateClientPermissionsLocked()
1023 status_t CameraService::checkIfDeviceIsUsable(const String8& cameraId) const { in checkIfDeviceIsUsable()
1024 auto cameraState = getCameraState(cameraId); in checkIfDeviceIsUsable()
1028 cameraId.string()); in checkIfDeviceIsUsable()
1035 callingPid, cameraId.string()); in checkIfDeviceIsUsable()
1039 callingPid, cameraId.string()); in checkIfDeviceIsUsable()
1078 status_t CameraService::handleEvictionsLocked(const String8& cameraId, int clientPid, in handleEvictionsLocked() argument
1092 auto current = mActiveClientManager.get(cameraId); in handleEvictionsLocked()
1136 auto state = getCameraState(cameraId); in handleEvictionsLocked()
1139 clientPid, cameraId.string()); in handleEvictionsLocked()
1145 clientDescriptor = CameraClientManager::makeClientDescriptor(cameraId, in handleEvictionsLocked()
1168 cameraId.string(), packageName.string(), clientPid, in handleEvictionsLocked()
1214 i->getPriority().getState(), cameraId.string(), in handleEvictionsLocked()
1264 if ((ret = checkIfDeviceIsUsable(cameraId)) != NO_ERROR) { in handleEvictionsLocked()
1327 bool CameraService::shouldRejectHiddenCameraConnection(const String8 & cameraId) { in shouldRejectHiddenCameraConnection() argument
1333 mCameraProviderManager->isPublicallyHiddenSecureCamera(cameraId.c_str())) { in shouldRejectHiddenCameraConnection()
1341 const String16& cameraId, in connectDevice() argument
1349 String8 id = String8(cameraId); in connectDevice()
1368 Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String8& cameraId, in connectHelper() argument
1379 "Camera API version %d", clientPid, clientName8.string(), cameraId.string(), in connectHelper()
1383 if (shouldRejectHiddenCameraConnection(cameraId)) { in connectHelper()
1385 cameraId.c_str()); in connectHelper()
1388 cameraId.string()); in connectHelper()
1402 cameraId.string(), clientName8.string(), clientPid); in connectHelper()
1406 if(!(ret = validateConnectLocked(cameraId, clientName8, in connectHelper()
1414 auto cameraState = getCameraState(cameraId); in connectHelper()
1424 if ((err = handleEvictionsLocked(cameraId, originalClientPid, effectiveApiLevel, in connectHelper()
1431 cameraId.string()); in connectHelper()
1435 cameraId.string()); in connectHelper()
1439 strerror(-err), err, cameraId.string()); in connectHelper()
1450 mFlashlight->prepareDeviceOpen(cameraId); in connectHelper()
1453 int deviceVersion = getDeviceVersion(cameraId, /*out*/&facing); in connectHelper()
1455 … ALOGE("%s: Unable to get camera device \"%s\" facing", __FUNCTION__, cameraId.string()); in connectHelper()
1457 "Unable to get camera device \"%s\" facing", cameraId.string()); in connectHelper()
1462 cameraId, api1CameraId, facing, in connectHelper()
1480 "Illegal argument to HAL module for camera \"%s\"", cameraId.string()); in connectHelper()
1483 "Camera \"%s\" is already open", cameraId.string()); in connectHelper()
1487 cameraId.string()); in connectHelper()
1490 "No permission to open camera \"%s\"", cameraId.string()); in connectHelper()
1493 "Camera \"%s\" disabled by policy", cameraId.string()); in connectHelper()
1497 "Failed to initialize camera \"%s\": %s (%d)", cameraId.string(), in connectHelper()
1509 auto cameraState = getCameraState(cameraId); in connectHelper()
1514 __FUNCTION__, cameraId.string()); in connectHelper()
1535 Status CameraService::setTorchMode(const String16& cameraId, bool enabled, in setTorchMode() argument
1546 String8 id = String8(cameraId.string()); in setTorchMode()
1857 Status CameraService::getLegacyParameters(int cameraId, /*out*/String16* parameters) { in getLegacyParameters() argument
1860 ALOGV("%s: for camera ID = %d", __FUNCTION__, cameraId); in getLegacyParameters()
1870 if (!(ret = getLegacyParametersLazy(cameraId, /*out*/&shimParams)).isOk()) { in getLegacyParameters()
1883 Status CameraService::supportsCameraApi(const String16& cameraId, int apiVersion, in supportsCameraApi() argument
1887 const String8 id = String8(cameraId); in supportsCameraApi()
1940 Status CameraService::isHiddenPhysicalCamera(const String16& cameraId, in isHiddenPhysicalCamera() argument
1944 const String8 id = String8(cameraId); in isHiddenPhysicalCamera()
2011 const String8& cameraId) const { in getCameraState()
2015 auto iter = mCameraStates.find(cameraId); in getCameraState()
2023 sp<CameraService::BasicClient> CameraService::removeClientLocked(const String8& cameraId) { in removeClientLocked() argument
2025 auto clientDescriptorPtr = mActiveClientManager.remove(cameraId); in removeClientLocked()
2028 cameraId.string()); in removeClientLocked()
2117 void CameraService::logDisconnected(const char* cameraId, int clientPid, in logDisconnected() argument
2120 logEvent(String8::format("DISCONNECT device %s client for package %s (PID %d)", cameraId, in logDisconnected()
2124 void CameraService::logConnected(const char* cameraId, int clientPid, in logConnected() argument
2127 logEvent(String8::format("CONNECT device %s client for package %s (PID %d)", cameraId, in logConnected()
2131 void CameraService::logRejected(const char* cameraId, int clientPid, in logRejected() argument
2135 cameraId, clientPackage, clientPid, reason)); in logRejected()
2138 void CameraService::logTorchEvent(const char* cameraId, const char *torchState, int clientPid) { in logTorchEvent() argument
2140 logEvent(String8::format("Torch for camera id %s turned %s for client PID %d", cameraId, in logTorchEvent()
2156 void CameraService::logDeviceRemoved(const char* cameraId, const char* reason) { in logDeviceRemoved() argument
2158 logEvent(String8::format("REMOVE device %s, reason: (%s)", cameraId, reason)); in logDeviceRemoved()
2161 void CameraService::logDeviceAdded(const char* cameraId, const char* reason) { in logDeviceAdded() argument
2163 logEvent(String8::format("ADD device %s, reason: (%s)", cameraId, reason)); in logDeviceAdded()
3082 String8 cameraId = state.first; in dump() local
3084 dprintf(fd, "== Camera device %s dynamic info: ==\n", cameraId.string()); in dump()
3092 auto clientDescriptor = mActiveClientManager.get(cameraId); in dump()
3095 cameraId.string()); in dump()
3108 cameraId.string()); in dump()
3189 String8 cameraId = mTorchClientMap.keyAt(i); in handleTorchClientBinderDied() local
3190 status_t res = mFlashlight->setTorchMode(cameraId, false); in handleTorchClientBinderDied()
3224 void CameraService::updateStatus(StatusInternal status, const String8& cameraId) { in updateStatus() argument
3225 updateStatus(status, cameraId, {}); in updateStatus()
3228 void CameraService::updateStatus(StatusInternal status, const String8& cameraId, in updateStatus() argument
3233 auto state = getCameraState(cameraId); in updateStatus()
3237 cameraId.string()); in updateStatus()
3243 state->updateStatus(status, cameraId, rejectSourceStates, [this] in updateStatus()
3244 (const String8& cameraId, StatusInternal status) { in updateStatus() argument
3250 if (getTorchStatusLocked(cameraId, &torchStatus) != in updateStatus()
3257 onTorchStatusChangedLocked(cameraId, newTorchStatus); in updateStatus()
3266 mCameraProviderManager->isPublicallyHiddenSecureCamera(cameraId.c_str())) { in updateStatus()
3268 cameraId.c_str()); in updateStatus()
3272 String16(cameraId)); in updateStatus()
3279 const String8& cameraId, in updateStatus() argument
3291 cameraId.string(), oldStatus, status); in updateStatus()
3311 "state was was in one of the bad states.", __FUNCTION__, cameraId.string()); in updateStatus()
3317 onStatusUpdatedLocked(cameraId, status); in updateStatus()
3321 const String8& cameraId, int facing, const String16& clientName, int apiLevel) { in updateProxyDeviceState() argument
3324 String16 id(cameraId); in updateProxyDeviceState()
3329 const String8& cameraId, in getTorchStatusLocked() argument
3334 ssize_t index = mTorchStatusMap.indexOfKey(cameraId); in getTorchStatusLocked()
3344 status_t CameraService::setTorchStatusLocked(const String8& cameraId, in setTorchStatusLocked() argument
3346 ssize_t index = mTorchStatusMap.indexOfKey(cameraId); in setTorchStatusLocked()