Phil Burk | c0c70e3 | 2017-02-09 13:18:38 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Eric Laurent | a54f128 | 2017-07-01 19:39:32 -0700 | [diff] [blame] | 17 | #define LOG_TAG "AAudioEndpointManager" |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 18 | //#define LOG_NDEBUG 0 |
| 19 | #include <utils/Log.h> |
| 20 | |
Phil Burk | c0c70e3 | 2017-02-09 13:18:38 -0800 | [diff] [blame] | 21 | #include <assert.h> |
Andy Hung | 47c5e53 | 2017-06-26 18:28:00 -0700 | [diff] [blame] | 22 | #include <functional> |
Phil Burk | c0c70e3 | 2017-02-09 13:18:38 -0800 | [diff] [blame] | 23 | #include <map> |
| 24 | #include <mutex> |
Andy Hung | 47c5e53 | 2017-06-26 18:28:00 -0700 | [diff] [blame] | 25 | #include <sstream> |
| 26 | #include <utility/AAudioUtilities.h> |
Phil Burk | c0c70e3 | 2017-02-09 13:18:38 -0800 | [diff] [blame] | 27 | |
| 28 | #include "AAudioEndpointManager.h" |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 29 | #include "AAudioServiceEndpointShared.h" |
| 30 | #include "AAudioServiceEndpointMMAP.h" |
| 31 | #include "AAudioServiceEndpointCapture.h" |
| 32 | #include "AAudioServiceEndpointPlay.h" |
Phil Burk | c0c70e3 | 2017-02-09 13:18:38 -0800 | [diff] [blame] | 33 | |
| 34 | using namespace android; |
| 35 | using namespace aaudio; |
| 36 | |
| 37 | ANDROID_SINGLETON_STATIC_INSTANCE(AAudioEndpointManager); |
| 38 | |
| 39 | AAudioEndpointManager::AAudioEndpointManager() |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 40 | : Singleton<AAudioEndpointManager>() |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 41 | , mSharedStreams() |
| 42 | , mExclusiveStreams() { |
Phil Burk | c0c70e3 | 2017-02-09 13:18:38 -0800 | [diff] [blame] | 43 | } |
| 44 | |
Andy Hung | 47c5e53 | 2017-06-26 18:28:00 -0700 | [diff] [blame] | 45 | std::string AAudioEndpointManager::dump() const { |
| 46 | std::stringstream result; |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 47 | int index = 0; |
Andy Hung | 47c5e53 | 2017-06-26 18:28:00 -0700 | [diff] [blame] | 48 | |
Phil Burk | 4501b35 | 2017-06-29 18:12:36 -0700 | [diff] [blame] | 49 | result << "AAudioEndpointManager:" << "\n"; |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 50 | |
| 51 | const bool isSharedLocked = AAudio_tryUntilTrue( |
| 52 | [this]()->bool { return mSharedLock.try_lock(); } /* f */, |
| 53 | 50 /* times */, |
| 54 | 20 /* sleepMs */); |
| 55 | if (!isSharedLocked) { |
| 56 | result << "AAudioEndpointManager Shared may be deadlocked\n"; |
Andy Hung | 47c5e53 | 2017-06-26 18:28:00 -0700 | [diff] [blame] | 57 | } |
| 58 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 59 | { |
| 60 | const bool isExclusiveLocked = AAudio_tryUntilTrue( |
| 61 | [this]() -> bool { return mExclusiveLock.try_lock(); } /* f */, |
| 62 | 50 /* times */, |
| 63 | 20 /* sleepMs */); |
| 64 | if (!isExclusiveLocked) { |
| 65 | result << "AAudioEndpointManager Exclusive may be deadlocked\n"; |
| 66 | } |
| 67 | |
| 68 | result << "Exclusive MMAP Endpoints: " << mExclusiveStreams.size() << "\n"; |
| 69 | index = 0; |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 70 | for (const auto &stream : mExclusiveStreams) { |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 71 | result << " #" << index++ << ":"; |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 72 | result << stream->dump() << "\n"; |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 73 | } |
| 74 | |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 75 | result << " ExclusiveSearchCount: " << mExclusiveSearchCount << "\n"; |
| 76 | result << " ExclusiveFoundCount: " << mExclusiveFoundCount << "\n"; |
| 77 | result << " ExclusiveOpenCount: " << mExclusiveOpenCount << "\n"; |
| 78 | result << " ExclusiveCloseCount: " << mExclusiveCloseCount << "\n"; |
| 79 | result << "\n"; |
| 80 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 81 | if (isExclusiveLocked) { |
| 82 | mExclusiveLock.unlock(); |
| 83 | } |
Andy Hung | 47c5e53 | 2017-06-26 18:28:00 -0700 | [diff] [blame] | 84 | } |
| 85 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 86 | result << "Shared Endpoints: " << mSharedStreams.size() << "\n"; |
| 87 | index = 0; |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 88 | for (const auto &stream : mSharedStreams) { |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 89 | result << " #" << index++ << ":"; |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 90 | result << stream->dump() << "\n"; |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 91 | } |
| 92 | |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 93 | result << " SharedSearchCount: " << mSharedSearchCount << "\n"; |
| 94 | result << " SharedFoundCount: " << mSharedFoundCount << "\n"; |
| 95 | result << " SharedOpenCount: " << mSharedOpenCount << "\n"; |
| 96 | result << " SharedCloseCount: " << mSharedCloseCount << "\n"; |
| 97 | result << "\n"; |
| 98 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 99 | if (isSharedLocked) { |
| 100 | mSharedLock.unlock(); |
Andy Hung | 47c5e53 | 2017-06-26 18:28:00 -0700 | [diff] [blame] | 101 | } |
| 102 | return result.str(); |
| 103 | } |
| 104 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 105 | |
| 106 | // Try to find an existing endpoint. |
| 107 | sp<AAudioServiceEndpoint> AAudioEndpointManager::findExclusiveEndpoint_l( |
| 108 | const AAudioStreamConfiguration &configuration) { |
| 109 | sp<AAudioServiceEndpoint> endpoint; |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 110 | mExclusiveSearchCount++; |
Chih-Hung Hsieh | 3ef324d | 2018-12-11 11:48:12 -0800 | [diff] [blame] | 111 | for (const auto& ep : mExclusiveStreams) { |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 112 | if (ep->matches(configuration)) { |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 113 | mExclusiveFoundCount++; |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 114 | endpoint = ep; |
| 115 | break; |
| 116 | } |
| 117 | } |
| 118 | |
Phil Burk | 4e1af9f | 2018-01-03 15:54:35 -0800 | [diff] [blame] | 119 | ALOGV("findExclusiveEndpoint_l(), found %p for device = %d, sessionId = %d", |
| 120 | endpoint.get(), configuration.getDeviceId(), configuration.getSessionId()); |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 121 | return endpoint; |
| 122 | } |
| 123 | |
| 124 | // Try to find an existing endpoint. |
| 125 | sp<AAudioServiceEndpointShared> AAudioEndpointManager::findSharedEndpoint_l( |
| 126 | const AAudioStreamConfiguration &configuration) { |
| 127 | sp<AAudioServiceEndpointShared> endpoint; |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 128 | mSharedSearchCount++; |
Chih-Hung Hsieh | 3ef324d | 2018-12-11 11:48:12 -0800 | [diff] [blame] | 129 | for (const auto& ep : mSharedStreams) { |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 130 | if (ep->matches(configuration)) { |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 131 | mSharedFoundCount++; |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 132 | endpoint = ep; |
| 133 | break; |
| 134 | } |
| 135 | } |
| 136 | |
Phil Burk | 4e1af9f | 2018-01-03 15:54:35 -0800 | [diff] [blame] | 137 | ALOGV("findSharedEndpoint_l(), found %p for device = %d, sessionId = %d", |
| 138 | endpoint.get(), configuration.getDeviceId(), configuration.getSessionId()); |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 139 | return endpoint; |
| 140 | } |
| 141 | |
| 142 | sp<AAudioServiceEndpoint> AAudioEndpointManager::openEndpoint(AAudioService &audioService, |
Phil Burk | 15f97c9 | 2018-09-04 14:06:27 -0700 | [diff] [blame] | 143 | const aaudio::AAudioStreamRequest &request) { |
| 144 | if (request.getConstantConfiguration().getSharingMode() == AAUDIO_SHARING_MODE_EXCLUSIVE) { |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 145 | return openExclusiveEndpoint(audioService, request); |
| 146 | } else { |
| 147 | return openSharedEndpoint(audioService, request); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | sp<AAudioServiceEndpoint> AAudioEndpointManager::openExclusiveEndpoint( |
Phil Burk | bbd5286 | 2018-04-13 11:37:42 -0700 | [diff] [blame] | 152 | AAudioService &aaudioService, |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 153 | const aaudio::AAudioStreamRequest &request) { |
| 154 | |
| 155 | std::lock_guard<std::mutex> lock(mExclusiveLock); |
| 156 | |
| 157 | const AAudioStreamConfiguration &configuration = request.getConstantConfiguration(); |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 158 | |
| 159 | // Try to find an existing endpoint. |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 160 | sp<AAudioServiceEndpoint> endpoint = findExclusiveEndpoint_l(configuration); |
Eric Laurent | a17ae74 | 2017-06-29 15:43:55 -0700 | [diff] [blame] | 161 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 162 | // If we find an existing one then this one cannot be exclusive. |
| 163 | if (endpoint.get() != nullptr) { |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 164 | ALOGW("openExclusiveEndpoint() already in use"); |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 165 | // Already open so do not allow a second stream. |
| 166 | return nullptr; |
| 167 | } else { |
Phil Burk | bbd5286 | 2018-04-13 11:37:42 -0700 | [diff] [blame] | 168 | sp<AAudioServiceEndpointMMAP> endpointMMap = new AAudioServiceEndpointMMAP(aaudioService); |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 169 | ALOGV("openExclusiveEndpoint(), no match so try to open MMAP %p for dev %d", |
Phil Burk | 4e1af9f | 2018-01-03 15:54:35 -0800 | [diff] [blame] | 170 | endpointMMap.get(), configuration.getDeviceId()); |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 171 | endpoint = endpointMMap; |
Eric Laurent | a17ae74 | 2017-06-29 15:43:55 -0700 | [diff] [blame] | 172 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 173 | aaudio_result_t result = endpoint->open(request); |
| 174 | if (result != AAUDIO_OK) { |
Phil Burk | a3901e9 | 2018-10-08 13:54:38 -0700 | [diff] [blame] | 175 | ALOGV("openExclusiveEndpoint(), open failed"); |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 176 | endpoint.clear(); |
| 177 | } else { |
| 178 | mExclusiveStreams.push_back(endpointMMap); |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 179 | mExclusiveOpenCount++; |
Phil Burk | 11e8d33 | 2017-05-24 09:59:02 -0700 | [diff] [blame] | 180 | } |
Phil Burk | c0c70e3 | 2017-02-09 13:18:38 -0800 | [diff] [blame] | 181 | } |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 182 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 183 | if (endpoint.get() != nullptr) { |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 184 | // Increment the reference count under this lock. |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 185 | endpoint->setOpenCount(endpoint->getOpenCount() + 1); |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 186 | } |
Phil Burk | c0c70e3 | 2017-02-09 13:18:38 -0800 | [diff] [blame] | 187 | return endpoint; |
| 188 | } |
| 189 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 190 | sp<AAudioServiceEndpoint> AAudioEndpointManager::openSharedEndpoint( |
| 191 | AAudioService &aaudioService, |
| 192 | const aaudio::AAudioStreamRequest &request) { |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 193 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 194 | std::lock_guard<std::mutex> lock(mSharedLock); |
Phil Burk | ec89b2e | 2017-06-20 15:05:06 -0700 | [diff] [blame] | 195 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 196 | const AAudioStreamConfiguration &configuration = request.getConstantConfiguration(); |
| 197 | aaudio_direction_t direction = configuration.getDirection(); |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 198 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 199 | // Try to find an existing endpoint. |
| 200 | sp<AAudioServiceEndpointShared> endpoint = findSharedEndpoint_l(configuration); |
| 201 | |
| 202 | // If we can't find an existing one then open a new one. |
| 203 | if (endpoint.get() == nullptr) { |
| 204 | // we must call openStream with audioserver identity |
| 205 | int64_t token = IPCThreadState::self()->clearCallingIdentity(); |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 206 | switch (direction) { |
| 207 | case AAUDIO_DIRECTION_INPUT: |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 208 | endpoint = new AAudioServiceEndpointCapture(aaudioService); |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 209 | break; |
| 210 | case AAUDIO_DIRECTION_OUTPUT: |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 211 | endpoint = new AAudioServiceEndpointPlay(aaudioService); |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 212 | break; |
Phil Burk | 11e8d33 | 2017-05-24 09:59:02 -0700 | [diff] [blame] | 213 | default: |
| 214 | break; |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 215 | } |
Phil Burk | 87c9f64 | 2017-05-17 07:22:39 -0700 | [diff] [blame] | 216 | |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 217 | if (endpoint.get() != nullptr) { |
| 218 | aaudio_result_t result = endpoint->open(request); |
| 219 | if (result != AAUDIO_OK) { |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 220 | endpoint.clear(); |
| 221 | } else { |
| 222 | mSharedStreams.push_back(endpoint); |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 223 | mSharedOpenCount++; |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 224 | } |
| 225 | } |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 226 | ALOGV("%s(), created endpoint %p, requested device = %d, dir = %d", |
Phil Burk | 19e990e | 2018-03-22 13:59:34 -0700 | [diff] [blame] | 227 | __func__, endpoint.get(), configuration.getDeviceId(), (int)direction); |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 228 | IPCThreadState::self()->restoreCallingIdentity(token); |
| 229 | } |
| 230 | |
| 231 | if (endpoint.get() != nullptr) { |
| 232 | // Increment the reference count under this lock. |
| 233 | endpoint->setOpenCount(endpoint->getOpenCount() + 1); |
| 234 | } |
| 235 | return endpoint; |
| 236 | } |
| 237 | |
| 238 | void AAudioEndpointManager::closeEndpoint(sp<AAudioServiceEndpoint>serviceEndpoint) { |
| 239 | if (serviceEndpoint->getSharingMode() == AAUDIO_SHARING_MODE_EXCLUSIVE) { |
| 240 | return closeExclusiveEndpoint(serviceEndpoint); |
| 241 | } else { |
| 242 | return closeSharedEndpoint(serviceEndpoint); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | void AAudioEndpointManager::closeExclusiveEndpoint(sp<AAudioServiceEndpoint> serviceEndpoint) { |
| 247 | if (serviceEndpoint.get() == nullptr) { |
| 248 | return; |
| 249 | } |
| 250 | |
| 251 | // Decrement the reference count under this lock. |
| 252 | std::lock_guard<std::mutex> lock(mExclusiveLock); |
| 253 | int32_t newRefCount = serviceEndpoint->getOpenCount() - 1; |
| 254 | serviceEndpoint->setOpenCount(newRefCount); |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 255 | |
Phil Burk | fbf031e | 2017-10-12 15:58:31 -0700 | [diff] [blame] | 256 | // If no longer in use then actually close it. |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 257 | if (newRefCount <= 0) { |
| 258 | mExclusiveStreams.erase( |
| 259 | std::remove(mExclusiveStreams.begin(), mExclusiveStreams.end(), serviceEndpoint), |
| 260 | mExclusiveStreams.end()); |
| 261 | |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 262 | serviceEndpoint->close(); |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 263 | mExclusiveCloseCount++; |
| 264 | ALOGV("%s() %p for device %d", |
Phil Burk | 19e990e | 2018-03-22 13:59:34 -0700 | [diff] [blame] | 265 | __func__, serviceEndpoint.get(), serviceEndpoint->getDeviceId()); |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 266 | } |
| 267 | } |
| 268 | |
| 269 | void AAudioEndpointManager::closeSharedEndpoint(sp<AAudioServiceEndpoint> serviceEndpoint) { |
| 270 | if (serviceEndpoint.get() == nullptr) { |
| 271 | return; |
| 272 | } |
| 273 | |
| 274 | // Decrement the reference count under this lock. |
| 275 | std::lock_guard<std::mutex> lock(mSharedLock); |
| 276 | int32_t newRefCount = serviceEndpoint->getOpenCount() - 1; |
| 277 | serviceEndpoint->setOpenCount(newRefCount); |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 278 | |
Phil Burk | fbf031e | 2017-10-12 15:58:31 -0700 | [diff] [blame] | 279 | // If no longer in use then actually close it. |
Phil Burk | 39f02dd | 2017-08-04 09:13:31 -0700 | [diff] [blame] | 280 | if (newRefCount <= 0) { |
| 281 | mSharedStreams.erase( |
| 282 | std::remove(mSharedStreams.begin(), mSharedStreams.end(), serviceEndpoint), |
| 283 | mSharedStreams.end()); |
| 284 | |
| 285 | serviceEndpoint->close(); |
Phil Burk | 55e5eab | 2018-04-10 15:16:38 -0700 | [diff] [blame] | 286 | mSharedCloseCount++; |
| 287 | ALOGV("%s() %p for device %d", |
Phil Burk | 19e990e | 2018-03-22 13:59:34 -0700 | [diff] [blame] | 288 | __func__, serviceEndpoint.get(), serviceEndpoint->getDeviceId()); |
Phil Burk | 71f35bb | 2017-04-13 16:05:07 -0700 | [diff] [blame] | 289 | } |
| 290 | } |