From a6a16c161c69c4b61b94807688d95c04ec4bc1fe Mon Sep 17 00:00:00 2001 From: Devendra Singhi Date: Wed, 3 Aug 2022 10:34:07 +0530 Subject: Added export_include_dirs in libfakeservicemanager Test: m libfakeservicemanager Bug: 230737204 Change-Id: I77f9a8f7b1a5e8bc5743edf048f4bdcceb02cc59 --- libs/fakeservicemanager/Android.bp | 2 + libs/fakeservicemanager/ServiceManager.h | 69 ---------------------- .../include/fakeservicemanager/ServiceManager.h | 69 ++++++++++++++++++++++ 3 files changed, 71 insertions(+), 69 deletions(-) delete mode 100644 libs/fakeservicemanager/ServiceManager.h create mode 100644 libs/fakeservicemanager/include/fakeservicemanager/ServiceManager.h diff --git a/libs/fakeservicemanager/Android.bp b/libs/fakeservicemanager/Android.bp index 47c0657bbd..29924ff500 100644 --- a/libs/fakeservicemanager/Android.bp +++ b/libs/fakeservicemanager/Android.bp @@ -28,6 +28,7 @@ cc_defaults { cc_library { name: "libfakeservicemanager", defaults: ["fakeservicemanager_defaults"], + export_include_dirs: ["include/fakeservicemanager"], } cc_test_host { @@ -37,4 +38,5 @@ cc_test_host { "test_sm.cpp", ], static_libs: ["libgmock"], + local_include_dirs: ["include/fakeservicemanager"], } diff --git a/libs/fakeservicemanager/ServiceManager.h b/libs/fakeservicemanager/ServiceManager.h deleted file mode 100644 index e0af5d4ba8..0000000000 --- a/libs/fakeservicemanager/ServiceManager.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2020 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include -#include -#include - -namespace android { - -/** - * A local host simple implementation of IServiceManager, that does not - * communicate over binder. -*/ -class ServiceManager : public IServiceManager { -public: - ServiceManager(); - - sp getService( const String16& name) const override; - - sp checkService( const String16& name) const override; - - status_t addService(const String16& name, const sp& service, - bool allowIsolated = false, - int dumpsysFlags = DUMP_FLAG_PRIORITY_DEFAULT) override; - - Vector listServices(int dumpsysFlags = 0) override; - - IBinder* onAsBinder() override; - - sp waitForService(const String16& name) override; - - bool isDeclared(const String16& name) override; - - Vector getDeclaredInstances(const String16& iface) override; - - std::optional updatableViaApex(const String16& name) override; - - std::optional getConnectionInfo(const String16& name) override; - - status_t registerForNotifications(const String16& name, - const sp& callback) override; - - status_t unregisterForNotifications(const String16& name, - const sp& callback) override; - - std::vector getServiceDebugInfo() override; - -private: - std::map> mNameToService; -}; - -} // namespace android diff --git a/libs/fakeservicemanager/include/fakeservicemanager/ServiceManager.h b/libs/fakeservicemanager/include/fakeservicemanager/ServiceManager.h new file mode 100644 index 0000000000..e0af5d4ba8 --- /dev/null +++ b/libs/fakeservicemanager/include/fakeservicemanager/ServiceManager.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2020 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include +#include +#include + +namespace android { + +/** + * A local host simple implementation of IServiceManager, that does not + * communicate over binder. +*/ +class ServiceManager : public IServiceManager { +public: + ServiceManager(); + + sp getService( const String16& name) const override; + + sp checkService( const String16& name) const override; + + status_t addService(const String16& name, const sp& service, + bool allowIsolated = false, + int dumpsysFlags = DUMP_FLAG_PRIORITY_DEFAULT) override; + + Vector listServices(int dumpsysFlags = 0) override; + + IBinder* onAsBinder() override; + + sp waitForService(const String16& name) override; + + bool isDeclared(const String16& name) override; + + Vector getDeclaredInstances(const String16& iface) override; + + std::optional updatableViaApex(const String16& name) override; + + std::optional getConnectionInfo(const String16& name) override; + + status_t registerForNotifications(const String16& name, + const sp& callback) override; + + status_t unregisterForNotifications(const String16& name, + const sp& callback) override; + + std::vector getServiceDebugInfo() override; + +private: + std::map> mNameToService; +}; + +} // namespace android -- cgit v1.2.3-59-g8ed1b