Loading services/oboeservice/AAudioClientTracker.cpp +15 −3 Original line number Diff line number Diff line Loading @@ -74,16 +74,28 @@ aaudio_result_t AAudioClientTracker::registerClient(pid_t pid, } const std::lock_guard<std::mutex> lock(mLock); sp<NotificationClient> notificationClient; status_t status; sp<IBinder> binder = IInterface::asBinder(client); if (mNotificationClients.count(pid) == 0) { const sp<IBinder> binder = IInterface::asBinder(client); const sp<NotificationClient> notificationClient = new NotificationClient(pid, binder); notificationClient = new NotificationClient(pid, binder); mNotificationClients[pid] = notificationClient; const status_t status = binder->linkToDeath(notificationClient); status = binder->linkToDeath(notificationClient); ALOGW_IF(status != NO_ERROR, "registerClient() linkToDeath = %d\n", status); return AAudioConvert_androidToAAudioResult(status); } else { ALOGW("registerClient(%d) already registered!", pid); notificationClient = mNotificationClients[pid]; if (notificationClient-> isBinderNull()) { ALOGW("registerClient() need to linkToDeath as notificationClient binder is null"); status = binder->linkToDeath(notificationClient); if (status != NO_ERROR) { ALOGE("registerClient() linkToDeath status = %d\n", status); } else { notificationClient->setBinder(binder); } } return AAUDIO_OK; // TODO should this be considered an error } } Loading services/oboeservice/AAudioClientTracker.h +8 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,14 @@ private: return mExclusiveEnabled; } bool isBinderNull() { return mBinder == nullptr; } void setBinder(android::sp<IBinder>& binder) { mBinder = binder; } // IBinder::DeathRecipient void binderDied(const android::wp<IBinder>& who) override; Loading Loading
services/oboeservice/AAudioClientTracker.cpp +15 −3 Original line number Diff line number Diff line Loading @@ -74,16 +74,28 @@ aaudio_result_t AAudioClientTracker::registerClient(pid_t pid, } const std::lock_guard<std::mutex> lock(mLock); sp<NotificationClient> notificationClient; status_t status; sp<IBinder> binder = IInterface::asBinder(client); if (mNotificationClients.count(pid) == 0) { const sp<IBinder> binder = IInterface::asBinder(client); const sp<NotificationClient> notificationClient = new NotificationClient(pid, binder); notificationClient = new NotificationClient(pid, binder); mNotificationClients[pid] = notificationClient; const status_t status = binder->linkToDeath(notificationClient); status = binder->linkToDeath(notificationClient); ALOGW_IF(status != NO_ERROR, "registerClient() linkToDeath = %d\n", status); return AAudioConvert_androidToAAudioResult(status); } else { ALOGW("registerClient(%d) already registered!", pid); notificationClient = mNotificationClients[pid]; if (notificationClient-> isBinderNull()) { ALOGW("registerClient() need to linkToDeath as notificationClient binder is null"); status = binder->linkToDeath(notificationClient); if (status != NO_ERROR) { ALOGE("registerClient() linkToDeath status = %d\n", status); } else { notificationClient->setBinder(binder); } } return AAUDIO_OK; // TODO should this be considered an error } } Loading
services/oboeservice/AAudioClientTracker.h +8 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,14 @@ private: return mExclusiveEnabled; } bool isBinderNull() { return mBinder == nullptr; } void setBinder(android::sp<IBinder>& binder) { mBinder = binder; } // IBinder::DeathRecipient void binderDied(const android::wp<IBinder>& who) override; Loading