Lines Matching refs:Client
344 // Remove the client from the list of active clients, if there is one
348 // Disconnect client
350 ALOGI("%s: Client for camera ID %s evicted due to device status change from HAL",
352 // Notify the client of disconnection
356 // Ensure not in binder RPC so client disconnect PID checks work correctly
607 /*out*/sp<BasicClient>* client) {
616 *client = new CameraClient(cameraService, tmp, packageName, cameraIdToInt(cameraId),
632 *client = new Camera2Client(cameraService, tmp, packageName, cameraIdToInt(cameraId),
637 *client = new CameraDeviceClient(cameraService, tmp, packageName, cameraId,
655 *client = new CameraClient(cameraService, tmp, packageName, cameraIdToInt(cameraId),
750 sp<Client> tmp = nullptr;
751 if (!(ret = connectHelper<ICameraClient,Client>(
898 "forward camera access to camera %s for client %s (PID %d, UID %d)",
911 "forward camera access to camera %s for client %s (PID %d, UID %d)",
925 // Only use passed in clientPid to check permission. Use calling PID as the client PID that's
969 void CameraService::finishConnectLocked(const sp<BasicClient>& client,
972 // Make a descriptor for the incoming client
973 auto clientDescriptor = CameraService::CameraClientManager::makeClientDescriptor(client, desc);
977 String8(client->getPackageName()));
982 ALOGE("%s: Invalid state: Client for camera %s was not removed in disconnect",
990 // And register a death notification for the client callback. Do
992 // transaction might be pre-empted to service the client death
993 // notification if the client process dies before linkToDeath is
995 sp<IBinder> remoteCallback = client->getRemote();
1004 sp<BasicClient>* client,
1012 // If we are using API1, any existing client for this camera ID with the same remote
1020 ALOGW("CameraService connect called from same client, but with a different"
1021 " API level, evicting prior client...");
1024 " app binder, returning the same client)", clientPid);
1025 *client = clientSp;
1032 // Get current active client PIDs
1066 // Make descriptor for incoming client
1077 // If the incoming client was 'evicted,' higher priority clients have the camera in the
1080 ALOGE("CameraService::connect X (PID %d) rejected (existing client(s) with higher"
1088 String8 msg = String8::format("%s : DENIED connect device %s client for package %s "
1095 msg.appendFormat("\n - Blocked by existing device %s client for package %s"
1101 ALOGE(" Conflicts with: Device %s, client package %s (PID %"
1107 // Log the client's attempt
1117 ALOGE("%s: Invalid state: Null client in active client list.", __FUNCTION__);
1120 LOG_ALWAYS_FATAL("%s: Invalid state for CameraService, null client in active list",
1126 ALOGE("CameraService::connect evicting conflicting client for camera ID %s",
1131 logEvent(String8::format("EVICT device %s client held by package %s (PID"
1132 " %" PRId32 ", score %" PRId32 ", state %" PRId32 ")\n - Evicted by device %s client for"
1141 // Notify the client of disconnection
1151 // Clear caller identity temporarily so client disconnect PID checks work correctly
1157 i->getValue()->disconnect(); // Clients will remove themselves from the active client list
1163 ALOGV("%s: Waiting for disconnect to complete for client for device %s (PID %" PRId32 ")",
1167 ALOGE("%s: Timed out waiting for client for device %s to disconnect, "
1173 ALOGE("%s: Received error waiting for client for device %s to disconnect: %s (%d), "
1206 sp<Client> client = nullptr;
1207 ret = connectHelper<ICameraClient,Client>(cameraClient, id,
1210 /*out*/client);
1218 *device = client;
1234 sp<Client> client = nullptr;
1235 ret = connectHelper<ICameraClient,Client>(cameraClient, id, halVersion,
1238 /*out*/client);
1246 *device = client;
1261 sp<CameraDeviceClient> client = nullptr;
1266 /*out*/client);
1274 *device = client;
1278 template<class CALLBACK, class CLIENT>
1282 /*out*/sp<CLIENT>& device) {
1294 sp<CLIENT> client = nullptr;
1308 // Enforce client permissions and do basic sanity checks
1337 "Higher-priority client using camera, ID \"%s\" currently unavailable",
1347 // Handle special case for API1 MediaRecorder where the existing client is returned
1348 device = static_cast<CLIENT*>(clientTmp.get());
1369 client = static_cast<CLIENT*>(tmp.get());
1371 LOG_ALWAYS_FATAL_IF(client.get() == nullptr, "%s: CameraService in invalid state",
1374 err = client->initialize(mCameraProviderManager);
1376 ALOGE("%s: Could not initialize client from HAL.", __FUNCTION__);
1405 // Assume we have always received a Client subclass for API1
1406 sp<Client> shimClient = reinterpret_cast<Client*>(client.get());
1420 // If only updating legacy shim parameters, immediately disconnect client
1422 client->disconnect();
1425 // Otherwise, add client to active clients list
1426 finishConnectLocked(client, partial);
1430 // Important: release the mutex here so the client can call back into the service from its
1432 device = client;
1442 ALOGE("%s: torch client binder is NULL", __FUNCTION__);
1444 "Torch client Binder is null");
1534 // update the link to client's death
1732 void CameraService::removeByClient(const BasicClient* client) {
1736 if (clientSp.get() == client) {
1756 ALOGE("%s: Dead client still in mActiveClientManager.", __FUNCTION__);
1765 // Notify the client of disconnection
1776 // Do not clear caller identity, remote caller should be client proccess
1810 ALOGW("%s: Could not evict client, no client for camera ID %s", __FUNCTION__,
1849 ALOGE("%s: Dead client still in mActiveClientManager.", __FUNCTION__);
1864 ALOGE("Evicting conflicting client for camera ID %s due to user change",
1868 logEvent(String8::format("EVICT device %s client held by package %s (PID %"
1881 // Clear caller identity temporarily so client disconnect PID checks work correctly
1903 logEvent(String8::format("DISCONNECT device %s client for package %s (PID %d)", cameraId,
1910 logEvent(String8::format("CONNECT device %s client for package %s (PID %d)", cameraId,
1916 // Log the client rejected
1917 logEvent(String8::format("REJECT device %s client for package %s (PID %d), reason: (%s)",
1945 logEvent(String8::format("DIED client(s) with PID %d, reason: (%s)", clientPid, reason));
2035 CameraService::Client::Client(const sp<CameraService>& cameraService,
2050 LOG1("Client::Client E (pid %d, id %d)", callingPid, mCameraId);
2056 LOG1("Client::Client X (pid %d, id %d)", callingPid, mCameraId);
2059 // tear down the client
2060 CameraService::Client::~Client() {
2061 ALOGV("~Client");
2066 Client::disconnect();
2145 ALOGI("%s: Disconnected client for camera %s for PID %d", __FUNCTION__, mCameraIdStr.string(),
2148 // client shouldn't be able to call into us anymore
2188 ALOGV("%s: Start camera ops, package name = %s, client UID = %d",
2275 // Reset the client PID to allow server-initiated disconnect,
2276 // and to prevent further calls by client.
2286 void CameraService::Client::notifyError(int32_t errorCode,
2298 binder::Status CameraService::Client::disconnect() {
2299 ALOGV("Client::disconnect");
2303 bool CameraService::Client::canCastToApiClient(apiLevel level) const {
2307 CameraService::Client::OpsCallback::OpsCallback(wp<BasicClient> client):
2308 mClient(client) {
2311 void CameraService::Client::OpsCallback::opChanged(int32_t op,
2313 sp<BasicClient> client = mClient.promote();
2314 if (client != NULL) {
2315 client->opChanged(op, packageName);
2427 ret.appendFormat("Client Package Name: %s", packageName.string());
2430 ret.append(", Conflicting Client Devices: {");
2526 dprintf(fd, " Device %s is open. Client instance dump:\n",
2528 dprintf(fd, " Client priority score: %d state: %d\n",
2531 dprintf(fd, " Client PID: %d\n", clientDescriptor->getOwnerId());
2533 auto client = clientDescriptor->getValue();
2534 dprintf(fd, " Client package: %s\n",
2535 String8(client->getPackageName()).string());
2537 client->dumpClient(fd, args);
2539 dprintf(fd, " Device %s is closed, no client instance\n",
2620 // turn off the torch mode that was turned on by dead client
2624 ALOGE("%s: torch client died but couldn't turn off torch: "
2643 // check torch client
2646 // check camera device client
2648 ALOGV("%s: Java client's binder death already cleaned up (normal case)", __FUNCTION__);
2652 ALOGE("%s: Java client's binder died, removing it from the list of active clients",
2730 * For example if a client disconnects, we want to go to PRESENT