From f7a48708043142f0d2f44bb4cca95cd75b8eb0e5 Mon Sep 17 00:00:00 2001 From: zhaoyuan17 Date: Mon, 20 Dec 2021 15:44:55 +0000 Subject: [PATCH] Modify the code format Signed-off-by: zhaoyuan17 --- frameworks/ans/core/src/ans_subscriber_stub.cpp | 1 - .../test/moduletest/mock/mock_bundle_manager.cpp | 1 - .../ans/test/moduletest/mock/mock_event_handler.cpp | 1 - .../innerkits/wantagent/include/cancel_listener.h | 2 +- .../wantagent/include/completed_callback.h | 4 ++-- .../innerkits/wantagent/include/trigger_info.h | 4 ++-- interfaces/innerkits/wantagent/include/want_agent.h | 13 ++++++------- .../innerkits/wantagent/include/want_agent_info.h | 2 +- interfaces/kits/napi/ans/BUILD.gn | 2 ++ interfaces/kits/napi/ans/include/unsubscribe.h | 1 - .../ans/src/notification_preferences_database.cpp | 1 - .../unittest/mock/mock_bundle_manager_helper.cpp | 1 + .../ans/test/unittest/mock/mock_single_kv_store.cpp | 1 - .../test/moduletest/mock/mock_bundle_manager.cpp | 1 - .../moduletest/mock/mock_bundle_manager_helper.cpp | 1 - .../test/moduletest/mock/mock_event_handler.cpp | 1 - .../test/moduletest/mock/mock_single_kv_store.cpp | 1 - tools/dump/src/main.cpp | 1 - 18 files changed, 15 insertions(+), 24 deletions(-) diff --git a/frameworks/ans/core/src/ans_subscriber_stub.cpp b/frameworks/ans/core/src/ans_subscriber_stub.cpp index b2432c4c0..932238a92 100644 --- a/frameworks/ans/core/src/ans_subscriber_stub.cpp +++ b/frameworks/ans/core/src/ans_subscriber_stub.cpp @@ -13,7 +13,6 @@ * limitations under the License. */ - #include "ans_subscriber_stub.h" #include "ans_const_define.h" diff --git a/frameworks/ans/test/moduletest/mock/mock_bundle_manager.cpp b/frameworks/ans/test/moduletest/mock/mock_bundle_manager.cpp index 98fd912f3..4ee0032ef 100644 --- a/frameworks/ans/test/moduletest/mock/mock_bundle_manager.cpp +++ b/frameworks/ans/test/moduletest/mock/mock_bundle_manager.cpp @@ -19,7 +19,6 @@ namespace OHOS { namespace AppExecFwk { - constexpr int SYSTEM_APP_UUID = 1000; void MockBundleMgrService::MockSetIsSystemApp(bool isSystemApp) diff --git a/frameworks/ans/test/moduletest/mock/mock_event_handler.cpp b/frameworks/ans/test/moduletest/mock/mock_event_handler.cpp index bbbeb4907..bdadec57f 100644 --- a/frameworks/ans/test/moduletest/mock/mock_event_handler.cpp +++ b/frameworks/ans/test/moduletest/mock/mock_event_handler.cpp @@ -18,7 +18,6 @@ namespace OHOS { namespace AppExecFwk { - std::shared_ptr EventHandler::Current() { const std::weak_ptr &wp = std::make_shared(EventRunner::Create(true)); diff --git a/interfaces/innerkits/wantagent/include/cancel_listener.h b/interfaces/innerkits/wantagent/include/cancel_listener.h index 10cea7b5f..cb3a24495 100644 --- a/interfaces/innerkits/wantagent/include/cancel_listener.h +++ b/interfaces/innerkits/wantagent/include/cancel_listener.h @@ -18,12 +18,12 @@ namespace OHOS::Notification::WantAgent { class CancelListener { +public: /** * Called when a Cancel operation as completed. * * @param resultCode The final result code determined by the Send. */ -public: virtual void OnCancelled(int resultCode) = 0; virtual ~CancelListener() = default; }; diff --git a/interfaces/innerkits/wantagent/include/completed_callback.h b/interfaces/innerkits/wantagent/include/completed_callback.h index 5b83a2dc4..5657c86b4 100644 --- a/interfaces/innerkits/wantagent/include/completed_callback.h +++ b/interfaces/innerkits/wantagent/include/completed_callback.h @@ -23,6 +23,8 @@ namespace OHOS::Notification::WantAgent { class CompletedCallback { +public: + virtual ~CompletedCallback() = default; /** * Called when a Send operation as completed. * @@ -31,8 +33,6 @@ class CompletedCallback { * @param resultData The final data collected by a broadcast. * @param resultExtras The final extras collected by a broadcast. */ -public: - virtual ~CompletedCallback() = default; virtual void OnSendFinished(const AAFwk::Want &want, int resultCode, const std::string &resultData, const AAFwk::WantParams &resultExtras) = 0; }; diff --git a/interfaces/innerkits/wantagent/include/trigger_info.h b/interfaces/innerkits/wantagent/include/trigger_info.h index ba4cdba4e..a41ba98ec 100644 --- a/interfaces/innerkits/wantagent/include/trigger_info.h +++ b/interfaces/innerkits/wantagent/include/trigger_info.h @@ -23,11 +23,11 @@ namespace OHOS::Notification::WantAgent { class TriggerInfo final : public std::enable_shared_from_this { +public: /** * Default constructor used to create a {@code TriggerInfo} instance. * */ -public: TriggerInfo(); virtual ~TriggerInfo() = default; @@ -100,11 +100,11 @@ public: */ public: class Builder final : public std::enable_shared_from_this { + public: /** * Default constructor used to create a {@code Builder} instance. * */ - public: Builder(); virtual ~Builder() = default; diff --git a/interfaces/innerkits/wantagent/include/want_agent.h b/interfaces/innerkits/wantagent/include/want_agent.h index f9a19087e..3af5ac876 100644 --- a/interfaces/innerkits/wantagent/include/want_agent.h +++ b/interfaces/innerkits/wantagent/include/want_agent.h @@ -28,6 +28,11 @@ class WantAgent final : public std::enable_shared_from_this, public P public: WantAgent() {}; virtual ~WantAgent() = default; + /** + * Constructor. + * + * @param obj The proxy object. + */ explicit WantAgent(const std::shared_ptr &pendingWant); /** @@ -40,7 +45,7 @@ public: /** * Sets proxy obj. * - * @return Return obj. + * @param obj The proxy object. */ void SetPendingWant(const std::shared_ptr &pendingWant); @@ -62,12 +67,6 @@ public: private: std::shared_ptr pendingWant_; - - /** - * Constructor. - * - * @param obj The proxy object. - */ }; } // namespace OHOS::Notification::WantAgent #endif // BASE_NOTIFICATION_ANS_STANDARD_KITS_NATIVE_WANTAGENT_INCLUDE_WANT_AGENT_H \ No newline at end of file diff --git a/interfaces/innerkits/wantagent/include/want_agent_info.h b/interfaces/innerkits/wantagent/include/want_agent_info.h index c363784a1..70315d122 100644 --- a/interfaces/innerkits/wantagent/include/want_agent_info.h +++ b/interfaces/innerkits/wantagent/include/want_agent_info.h @@ -32,11 +32,11 @@ namespace OHOS::Notification::WantAgent { * */ class WantAgentInfo final : public std::enable_shared_from_this { +public: /** * Default constructor used to create an empty WantAgentInfo instance. * */ -public: WantAgentInfo(); virtual ~WantAgentInfo() = default; diff --git a/interfaces/kits/napi/ans/BUILD.gn b/interfaces/kits/napi/ans/BUILD.gn index 2d7176e35..66da3426a 100644 --- a/interfaces/kits/napi/ans/BUILD.gn +++ b/interfaces/kits/napi/ans/BUILD.gn @@ -61,6 +61,8 @@ ohos_shared_library("notification") { "src/unsubscribe.cpp", ] + ldflags = [ "-Wl,-rpath=/system/lib/module/multimedia/" ] + deps = [ "${frameworks_path}/ans/core:ans_core", "${frameworks_path}/ans/native:ans_innerkits", diff --git a/interfaces/kits/napi/ans/include/unsubscribe.h b/interfaces/kits/napi/ans/include/unsubscribe.h index 2751b461b..670b257ae 100644 --- a/interfaces/kits/napi/ans/include/unsubscribe.h +++ b/interfaces/kits/napi/ans/include/unsubscribe.h @@ -22,7 +22,6 @@ namespace OHOS { namespace NotificationNapi { using namespace OHOS::Notification; napi_value Unsubscribe(napi_env env, napi_callback_info info); - } // namespace NotificationNapi } // namespace OHOS diff --git a/services/ans/src/notification_preferences_database.cpp b/services/ans/src/notification_preferences_database.cpp index 54c5a1e54..809f7f71a 100644 --- a/services/ans/src/notification_preferences_database.cpp +++ b/services/ans/src/notification_preferences_database.cpp @@ -14,7 +14,6 @@ */ #include "notification_preferences_database.h" - #include "ans_log_wrapper.h" #include "uri.h" diff --git a/services/ans/test/unittest/mock/mock_bundle_manager_helper.cpp b/services/ans/test/unittest/mock/mock_bundle_manager_helper.cpp index 0d454850b..f124d5004 100644 --- a/services/ans/test/unittest/mock/mock_bundle_manager_helper.cpp +++ b/services/ans/test/unittest/mock/mock_bundle_manager_helper.cpp @@ -45,6 +45,7 @@ bool BundleManagerHelper::IsSystemApp(int uid) { return (uid == SYSTEM_APP_UID); } + void BundleManagerHelper::Connect() {} diff --git a/services/ans/test/unittest/mock/mock_single_kv_store.cpp b/services/ans/test/unittest/mock/mock_single_kv_store.cpp index bc79b1906..e246e8d99 100644 --- a/services/ans/test/unittest/mock/mock_single_kv_store.cpp +++ b/services/ans/test/unittest/mock/mock_single_kv_store.cpp @@ -18,7 +18,6 @@ namespace OHOS { namespace DistributedKv { - Status AnsTestSingleKvStore::GetEntries(const Key &prefixKey, std::vector &entries) const { return Status::SUCCESS; diff --git a/services/test/moduletest/mock/mock_bundle_manager.cpp b/services/test/moduletest/mock/mock_bundle_manager.cpp index 98d2bcac2..cdb047ece 100644 --- a/services/test/moduletest/mock/mock_bundle_manager.cpp +++ b/services/test/moduletest/mock/mock_bundle_manager.cpp @@ -19,7 +19,6 @@ namespace OHOS { namespace AppExecFwk { - constexpr int SYSTEMAPP_UUID = 1000; void MockBundleMgrService::MockSetIsSystemApp(bool isSystemApp) diff --git a/services/test/moduletest/mock/mock_bundle_manager_helper.cpp b/services/test/moduletest/mock/mock_bundle_manager_helper.cpp index 5fef8d274..70406de1d 100644 --- a/services/test/moduletest/mock/mock_bundle_manager_helper.cpp +++ b/services/test/moduletest/mock/mock_bundle_manager_helper.cpp @@ -45,6 +45,5 @@ void BundleManagerHelper::Connect() void BundleManagerHelper::Disconnect() {} - } // namespace Notification } // namespace OHOS \ No newline at end of file diff --git a/services/test/moduletest/mock/mock_event_handler.cpp b/services/test/moduletest/mock/mock_event_handler.cpp index bbbeb4907..bdadec57f 100644 --- a/services/test/moduletest/mock/mock_event_handler.cpp +++ b/services/test/moduletest/mock/mock_event_handler.cpp @@ -18,7 +18,6 @@ namespace OHOS { namespace AppExecFwk { - std::shared_ptr EventHandler::Current() { const std::weak_ptr &wp = std::make_shared(EventRunner::Create(true)); diff --git a/services/test/moduletest/mock/mock_single_kv_store.cpp b/services/test/moduletest/mock/mock_single_kv_store.cpp index bc79b1906..e246e8d99 100644 --- a/services/test/moduletest/mock/mock_single_kv_store.cpp +++ b/services/test/moduletest/mock/mock_single_kv_store.cpp @@ -18,7 +18,6 @@ namespace OHOS { namespace DistributedKv { - Status AnsTestSingleKvStore::GetEntries(const Key &prefixKey, std::vector &entries) const { return Status::SUCCESS; diff --git a/tools/dump/src/main.cpp b/tools/dump/src/main.cpp index b9557ac51..b5ea1058d 100644 --- a/tools/dump/src/main.cpp +++ b/tools/dump/src/main.cpp @@ -13,7 +13,6 @@ * limitations under the License. */ - #include "notification_shell_command.h" int main(int argc, char *argv[]) -- Gitee