Lines Matching refs:CLIENT
315 // Remove the client from the list of active clients, if there is one
319 // Disconnect client
321 ALOGI("%s: Client for camera ID %s evicted due to device status change from HAL",
323 // Notify the client of disconnection
327 // Ensure not in binder RPC so client disconnect PID checks work correctly
586 /*out*/sp<BasicClient>* client) {
595 *client = new CameraClient(cameraService, tmp, packageName,
612 *client = new Camera2Client(cameraService, tmp, packageName,
619 *client = new CameraDeviceClient(cameraService, tmp, packageName, cameraId,
637 *client = new CameraClient(cameraService, tmp, packageName,
733 sp<Client> tmp = nullptr;
734 if (!(ret = connectHelper<ICameraClient,Client>(
882 "forward camera access to camera %s for client %s (PID %d, UID %d)",
895 "forward camera access to camera %s for client %s (PID %d, UID %d)",
918 // Only use passed in clientPid to check permission. Use calling PID as the client PID that's
962 void CameraService::finishConnectLocked(const sp<BasicClient>& client,
965 // Make a descriptor for the incoming client
966 auto clientDescriptor = CameraService::CameraClientManager::makeClientDescriptor(client, desc);
970 String8(client->getPackageName()));
975 ALOGE("%s: Invalid state: Client for camera %s was not removed in disconnect",
983 // And register a death notification for the client callback. Do
985 // transaction might be pre-empted to service the client death
986 // notification if the client process dies before linkToDeath is
988 sp<IBinder> remoteCallback = client->getRemote();
997 sp<BasicClient>* client,
1005 // If we are using API1, any existing client for this camera ID with the same remote
1013 ALOGW("CameraService connect called from same client, but with a different"
1014 " API level, evicting prior client...");
1017 " app binder, returning the same client)", clientPid);
1018 *client = clientSp;
1025 // Get current active client PIDs
1059 // Make descriptor for incoming client
1070 // If the incoming client was 'evicted,' higher priority clients have the camera in the
1073 ALOGE("CameraService::connect X (PID %d) rejected (existing client(s) with higher"
1081 String8 msg = String8::format("%s : DENIED connect device %s client for package %s "
1088 msg.appendFormat("\n - Blocked by existing device %s client for package %s"
1094 ALOGE(" Conflicts with: Device %s, client package %s (PID %"
1100 // Log the client's attempt
1110 ALOGE("%s: Invalid state: Null client in active client list.", __FUNCTION__);
1113 LOG_ALWAYS_FATAL("%s: Invalid state for CameraService, null client in active list",
1119 ALOGE("CameraService::connect evicting conflicting client for camera ID %s",
1124 logEvent(String8::format("EVICT device %s client held by package %s (PID"
1125 " %" PRId32 ", score %" PRId32 ", state %" PRId32 ")\n - Evicted by device %s client for"
1134 // Notify the client of disconnection
1144 // Clear caller identity temporarily so client disconnect PID checks work correctly
1150 i->getValue()->disconnect(); // Clients will remove themselves from the active client list
1156 ALOGV("%s: Waiting for disconnect to complete for client for device %s (PID %" PRId32 ")",
1160 ALOGE("%s: Timed out waiting for client for device %s to disconnect, "
1166 ALOGE("%s: Received error waiting for client for device %s to disconnect: %s (%d), "
1200 sp<Client> client = nullptr;
1201 ret = connectHelper<ICameraClient,Client>(cameraClient, id, api1CameraId,
1204 /*out*/client);
1212 *device = client;
1228 sp<Client> client = nullptr;
1229 ret = connectHelper<ICameraClient,Client>(cameraClient, id, api1CameraId, halVersion,
1232 /*out*/client);
1240 *device = client;
1255 sp<CameraDeviceClient> client = nullptr;
1261 /*out*/client);
1269 *device = client;
1273 template<class CALLBACK, class CLIENT>
1277 /*out*/sp<CLIENT>& device) {
1289 sp<CLIENT> client = nullptr;
1303 // Enforce client permissions and do basic sanity checks
1332 "Higher-priority client using camera, ID \"%s\" currently unavailable",
1342 // Handle special case for API1 MediaRecorder where the existing client is returned
1343 device = static_cast<CLIENT*>(clientTmp.get());
1366 client = static_cast<CLIENT*>(tmp.get());
1368 LOG_ALWAYS_FATAL_IF(client.get() == nullptr, "%s: CameraService in invalid state",
1371 err = client->initialize(mCameraProviderManager, mMonitorTags);
1373 ALOGE("%s: Could not initialize client from HAL.", __FUNCTION__);
1402 // Assume we have always received a Client subclass for API1
1403 sp<Client> shimClient = reinterpret_cast<Client*>(client.get());
1417 // If only updating legacy shim parameters, immediately disconnect client
1419 client->disconnect();
1422 // Otherwise, add client to active clients list
1423 finishConnectLocked(client, partial);
1427 // Important: release the mutex here so the client can call back into the service from its
1429 device = client;
1439 ALOGE("%s: torch client binder is NULL", __FUNCTION__);
1441 "Torch client Binder is null");
1531 // update the link to client's death
1732 void CameraService::removeByClient(const BasicClient* client) {
1736 if (clientSp.get() == client) {
1754 ALOGE("%s: Dead client still in mActiveClientManager.", __FUNCTION__);
1762 // Notify the client of disconnection
1773 // Do not clear caller identity, remote caller should be client proccess
1807 ALOGW("%s: Could not evict client, no client for camera ID %s", __FUNCTION__,
1846 ALOGE("%s: Dead client still in mActiveClientManager.", __FUNCTION__);
1861 ALOGE("Evicting conflicting client for camera ID %s due to user change",
1865 logEvent(String8::format("EVICT device %s client held by package %s (PID %"
1878 // Clear caller identity temporarily so client disconnect PID checks work correctly
1900 logEvent(String8::format("DISCONNECT device %s client for package %s (PID %d)", cameraId,
1907 logEvent(String8::format("CONNECT device %s client for package %s (PID %d)", cameraId,
1913 // Log the client rejected
1914 logEvent(String8::format("REJECT device %s client for package %s (PID %d), reason: (%s)",
1942 logEvent(String8::format("DIED client(s) with PID %d, reason: (%s)", clientPid, reason));
2070 CameraService::Client::Client(const sp<CameraService>& cameraService,
2086 LOG1("Client::Client E (pid %d, id %d)", callingPid, mCameraId);
2092 LOG1("Client::Client X (pid %d, id %d)", callingPid, mCameraId);
2095 // tear down the client
2096 CameraService::Client::~Client() {
2097 ALOGV("~Client");
2102 Client::disconnect();
2181 ALOGI("%s: Disconnected client for camera %s for PID %d", __FUNCTION__, mCameraIdStr.string(),
2184 // client shouldn't be able to call into us anymore
2224 ALOGV("%s: Start camera ops, package name = %s, client UID = %d",
2272 // This function is called when a client disconnects. This should
2329 // Reset the client PID to allow server-initiated disconnect,
2330 // and to prevent further calls by client.
2339 void CameraService::Client::notifyError(int32_t errorCode,
2354 binder::Status CameraService::Client::disconnect() {
2355 ALOGV("Client::disconnect");
2359 bool CameraService::Client::canCastToApiClient(apiLevel level) const {
2363 CameraService::Client::OpsCallback::OpsCallback(wp<BasicClient> client):
2364 mClient(client) {
2367 void CameraService::Client::OpsCallback::opChanged(int32_t op,
2369 sp<BasicClient> client = mClient.promote();
2370 if (client != NULL) {
2371 client->opChanged(op, packageName);
2633 ret.appendFormat("Client Package Name: %s", packageName.string());
2636 ret.append(", Conflicting Client
2745 dprintf(fd, " Device %s is open. Client instance dump:\n",
2747 dprintf(fd, " Client priority score: %d state: %d\n",
2750 dprintf(fd, " Client PID: %d\n", clientDescriptor->getOwnerId());
2752 auto client = clientDescriptor->getValue();
2753 dprintf(fd, " Client package: %s\n",
2754 String8(client->getPackageName()).string());
2756 client->dumpClient(fd, args);
2758 dprintf(fd, " Device %s is closed, no client instance\n",
2839 // turn off the torch mode that was turned on by dead client
2843 ALOGE("%s: torch client died but couldn't turn off torch: "
2862 // check torch client
2865 // check camera device client
2867 ALOGV("%s: Java client's binder death already cleaned up (normal case)", __FUNCTION__);
2871 ALOGE("%s: Java client's binder died, removing it from the list of active clients",
2949 * For example if a client disconnects, we want to go to PRESENT