Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 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 | |
Peter Kalauskas | 365a0f9 | 2020-06-10 11:43:01 -0700 | [diff] [blame] | 17 | #define LOG_TAG "HidlLazyUtils" |
| 18 | |
Elliott Hughes | 8739602 | 2025-02-18 09:40:57 -0500 | [diff] [blame] | 19 | #include <mutex> |
| 20 | |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 21 | #include <hidl/HidlLazyUtils.h> |
| 22 | #include <hidl/HidlTransportSupport.h> |
| 23 | |
| 24 | #include <android-base/logging.h> |
| 25 | |
| 26 | #include <android/hidl/manager/1.2/IClientCallback.h> |
| 27 | #include <android/hidl/manager/1.2/IServiceManager.h> |
| 28 | |
| 29 | namespace android { |
| 30 | namespace hardware { |
| 31 | namespace details { |
| 32 | |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 33 | using ::android::hidl::base::V1_0::IBase; |
| 34 | |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 35 | class ClientCounterCallback : public ::android::hidl::manager::V1_2::IClientCallback { |
Steven Moreland | bd603f7 | 2020-04-06 14:21:55 -0700 | [diff] [blame] | 36 | public: |
| 37 | ClientCounterCallback() {} |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 38 | |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 39 | bool addRegisteredService(const sp<IBase>& service, const std::string& name); |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 40 | |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 41 | bool tryUnregisterLocked(); |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 42 | |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 43 | void reRegisterLocked(); |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 44 | |
Amos Bianchi | fb91863 | 2021-01-20 17:41:02 -0800 | [diff] [blame] | 45 | void setActiveServicesCallback(const std::function<bool(bool)>& activeServicesCallback); |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 46 | |
Steven Moreland | bd603f7 | 2020-04-06 14:21:55 -0700 | [diff] [blame] | 47 | protected: |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 48 | Return<void> onClients(const sp<IBase>& service, bool clients) override; |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 49 | |
Steven Moreland | bd603f7 | 2020-04-06 14:21:55 -0700 | [diff] [blame] | 50 | private: |
| 51 | struct Service { |
| 52 | sp<IBase> service; |
| 53 | std::string name; |
| 54 | bool clients = false; |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 55 | // Used to keep track of unregistered services to allow re-registry |
| 56 | bool registered = true; |
Steven Moreland | bd603f7 | 2020-04-06 14:21:55 -0700 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | /** |
| 60 | * Looks up service that is guaranteed to be registered (service from |
| 61 | * onClients). |
| 62 | */ |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 63 | Service& assertRegisteredServiceLocked(const sp<IBase>& service); |
Steven Moreland | bd603f7 | 2020-04-06 14:21:55 -0700 | [diff] [blame] | 64 | |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 65 | /** |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 66 | * Registers or re-registers services. Returns whether successful. |
| 67 | */ |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 68 | bool registerServiceLocked(const sp<IBase>& service, const std::string& name); |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 69 | |
| 70 | /** |
| 71 | * Unregisters all services that we can. If we can't unregister all, re-register other |
| 72 | * services. |
| 73 | */ |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 74 | void tryShutdownLocked(); |
| 75 | |
| 76 | /** |
| 77 | * For below. |
| 78 | */ |
| 79 | std::mutex mMutex; |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 80 | |
| 81 | /** |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 82 | * Number of services that have been registered. |
| 83 | */ |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 84 | std::vector<Service> mRegisteredServices; |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 85 | |
| 86 | /** |
| 87 | * Callback for reporting the number of services with clients. |
| 88 | */ |
Amos Bianchi | fb91863 | 2021-01-20 17:41:02 -0800 | [diff] [blame] | 89 | std::function<bool(bool)> mActiveServicesCallback; |
| 90 | |
| 91 | /** |
| 92 | * Previous value passed to the active services callback. |
| 93 | */ |
| 94 | std::optional<bool> mPreviousHasClients; |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 95 | }; |
| 96 | |
| 97 | class LazyServiceRegistrarImpl { |
Steven Moreland | bd603f7 | 2020-04-06 14:21:55 -0700 | [diff] [blame] | 98 | public: |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 99 | LazyServiceRegistrarImpl() : mClientCallback(new ClientCounterCallback) {} |
| 100 | |
Peter Kalauskas | 7ce3155 | 2019-01-03 15:15:46 -0800 | [diff] [blame] | 101 | status_t registerService(const sp<::android::hidl::base::V1_0::IBase>& service, |
| 102 | const std::string& name); |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 103 | bool tryUnregister(); |
| 104 | void reRegister(); |
Amos Bianchi | fb91863 | 2021-01-20 17:41:02 -0800 | [diff] [blame] | 105 | void setActiveServicesCallback(const std::function<bool(bool)>& activeServicesCallback); |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 106 | |
Steven Moreland | bd603f7 | 2020-04-06 14:21:55 -0700 | [diff] [blame] | 107 | private: |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 108 | sp<ClientCounterCallback> mClientCallback; |
| 109 | }; |
| 110 | |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 111 | bool ClientCounterCallback::addRegisteredService(const sp<IBase>& service, |
| 112 | const std::string& name) { |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 113 | std::lock_guard<std::mutex> lock(mMutex); |
| 114 | bool success = registerServiceLocked(service, name); |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 115 | |
| 116 | if (success) { |
| 117 | mRegisteredServices.push_back({service, name}); |
| 118 | } |
| 119 | |
| 120 | return success; |
| 121 | } |
| 122 | |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 123 | ClientCounterCallback::Service& ClientCounterCallback::assertRegisteredServiceLocked( |
Steven Moreland | bd603f7 | 2020-04-06 14:21:55 -0700 | [diff] [blame] | 124 | const sp<IBase>& service) { |
| 125 | for (Service& registered : mRegisteredServices) { |
| 126 | if (registered.service != service) continue; |
| 127 | return registered; |
| 128 | } |
| 129 | LOG(FATAL) << "Got callback on service " << getDescriptor(service.get()) |
| 130 | << " which we did not register."; |
| 131 | __builtin_unreachable(); |
| 132 | } |
| 133 | |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 134 | bool ClientCounterCallback::registerServiceLocked(const sp<IBase>& service, |
| 135 | const std::string& name) { |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 136 | auto manager = hardware::defaultServiceManager1_2(); |
| 137 | |
| 138 | const std::string descriptor = getDescriptor(service.get()); |
| 139 | |
| 140 | LOG(INFO) << "Registering HAL: " << descriptor << " with name: " << name; |
| 141 | |
| 142 | status_t res = android::hardware::details::registerAsServiceInternal(service, name); |
| 143 | if (res != android::OK) { |
| 144 | LOG(ERROR) << "Failed to register as service."; |
| 145 | return false; |
| 146 | } |
| 147 | |
| 148 | bool ret = manager->registerClientCallback(getDescriptor(service.get()), name, service, this); |
| 149 | if (!ret) { |
| 150 | LOG(ERROR) << "Failed to add client callback."; |
| 151 | return false; |
| 152 | } |
| 153 | |
| 154 | return true; |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 155 | } |
| 156 | |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 157 | Return<void> ClientCounterCallback::onClients(const sp<::android::hidl::base::V1_0::IBase>& service, |
| 158 | bool clients) { |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 159 | std::lock_guard<std::mutex> lock(mMutex); |
| 160 | Service& registered = assertRegisteredServiceLocked(service); |
Steven Moreland | bd603f7 | 2020-04-06 14:21:55 -0700 | [diff] [blame] | 161 | if (registered.clients == clients) { |
| 162 | LOG(FATAL) << "Process already thought " << getDescriptor(service.get()) << "/" |
| 163 | << registered.name << " had clients: " << registered.clients |
| 164 | << " but hwservicemanager has notified has clients: " << clients; |
| 165 | } |
| 166 | registered.clients = clients; |
| 167 | |
| 168 | size_t numWithClients = 0; |
| 169 | for (const Service& registered : mRegisteredServices) { |
| 170 | if (registered.clients) numWithClients++; |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 171 | } |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 172 | |
Steven Moreland | bd603f7 | 2020-04-06 14:21:55 -0700 | [diff] [blame] | 173 | LOG(INFO) << "Process has " << numWithClients << " (of " << mRegisteredServices.size() |
Steven Moreland | 06d58be | 2019-02-04 14:20:13 -0800 | [diff] [blame] | 174 | << " available) client(s) in use after notification " << getDescriptor(service.get()) |
Steven Moreland | bd603f7 | 2020-04-06 14:21:55 -0700 | [diff] [blame] | 175 | << "/" << registered.name << " has clients: " << clients; |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 176 | |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 177 | bool handledInCallback = false; |
Amos Bianchi | fb91863 | 2021-01-20 17:41:02 -0800 | [diff] [blame] | 178 | if (mActiveServicesCallback != nullptr) { |
| 179 | bool hasClients = numWithClients != 0; |
| 180 | if (hasClients != mPreviousHasClients) { |
| 181 | handledInCallback = mActiveServicesCallback(hasClients); |
| 182 | mPreviousHasClients = hasClients; |
| 183 | } |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | // If there is no callback defined or the callback did not handle this |
| 187 | // client count change event, try to shutdown the process if its services |
| 188 | // have no clients. |
| 189 | if (!handledInCallback && numWithClients == 0) { |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 190 | tryShutdownLocked(); |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | return Status::ok(); |
| 194 | } |
| 195 | |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 196 | bool ClientCounterCallback::tryUnregisterLocked() { |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 197 | auto manager = hardware::defaultServiceManager1_2(); |
| 198 | |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 199 | for (Service& entry : mRegisteredServices) { |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 200 | const std::string descriptor = getDescriptor(entry.service.get()); |
| 201 | bool success = manager->tryUnregister(descriptor, entry.name, entry.service); |
| 202 | |
| 203 | if (!success) { |
Steven Moreland | 06d58be | 2019-02-04 14:20:13 -0800 | [diff] [blame] | 204 | LOG(INFO) << "Failed to unregister HAL " << descriptor << "/" << entry.name; |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 205 | return false; |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 206 | } |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 207 | |
| 208 | // Mark the entry unregistered, but do not remove it (may still be re-registered) |
| 209 | entry.registered = false; |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 210 | } |
| 211 | |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 212 | return true; |
| 213 | } |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 214 | |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 215 | void ClientCounterCallback::reRegisterLocked() { |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 216 | for (Service& entry : mRegisteredServices) { |
| 217 | // re-register entry if not already registered |
| 218 | if (entry.registered) { |
| 219 | continue; |
| 220 | } |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 221 | |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 222 | if (!registerServiceLocked(entry.service, entry.name)) { |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 223 | // Must restart. Otherwise, clients will never be able to get ahold of this service. |
| 224 | LOG(FATAL) << "Bad state: could not re-register " << getDescriptor(entry.service.get()); |
| 225 | } |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 226 | |
| 227 | entry.registered = true; |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 228 | } |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 229 | } |
| 230 | |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 231 | void ClientCounterCallback::tryShutdownLocked() { |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 232 | LOG(INFO) << "Trying to exit HAL. No clients in use for any service in process."; |
| 233 | |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 234 | if (tryUnregisterLocked()) { |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 235 | LOG(INFO) << "Unregistered all clients and exiting"; |
| 236 | exit(EXIT_SUCCESS); |
| 237 | } |
| 238 | |
| 239 | // At this point, we failed to unregister some of the services, leaving the |
| 240 | // server in an inconsistent state. Re-register all services that were |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 241 | // unregistered by tryUnregisterLocked(). |
| 242 | reRegisterLocked(); |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 243 | } |
| 244 | |
Amos Bianchi | fb91863 | 2021-01-20 17:41:02 -0800 | [diff] [blame] | 245 | void ClientCounterCallback::setActiveServicesCallback( |
| 246 | const std::function<bool(bool)>& activeServicesCallback) { |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 247 | std::lock_guard<std::mutex> lock(mMutex); |
| 248 | |
Amos Bianchi | fb91863 | 2021-01-20 17:41:02 -0800 | [diff] [blame] | 249 | mActiveServicesCallback = activeServicesCallback; |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 250 | } |
| 251 | |
Peter Kalauskas | 7ce3155 | 2019-01-03 15:15:46 -0800 | [diff] [blame] | 252 | status_t LazyServiceRegistrarImpl::registerService( |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 253 | const sp<::android::hidl::base::V1_0::IBase>& service, const std::string& name) { |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 254 | if (!mClientCallback->addRegisteredService(service, name)) { |
| 255 | return ::android::UNKNOWN_ERROR; |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 256 | } |
Steven Moreland | 40b3ab4 | 2019-01-25 13:23:20 -0800 | [diff] [blame] | 257 | |
| 258 | return ::android::OK; |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 259 | } |
| 260 | |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 261 | bool LazyServiceRegistrarImpl::tryUnregister() { |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 262 | // see comments in header, this should only be called from the active |
| 263 | // services callback, see also b/191781736 |
| 264 | return mClientCallback->tryUnregisterLocked(); |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | void LazyServiceRegistrarImpl::reRegister() { |
Steven Moreland | 3d5b178 | 2021-06-22 18:40:27 +0000 | [diff] [blame] | 268 | // see comments in header, this should only be called from the active |
| 269 | // services callback, see also b/191781736 |
| 270 | mClientCallback->reRegisterLocked(); |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 271 | } |
| 272 | |
Amos Bianchi | fb91863 | 2021-01-20 17:41:02 -0800 | [diff] [blame] | 273 | void LazyServiceRegistrarImpl::setActiveServicesCallback( |
| 274 | const std::function<bool(bool)>& activeServicesCallback) { |
| 275 | mClientCallback->setActiveServicesCallback(activeServicesCallback); |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 276 | } |
| 277 | |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 278 | } // namespace details |
| 279 | |
| 280 | LazyServiceRegistrar::LazyServiceRegistrar() { |
| 281 | mImpl = std::make_shared<details::LazyServiceRegistrarImpl>(); |
| 282 | } |
| 283 | |
Peter Kalauskas | 1e96922 | 2019-08-14 12:13:11 -0700 | [diff] [blame] | 284 | LazyServiceRegistrar& LazyServiceRegistrar::getInstance() { |
| 285 | static auto registrarInstance = new LazyServiceRegistrar(); |
| 286 | return *registrarInstance; |
| 287 | } |
| 288 | |
Peter Kalauskas | 7ce3155 | 2019-01-03 15:15:46 -0800 | [diff] [blame] | 289 | status_t LazyServiceRegistrar::registerService( |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 290 | const sp<::android::hidl::base::V1_0::IBase>& service, const std::string& name) { |
Peter Kalauskas | 7ce3155 | 2019-01-03 15:15:46 -0800 | [diff] [blame] | 291 | return mImpl->registerService(service, name); |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 292 | } |
| 293 | |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 294 | bool LazyServiceRegistrar::tryUnregister() { |
| 295 | return mImpl->tryUnregister(); |
| 296 | } |
| 297 | |
| 298 | void LazyServiceRegistrar::reRegister() { |
| 299 | mImpl->reRegister(); |
| 300 | } |
| 301 | |
Amos Bianchi | fb91863 | 2021-01-20 17:41:02 -0800 | [diff] [blame] | 302 | void LazyServiceRegistrar::setActiveServicesCallback( |
| 303 | const std::function<bool(bool)>& activeServicesCallback) { |
| 304 | mImpl->setActiveServicesCallback(activeServicesCallback); |
Amos Bianchi | 57341bb | 2020-12-23 11:11:37 -0800 | [diff] [blame] | 305 | } |
| 306 | |
Peter Kalauskas | 3373cd3 | 2018-10-24 15:37:00 -0700 | [diff] [blame] | 307 | } // namespace hardware |
| 308 | } // namespace android |