Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 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 | |
| 17 | //#define LOG_NDEBUG 0 |
| 18 | #undef LOG_TAG |
| 19 | #define LOG_TAG "TransactionCompletedThread" |
| 20 | #define ATRACE_TAG ATRACE_TAG_GRAPHICS |
| 21 | |
| 22 | #include "TransactionCompletedThread.h" |
| 23 | |
| 24 | #include <cinttypes> |
| 25 | |
| 26 | #include <binder/IInterface.h> |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 27 | #include <utils/RefBase.h> |
| 28 | |
| 29 | namespace android { |
| 30 | |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 31 | // Returns 0 if they are equal |
| 32 | // <0 if the first id that doesn't match is lower in c2 or all ids match but c2 is shorter |
| 33 | // >0 if the first id that doesn't match is greater in c2 or all ids match but c2 is longer |
| 34 | // |
| 35 | // See CallbackIdsHash for a explaniation of why this works |
Greg Kaiser | a9e843a | 2019-04-01 06:23:09 -0700 | [diff] [blame] | 36 | static int compareCallbackIds(const std::vector<CallbackId>& c1, |
| 37 | const std::vector<CallbackId>& c2) { |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 38 | if (c1.empty()) { |
| 39 | return !c2.empty(); |
| 40 | } |
| 41 | return c1.front() - c2.front(); |
| 42 | } |
| 43 | |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 44 | TransactionCompletedThread::~TransactionCompletedThread() { |
Marissa Wall | 99343ba | 2018-11-13 10:39:08 -0800 | [diff] [blame] | 45 | std::lock_guard lockThread(mThreadMutex); |
| 46 | |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 47 | { |
| 48 | std::lock_guard lock(mMutex); |
| 49 | mKeepRunning = false; |
| 50 | mConditionVariable.notify_all(); |
| 51 | } |
| 52 | |
Marissa Wall | 05d9dd3 | 2018-11-13 10:05:14 -0800 | [diff] [blame] | 53 | if (mThread.joinable()) { |
| 54 | mThread.join(); |
| 55 | } |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 56 | |
| 57 | { |
| 58 | std::lock_guard lock(mMutex); |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 59 | for (const auto& [listener, transactionStats] : mCompletedTransactions) { |
Valerie Hau | 5de3ad2 | 2019-08-20 07:47:43 -0700 | [diff] [blame] | 60 | listener->unlinkToDeath(mDeathRecipient); |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 61 | } |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | void TransactionCompletedThread::run() { |
| 66 | std::lock_guard lock(mMutex); |
Marissa Wall | 99343ba | 2018-11-13 10:39:08 -0800 | [diff] [blame] | 67 | if (mRunning || !mKeepRunning) { |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 68 | return; |
| 69 | } |
| 70 | mDeathRecipient = new ThreadDeathRecipient(); |
| 71 | mRunning = true; |
Marissa Wall | 99343ba | 2018-11-13 10:39:08 -0800 | [diff] [blame] | 72 | |
| 73 | std::lock_guard lockThread(mThreadMutex); |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 74 | mThread = std::thread(&TransactionCompletedThread::threadMain, this); |
| 75 | } |
| 76 | |
Marissa Wall | efb71af | 2019-06-27 14:45:53 -0700 | [diff] [blame] | 77 | status_t TransactionCompletedThread::startRegistration(const ListenerCallbacks& listenerCallbacks) { |
Valerie Hau | 9dab973 | 2019-08-20 09:29:25 -0700 | [diff] [blame] | 78 | // begin running if not already running |
| 79 | run(); |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 80 | std::lock_guard lock(mMutex); |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 81 | if (!mRunning) { |
| 82 | ALOGE("cannot add callback because the callback thread isn't running"); |
| 83 | return BAD_VALUE; |
Marissa Wall | 3dad52d | 2019-03-22 14:03:19 -0700 | [diff] [blame] | 84 | } |
| 85 | |
Valerie Hau | 9dab973 | 2019-08-20 09:29:25 -0700 | [diff] [blame] | 86 | auto [itr, inserted] = mRegisteringTransactions.insert(listenerCallbacks); |
Marissa Wall | efb71af | 2019-06-27 14:45:53 -0700 | [diff] [blame] | 87 | auto& [listener, callbackIds] = listenerCallbacks; |
| 88 | |
Valerie Hau | 9dab973 | 2019-08-20 09:29:25 -0700 | [diff] [blame] | 89 | if (inserted) { |
| 90 | if (mCompletedTransactions.count(listener) == 0) { |
| 91 | status_t err = listener->linkToDeath(mDeathRecipient); |
| 92 | if (err != NO_ERROR) { |
| 93 | ALOGE("cannot add callback because linkToDeath failed, err: %d", err); |
| 94 | return err; |
| 95 | } |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 96 | } |
Valerie Hau | 9dab973 | 2019-08-20 09:29:25 -0700 | [diff] [blame] | 97 | auto& transactionStatsDeque = mCompletedTransactions[listener]; |
| 98 | transactionStatsDeque.emplace_back(callbackIds); |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 99 | } |
| 100 | |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 101 | return NO_ERROR; |
| 102 | } |
| 103 | |
Marissa Wall | efb71af | 2019-06-27 14:45:53 -0700 | [diff] [blame] | 104 | status_t TransactionCompletedThread::endRegistration(const ListenerCallbacks& listenerCallbacks) { |
| 105 | std::lock_guard lock(mMutex); |
| 106 | if (!mRunning) { |
| 107 | ALOGE("cannot add callback because the callback thread isn't running"); |
| 108 | return BAD_VALUE; |
| 109 | } |
| 110 | |
| 111 | auto itr = mRegisteringTransactions.find(listenerCallbacks); |
| 112 | if (itr == mRegisteringTransactions.end()) { |
| 113 | ALOGE("cannot end a registration that does not exist"); |
| 114 | return BAD_VALUE; |
| 115 | } |
| 116 | |
| 117 | mRegisteringTransactions.erase(itr); |
| 118 | |
| 119 | return NO_ERROR; |
| 120 | } |
| 121 | |
| 122 | bool TransactionCompletedThread::isRegisteringTransaction( |
Valerie Hau | 5de3ad2 | 2019-08-20 07:47:43 -0700 | [diff] [blame] | 123 | const sp<IBinder>& transactionListener, const std::vector<CallbackId>& callbackIds) { |
Marissa Wall | efb71af | 2019-06-27 14:45:53 -0700 | [diff] [blame] | 124 | ListenerCallbacks listenerCallbacks(transactionListener, callbackIds); |
| 125 | |
| 126 | auto itr = mRegisteringTransactions.find(listenerCallbacks); |
| 127 | return itr != mRegisteringTransactions.end(); |
| 128 | } |
| 129 | |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 130 | status_t TransactionCompletedThread::registerPendingCallbackHandle( |
| 131 | const sp<CallbackHandle>& handle) { |
| 132 | std::lock_guard lock(mMutex); |
| 133 | if (!mRunning) { |
| 134 | ALOGE("cannot register callback handle because the callback thread isn't running"); |
| 135 | return BAD_VALUE; |
| 136 | } |
| 137 | |
| 138 | // If we can't find the transaction stats something has gone wrong. The client should call |
Marissa Wall | efb71af | 2019-06-27 14:45:53 -0700 | [diff] [blame] | 139 | // startRegistration before trying to register a pending callback handle. |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 140 | TransactionStats* transactionStats; |
| 141 | status_t err = findTransactionStats(handle->listener, handle->callbackIds, &transactionStats); |
| 142 | if (err != NO_ERROR) { |
| 143 | ALOGE("cannot find transaction stats"); |
| 144 | return err; |
| 145 | } |
| 146 | |
| 147 | mPendingTransactions[handle->listener][handle->callbackIds]++; |
| 148 | return NO_ERROR; |
| 149 | } |
| 150 | |
Marissa Wall | efb71af | 2019-06-27 14:45:53 -0700 | [diff] [blame] | 151 | status_t TransactionCompletedThread::finalizePendingCallbackHandles( |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 152 | const std::deque<sp<CallbackHandle>>& handles) { |
| 153 | std::lock_guard lock(mMutex); |
| 154 | if (!mRunning) { |
| 155 | ALOGE("cannot add presented callback handle because the callback thread isn't running"); |
| 156 | return BAD_VALUE; |
| 157 | } |
| 158 | |
| 159 | for (const auto& handle : handles) { |
| 160 | auto listener = mPendingTransactions.find(handle->listener); |
| 161 | if (listener != mPendingTransactions.end()) { |
| 162 | auto& pendingCallbacks = listener->second; |
| 163 | auto pendingCallback = pendingCallbacks.find(handle->callbackIds); |
| 164 | |
| 165 | if (pendingCallback != pendingCallbacks.end()) { |
| 166 | auto& pendingCount = pendingCallback->second; |
| 167 | |
| 168 | // Decrease the pending count for this listener |
| 169 | if (--pendingCount == 0) { |
| 170 | pendingCallbacks.erase(pendingCallback); |
| 171 | } |
| 172 | } else { |
| 173 | ALOGW("there are more latched callbacks than there were registered callbacks"); |
| 174 | } |
Marissa Wall | b0022cc | 2019-04-16 14:19:55 -0700 | [diff] [blame] | 175 | if (listener->second.size() == 0) { |
| 176 | mPendingTransactions.erase(listener); |
| 177 | } |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 178 | } else { |
| 179 | ALOGW("cannot find listener in mPendingTransactions"); |
| 180 | } |
| 181 | |
| 182 | status_t err = addCallbackHandle(handle); |
| 183 | if (err != NO_ERROR) { |
| 184 | ALOGE("could not add callback handle"); |
| 185 | return err; |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | return NO_ERROR; |
| 190 | } |
| 191 | |
Valerie Hau | ac12ae7 | 2019-11-19 14:13:16 -0800 | [diff] [blame] | 192 | void TransactionCompletedThread::clearAllPending() { |
| 193 | std::lock_guard lock(mMutex); |
| 194 | if (!mRunning) { |
| 195 | return; |
| 196 | } |
| 197 | mPendingTransactions.clear(); |
| 198 | mConditionVariable.notify_all(); |
| 199 | } |
| 200 | |
Marissa Wall | efb71af | 2019-06-27 14:45:53 -0700 | [diff] [blame] | 201 | status_t TransactionCompletedThread::registerUnpresentedCallbackHandle( |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 202 | const sp<CallbackHandle>& handle) { |
| 203 | std::lock_guard lock(mMutex); |
| 204 | if (!mRunning) { |
| 205 | ALOGE("cannot add unpresented callback handle because the callback thread isn't running"); |
| 206 | return BAD_VALUE; |
| 207 | } |
| 208 | |
| 209 | return addCallbackHandle(handle); |
| 210 | } |
| 211 | |
| 212 | status_t TransactionCompletedThread::findTransactionStats( |
Valerie Hau | 5de3ad2 | 2019-08-20 07:47:43 -0700 | [diff] [blame] | 213 | const sp<IBinder>& listener, const std::vector<CallbackId>& callbackIds, |
| 214 | TransactionStats** outTransactionStats) { |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 215 | auto& transactionStatsDeque = mCompletedTransactions[listener]; |
| 216 | |
| 217 | // Search back to front because the most recent transactions are at the back of the deque |
| 218 | auto itr = transactionStatsDeque.rbegin(); |
| 219 | for (; itr != transactionStatsDeque.rend(); itr++) { |
| 220 | if (compareCallbackIds(itr->callbackIds, callbackIds) == 0) { |
| 221 | *outTransactionStats = &(*itr); |
| 222 | return NO_ERROR; |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | ALOGE("could not find transaction stats"); |
| 227 | return BAD_VALUE; |
| 228 | } |
| 229 | |
| 230 | status_t TransactionCompletedThread::addCallbackHandle(const sp<CallbackHandle>& handle) { |
| 231 | // If we can't find the transaction stats something has gone wrong. The client should call |
Marissa Wall | efb71af | 2019-06-27 14:45:53 -0700 | [diff] [blame] | 232 | // startRegistration before trying to add a callback handle. |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 233 | TransactionStats* transactionStats; |
| 234 | status_t err = findTransactionStats(handle->listener, handle->callbackIds, &transactionStats); |
| 235 | if (err != NO_ERROR) { |
| 236 | return err; |
| 237 | } |
| 238 | |
| 239 | transactionStats->latchTime = handle->latchTime; |
Marissa Wall | 0e24a83 | 2019-07-10 15:32:50 -0700 | [diff] [blame] | 240 | // If the layer has already been destroyed, don't add the SurfaceControl to the callback. |
| 241 | // The client side keeps a sp<> to the SurfaceControl so if the SurfaceControl has been |
| 242 | // destroyed the client side is dead and there won't be anyone to send the callback to. |
| 243 | sp<IBinder> surfaceControl = handle->surfaceControl.promote(); |
| 244 | if (surfaceControl) { |
| 245 | transactionStats->surfaceStats.emplace_back(surfaceControl, handle->acquireTime, |
Valerie Hau | 32cdc1f | 2019-10-21 14:45:54 -0700 | [diff] [blame] | 246 | handle->previousReleaseFence, |
| 247 | handle->transformHint); |
Marissa Wall | 0e24a83 | 2019-07-10 15:32:50 -0700 | [diff] [blame] | 248 | } |
Marissa Wall | 3dad52d | 2019-03-22 14:03:19 -0700 | [diff] [blame] | 249 | return NO_ERROR; |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 250 | } |
| 251 | |
| 252 | void TransactionCompletedThread::addPresentFence(const sp<Fence>& presentFence) { |
| 253 | std::lock_guard<std::mutex> lock(mMutex); |
| 254 | mPresentFence = presentFence; |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 255 | } |
| 256 | |
| 257 | void TransactionCompletedThread::sendCallbacks() { |
| 258 | std::lock_guard lock(mMutex); |
| 259 | if (mRunning) { |
| 260 | mConditionVariable.notify_all(); |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | void TransactionCompletedThread::threadMain() { |
| 265 | std::lock_guard lock(mMutex); |
| 266 | |
| 267 | while (mKeepRunning) { |
| 268 | mConditionVariable.wait(mMutex); |
Marissa Wall | caa83f5 | 2019-05-29 13:03:25 -0700 | [diff] [blame] | 269 | std::vector<ListenerStats> completedListenerStats; |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 270 | |
| 271 | // For each listener |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 272 | auto completedTransactionsItr = mCompletedTransactions.begin(); |
| 273 | while (completedTransactionsItr != mCompletedTransactions.end()) { |
| 274 | auto& [listener, transactionStatsDeque] = *completedTransactionsItr; |
| 275 | ListenerStats listenerStats; |
| 276 | listenerStats.listener = listener; |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 277 | |
| 278 | // For each transaction |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 279 | auto transactionStatsItr = transactionStatsDeque.begin(); |
| 280 | while (transactionStatsItr != transactionStatsDeque.end()) { |
| 281 | auto& transactionStats = *transactionStatsItr; |
| 282 | |
Marissa Wall | efb71af | 2019-06-27 14:45:53 -0700 | [diff] [blame] | 283 | // If this transaction is still registering, it is not safe to send a callback |
| 284 | // because there could be surface controls that haven't been added to |
| 285 | // transaction stats or mPendingTransactions. |
| 286 | if (isRegisteringTransaction(listener, transactionStats.callbackIds)) { |
| 287 | break; |
| 288 | } |
| 289 | |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 290 | // If we are still waiting on the callback handles for this transaction, stop |
| 291 | // here because all transaction callbacks for the same listener must come in order |
Marissa Wall | 6110e84 | 2019-04-12 13:29:59 -0700 | [diff] [blame] | 292 | auto pendingTransactions = mPendingTransactions.find(listener); |
| 293 | if (pendingTransactions != mPendingTransactions.end() && |
| 294 | pendingTransactions->second.count(transactionStats.callbackIds) != 0) { |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 295 | break; |
| 296 | } |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 297 | |
| 298 | // If the transaction has been latched |
| 299 | if (transactionStats.latchTime >= 0) { |
Valerie Hau | 63258a1 | 2018-12-14 14:31:48 -0800 | [diff] [blame] | 300 | if (!mPresentFence) { |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 301 | break; |
| 302 | } |
Valerie Hau | 63258a1 | 2018-12-14 14:31:48 -0800 | [diff] [blame] | 303 | transactionStats.presentFence = mPresentFence; |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 304 | } |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 305 | |
| 306 | // Remove the transaction from completed to the callback |
| 307 | listenerStats.transactionStats.push_back(std::move(transactionStats)); |
| 308 | transactionStatsItr = transactionStatsDeque.erase(transactionStatsItr); |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 309 | } |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 310 | // If the listener has completed transactions |
| 311 | if (!listenerStats.transactionStats.empty()) { |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 312 | // If the listener is still alive |
Valerie Hau | 5de3ad2 | 2019-08-20 07:47:43 -0700 | [diff] [blame] | 313 | if (listener->isBinderAlive()) { |
| 314 | // Send callback. The listener stored in listenerStats |
| 315 | // comes from the cross-process setTransactionState call to |
| 316 | // SF. This MUST be an ITransactionCompletedListener. We |
| 317 | // keep it as an IBinder due to consistency reasons: if we |
| 318 | // interface_cast at the IPC boundary when reading a Parcel, |
| 319 | // we get pointers that compare unequal in the SF process. |
| 320 | interface_cast<ITransactionCompletedListener>(listenerStats.listener) |
| 321 | ->onTransactionCompleted(listenerStats); |
| 322 | listener->unlinkToDeath(mDeathRecipient); |
Valerie Hau | dfca3ec | 2019-12-17 08:50:33 -0800 | [diff] [blame^] | 323 | if (transactionStatsDeque.empty()) { |
| 324 | completedTransactionsItr = |
| 325 | mCompletedTransactions.erase(completedTransactionsItr); |
| 326 | } else { |
| 327 | completedTransactionsItr++; |
| 328 | } |
| 329 | } else { |
| 330 | completedTransactionsItr = |
| 331 | mCompletedTransactions.erase(completedTransactionsItr); |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 332 | } |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 333 | } else { |
Marissa Wall | d600d57 | 2019-03-26 15:38:50 -0700 | [diff] [blame] | 334 | completedTransactionsItr++; |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 335 | } |
Marissa Wall | caa83f5 | 2019-05-29 13:03:25 -0700 | [diff] [blame] | 336 | |
| 337 | completedListenerStats.push_back(std::move(listenerStats)); |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 338 | } |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 339 | |
| 340 | if (mPresentFence) { |
| 341 | mPresentFence.clear(); |
Marissa Wall | fda30bb | 2018-10-12 11:34:28 -0700 | [diff] [blame] | 342 | } |
Marissa Wall | caa83f5 | 2019-05-29 13:03:25 -0700 | [diff] [blame] | 343 | |
| 344 | // If everyone else has dropped their reference to a layer and its listener is dead, |
| 345 | // we are about to cause the layer to be deleted. If this happens at the wrong time and |
| 346 | // we are holding mMutex, we will cause a deadlock. |
| 347 | // |
| 348 | // The deadlock happens because this thread is holding on to mMutex and when we delete |
| 349 | // the layer, it grabs SF's mStateLock. A different SF binder thread grabs mStateLock, |
| 350 | // then call's TransactionCompletedThread::run() which tries to grab mMutex. |
| 351 | // |
| 352 | // To avoid this deadlock, we need to unlock mMutex when dropping our last reference to |
| 353 | // to the layer. |
| 354 | mMutex.unlock(); |
| 355 | completedListenerStats.clear(); |
| 356 | mMutex.lock(); |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 357 | } |
| 358 | } |
| 359 | |
| 360 | // ----------------------------------------------------------------------- |
| 361 | |
Valerie Hau | 5de3ad2 | 2019-08-20 07:47:43 -0700 | [diff] [blame] | 362 | CallbackHandle::CallbackHandle(const sp<IBinder>& transactionListener, |
Marissa Wall | e2ffb42 | 2018-10-12 11:33:52 -0700 | [diff] [blame] | 363 | const std::vector<CallbackId>& ids, const sp<IBinder>& sc) |
| 364 | : listener(transactionListener), callbackIds(ids), surfaceControl(sc) {} |
| 365 | |
| 366 | } // namespace android |