diff --git a/frameworks/native/appkit/BUILD.gn b/frameworks/native/appkit/BUILD.gn index cc0227d2feb3217aad08944d7a2786747cca7d8b..7ccd7a772d77735b41ffcc4c28bb1af5c1c7d888 100644 --- a/frameworks/native/appkit/BUILD.gn +++ b/frameworks/native/appkit/BUILD.gn @@ -328,7 +328,10 @@ ohos_shared_library("app_context") { configs = [ ":appkit_config" ] - public_configs = [ ":appkit_public_config" ] + public_configs = [ + ":appkit_public_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", + ] sources = [ "${ability_runtime_native_path}/appkit/ability_runtime/context/ability_lifecycle_callback.cpp", diff --git a/interfaces/inner_api/ability_manager/BUILD.gn b/interfaces/inner_api/ability_manager/BUILD.gn index 8bb1055efa0185b2c06da59016a9a25776c4c803..d627dcb9969c8a29d8a65d294099b7c3e3eefecc 100644 --- a/interfaces/inner_api/ability_manager/BUILD.gn +++ b/interfaces/inner_api/ability_manager/BUILD.gn @@ -11,9 +11,30 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build/config/components/idl_tool/idl.gni") import("//build/ohos.gni") import("//foundation/ability/ability_runtime/ability_runtime.gni") +idl_gen_interface("ability_manager_interface") { + sources = [ + "idl/IStatusBarDelegate.idl", + ] + sources_callback = [ + ] + sources_common =[ + ] + log_domainid = "0xD001336" + log_tag = "AbilityMgr" + subsystem_name = "ability" + part_name = "ability_runtime" +} + +config("ability_manager_idl_config") { + include_dirs = [ + "${target_gen_dir}", + ] +} + config("ability_manager_public_config") { visibility = [ ":*" ] visibility += [ @@ -40,6 +61,7 @@ config("ability_manager_public_config") { "${ability_runtime_path}/interfaces/kits/native/appkit/dfr", "${ability_runtime_path}/interfaces/kits/native/appkit", "${ability_runtime_innerkits_path}/dataobs_manager/include", + "${target_gen_dir}", ] defines = [] @@ -61,8 +83,172 @@ config("ability_manager_public_config") { cflags += [ "-DBINDER_IPC_32BIT" ] } } +ohos_source_set("ability_manager_proxy") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + + output_values = get_target_outputs(":ability_manager_interface") + source_values = [ + "*status_bar_delegate_proxy.cpp", + ] + sources = filter_include(output_values, source_values) + + public_configs = [ + ":ability_manager_idl_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + public_deps = [ ":ability_connect_callback_stub" ] + + deps = [ + ":ability_manager_interface", + ":ability_start_options", + ":ability_start_setting", + ":mission_info", + ":process_options", + ":start_window_option", + "${ability_runtime_innerkits_path}/app_manager:app_manager", + "${ability_runtime_path}/utils/global/freeze:freeze_util", + "${ability_runtime_services_path}/abilitymgr:wantagent_manager", + ] + + external_deps = [ + "bundle_framework:libappexecfwk_common", + "c_utils:utils", + "common_event_service:cesfwk_innerkits", + "eventhandler:libeventhandler", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "ipc:ipc_napi", + "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "samgr:samgr_proxy", + ] + + if (host_cpu != "arm64") { + external_deps += [ "relational_store:native_rdb" ] + } + + public_external_deps = [ + "ability_base:base", + "ability_base:configuration", + "ability_base:session_info", + "ability_base:want", + "ability_base:zuri", + "background_task_mgr:bgtaskmgr_innerkits", + "bundle_framework:appexecfwk_base", + "bundle_framework:appexecfwk_core", + "init:libbegetutil", + "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "relational_store:native_rdb", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "ability_base:session_info", + "image_framework:image_native", + "window_manager:libwsutils", + "window_manager:session_manager_lite", + ] + public_external_deps += [ "graphic_2d:color_manager" ] + } + subsystem_name = "ability" + part_name = "ability_runtime" +} + +ohos_source_set("ability_manager_stub") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } + + output_values = get_target_outputs(":ability_manager_interface") + source_values = [ + "*status_bar_delegate_stub.cpp", + ] + sources = filter_include(output_values, source_values) + + public_configs = [ + ":ability_manager_idl_config", + "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ] + + public_deps = [ ":ability_connect_callback_stub" ] + + deps = [ + ":ability_manager_interface", + ":ability_start_options", + ":ability_start_setting", + ":mission_info", + ":process_options", + ":start_window_option", + "${ability_runtime_innerkits_path}/app_manager:app_manager", + "${ability_runtime_path}/utils/global/freeze:freeze_util", + "${ability_runtime_services_path}/abilitymgr:wantagent_manager", + ] + + external_deps = [ + "bundle_framework:libappexecfwk_common", + "c_utils:utils", + "common_event_service:cesfwk_innerkits", + "eventhandler:libeventhandler", + "hilog:libhilog", + "hisysevent:libhisysevent", + "hitrace:hitrace_meter", + "ipc:ipc_core", + "ipc:ipc_napi", + "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "samgr:samgr_proxy", + ] + + if (host_cpu != "arm64") { + external_deps += [ "relational_store:native_rdb" ] + } + + public_external_deps = [ + "ability_base:base", + "ability_base:configuration", + "ability_base:session_info", + "ability_base:want", + "ability_base:zuri", + "background_task_mgr:bgtaskmgr_innerkits", + "bundle_framework:appexecfwk_base", + "bundle_framework:appexecfwk_core", + "init:libbegetutil", + "jsoncpp:jsoncpp", + "relational_store:native_dataability", + "relational_store:native_rdb", + ] + + if (ability_runtime_graphics) { + deps += [] + external_deps += [ + "ability_base:session_info", + "image_framework:image_native", + "window_manager:libwsutils", + "window_manager:session_manager_lite", + ] + public_external_deps += [ "graphic_2d:color_manager" ] + } + subsystem_name = "ability" + part_name = "ability_runtime" +} ohos_shared_library("ability_manager") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } use_exceptions = true branch_protector_ret = "pac_ret" @@ -113,8 +299,6 @@ ohos_shared_library("ability_manager") { "src/aa_tools/ability_start_with_wait_observer_stub.cpp", "src/hidden_start_observer_proxy.cpp", "src/hidden_start_observer_stub.cpp", - "src/status_bar_delegate/status_bar_delegate_proxy.cpp", - "src/status_bar_delegate/status_bar_delegate_stub.cpp", "src/window_manager_service_handler_proxy.cpp", "src/window_manager_service_handler_stub.cpp", ] @@ -130,11 +314,14 @@ ohos_shared_library("ability_manager") { public_configs = [ ":ability_manager_public_config", "${ability_runtime_services_path}/abilitymgr:abilityms_config", + ":ability_manager_idl_config", ] public_deps = [ ":ability_connect_callback_stub" ] deps = [ + ":ability_manager_stub", + ":ability_manager_proxy", ":ability_start_options", ":ability_start_setting", ":mission_info", diff --git a/interfaces/inner_api/ability_manager/idl/IStatusBarDelegate.idl b/interfaces/inner_api/ability_manager/idl/IStatusBarDelegate.idl new file mode 100644 index 0000000000000000000000000000000000000000..f635976bb24cbc07b0b89c2a8ef3e324629c202f --- /dev/null +++ b/interfaces/inner_api/ability_manager/idl/IStatusBarDelegate.idl @@ -0,0 +1,10 @@ +interface OHOS.AbilityRuntime.IStatusBarDelegate { + void CheckIfStatusBarItemExists([in] unsigned int accessTokenId, + [in] String instanceKey, [out] boolean isExist); + + void AttachPidToStatusBarItem([in] unsigned int accessTokenId, + [in] int pid, [in] String instanceKey); + + void DetachPidToStatusBarItem([in] unsigned int accessTokenId, + [in] int pid, [in] String instanceKey); +} diff --git a/interfaces/inner_api/ability_manager/idl/IWantReceiver.idl b/interfaces/inner_api/ability_manager/idl/IWantReceiver.idl new file mode 100644 index 0000000000000000000000000000000000000000..eaa3b9cde3da3d05b6216911a1bb4f555f237ebc --- /dev/null +++ b/interfaces/inner_api/ability_manager/idl/IWantReceiver.idl @@ -0,0 +1,13 @@ +sequenceable want..OHOS.AAFwk.Want; +sequenceable want..OHOS.AAFwk.WantParams; +interface OHOS.AAFwk.IWantReceiver { + void Send([in] int resultCode); + + void PerformReceive([in] Want want, + [in] int resultCode, + [in] String data, + [in] WantParams extras, + [in] boolean serialized, + [in] boolean sticky, + [in] int sendingUser); +} diff --git a/interfaces/inner_api/ability_manager/idl/IWantSender.idl b/interfaces/inner_api/ability_manager/idl/IWantSender.idl new file mode 100644 index 0000000000000000000000000000000000000000..46160552b95d6db9a9cb3370fb0ab7c8f8c70e0f --- /dev/null +++ b/interfaces/inner_api/ability_manager/idl/IWantSender.idl @@ -0,0 +1,5 @@ + +sequenceable OHOS.AAFwk.SenderInfo; +interface OHOS.AAFwk.IWantSender { + void Send([in] SenderInfo resultCode); +} diff --git a/interfaces/inner_api/ability_manager/include/status_bar_delegate/status_bar_delegate_interface.h b/interfaces/inner_api/ability_manager/include/status_bar_delegate/status_bar_delegate_interface.h deleted file mode 100644 index 45f5a4a4905c8f274ab08e70c2d47cb7d0c5ca0e..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/ability_manager/include/status_bar_delegate/status_bar_delegate_interface.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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. - */ - -#ifndef OHOS_ABILITY_RUNTIME_STATUS_BAR_DELEGATE_INTERFACE_H -#define OHOS_ABILITY_RUNTIME_STATUS_BAR_DELEGATE_INTERFACE_H - -#include "iremote_broker.h" - -namespace OHOS { -namespace AbilityRuntime { -/** - * @class IStatusBarDelegate - */ -class IStatusBarDelegate : public OHOS::IRemoteBroker { -public: - DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ability.StatusBarDelegate"); - - enum class StatusBarDelegateCmd : uint32_t { - CHECK_IF_STATUS_BAR_ITEM_EXISTS = 0, - ATTACH_PID_TO_STATUS_BAR_ITEM, - DETACH_PID_TO_STATUS_BAR_ITEM, - END - }; - - virtual int32_t CheckIfStatusBarItemExists(uint32_t accessTokenId, const std::string &instanceKey, - bool& isExist) = 0; - virtual int32_t AttachPidToStatusBarItem(uint32_t accessTokenId, int32_t pid, const std::string &instanceKey) = 0; - virtual int32_t DetachPidToStatusBarItem(uint32_t accessTokenId, int32_t pid, const std::string &instanceKey) = 0; -}; -} // namespace AbilityRuntime -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_STATUS_BAR_DELEGATE_INTERFACE_H diff --git a/interfaces/inner_api/ability_manager/include/status_bar_delegate/status_bar_delegate_proxy.h b/interfaces/inner_api/ability_manager/include/status_bar_delegate/status_bar_delegate_proxy.h deleted file mode 100644 index bae615d4a1c0d2a14a49de403afefd0253346186..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/ability_manager/include/status_bar_delegate/status_bar_delegate_proxy.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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. - */ - -#ifndef OHOS_ABILITY_RUNTIME_STATUS_BAR_DELEGATE_PROXY_H -#define OHOS_ABILITY_RUNTIME_STATUS_BAR_DELEGATE_PROXY_H - -#include "iremote_proxy.h" -#include "status_bar_delegate_interface.h" - -namespace OHOS { -namespace AbilityRuntime { -class StatusBarDelegateProxy : public IRemoteProxy { -public: - explicit StatusBarDelegateProxy(const sptr &impl); - virtual ~StatusBarDelegateProxy() = default; - - virtual int32_t CheckIfStatusBarItemExists(uint32_t accessTokenId, const std::string &instanceKey, bool& isExist); - virtual int32_t AttachPidToStatusBarItem(uint32_t accessTokenId, int32_t pid, const std::string &instanceKey); - virtual int32_t DetachPidToStatusBarItem(uint32_t accessTokenId, int32_t pid, const std::string &instanceKey); - -private: - int32_t SendRequest(StatusBarDelegateCmd code, MessageParcel &data, MessageParcel &reply, MessageOption &option); - static inline BrokerDelegator delegator_; -}; -} // namespace AbilityRuntime -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_STATUS_BAR_DELEGATE_PROXY_H \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/include/status_bar_delegate/status_bar_delegate_stub.h b/interfaces/inner_api/ability_manager/include/status_bar_delegate/status_bar_delegate_stub.h deleted file mode 100644 index 600f2ce3d311f05156a06dec4024ee089e33f304..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/ability_manager/include/status_bar_delegate/status_bar_delegate_stub.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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. - */ - -#ifndef OHOS_ABILITY_RUNTIME_STATUS_BAR_DELEGATE_STUB_H -#define OHOS_ABILITY_RUNTIME_STATUS_BAR_DELEGATE_STUB_H - -#include - -#include -#include - -#include "nocopyable.h" -#include "status_bar_delegate_interface.h" - -namespace OHOS { -namespace AbilityRuntime { -class StatusBarDelegateStub : public IRemoteStub { -public: - StatusBarDelegateStub(); - virtual ~StatusBarDelegateStub() = default; - - int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override; - -private: - DISALLOW_COPY_AND_MOVE(StatusBarDelegateStub); - - int32_t HandleCheckIfStatusBarItemExists(MessageParcel &data, MessageParcel &reply); - int32_t HandleAttachPidToStatusBarItem(MessageParcel &data, MessageParcel &reply); - int32_t HandleDetachPidToStatusBarItem(MessageParcel &data, MessageParcel &reply); -}; -} // namespace AbilityRuntime -} // namespace OHOS -#endif // OHOS_ABILITY_RUNTIME_AUTO_STARTUP_CALLBACK_STUB_H diff --git a/interfaces/inner_api/ability_manager/src/status_bar_delegate/status_bar_delegate_proxy.cpp b/interfaces/inner_api/ability_manager/src/status_bar_delegate/status_bar_delegate_proxy.cpp deleted file mode 100644 index f5248ac910d9cfabd634eed26d7cbcc296541719..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/ability_manager/src/status_bar_delegate/status_bar_delegate_proxy.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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. - */ - -#include "status_bar_delegate_proxy.h" - -#include "ability_manager_errors.h" -#include "hilog_tag_wrapper.h" -#include "message_parcel.h" - -namespace OHOS { -namespace AbilityRuntime { - -StatusBarDelegateProxy::StatusBarDelegateProxy(const sptr &impl) - : IRemoteProxy(impl) {} - -int32_t StatusBarDelegateProxy::CheckIfStatusBarItemExists(uint32_t accessTokenId, const std::string &instanceKey, - bool& isExist) -{ - TAG_LOGI(AAFwkTag::ABILITYMGR, "call"); - MessageParcel data; - MessageParcel reply; - MessageOption option; - if (!data.WriteInterfaceToken(IStatusBarDelegate::GetDescriptor())) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write token failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - if (!data.WriteUint32(accessTokenId)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "accessTokenId write failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - if (!data.WriteString(instanceKey)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "instanceKey write failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - auto ret = SendRequest(StatusBarDelegateCmd::CHECK_IF_STATUS_BAR_ITEM_EXISTS, data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "Send request error: %{public}d", ret); - return ret; - } - ret = reply.ReadInt32(); - isExist = reply.ReadBool(); - return ret; -} - -int32_t StatusBarDelegateProxy::AttachPidToStatusBarItem(uint32_t accessTokenId, int32_t pid, - const std::string &instanceKey) -{ - TAG_LOGI(AAFwkTag::ABILITYMGR, "call AttachPidToStatusBarItem"); - MessageParcel data; - MessageParcel reply; - MessageOption option; - if (!data.WriteInterfaceToken(IStatusBarDelegate::GetDescriptor())) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write token failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - if (!data.WriteUint32(accessTokenId)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write accessTokenId failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - if (!data.WriteInt32(pid)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write pid failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - if (!data.WriteString(instanceKey)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "instanceKey write failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - auto ret = SendRequest(StatusBarDelegateCmd::ATTACH_PID_TO_STATUS_BAR_ITEM, data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "Send request error: %{public}d", ret); - return ret; - } - return reply.ReadInt32(); -} - -int32_t StatusBarDelegateProxy::DetachPidToStatusBarItem(uint32_t accessTokenId, int32_t pid, - const std::string &instanceKey) -{ - TAG_LOGI(AAFwkTag::ABILITYMGR, "call DetachPidToStatusBarItem"); - MessageParcel data; - MessageParcel reply; - MessageOption option; - if (!data.WriteInterfaceToken(IStatusBarDelegate::GetDescriptor())) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write token failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - if (!data.WriteUint32(accessTokenId)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write accessTokenId failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - if (!data.WriteInt32(pid)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write pid failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - if (!data.WriteString(instanceKey)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "instanceKey write failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - auto ret = SendRequest(StatusBarDelegateCmd::DETACH_PID_TO_STATUS_BAR_ITEM, data, reply, option); - if (ret != NO_ERROR) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "Send request error: %{public}d", ret); - return ret; - } - return reply.ReadInt32(); -} - -int32_t StatusBarDelegateProxy::SendRequest( - StatusBarDelegateCmd code, MessageParcel &data, MessageParcel &reply, MessageOption &option) -{ - sptr remote = Remote(); - if (remote == nullptr) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "null remote"); - return ERR_NULL_OBJECT; - } - return remote->SendRequest(static_cast(code), data, reply, option); -} -} // namespace AbilityRuntime -} // namespace OHOS \ No newline at end of file diff --git a/interfaces/inner_api/ability_manager/src/status_bar_delegate/status_bar_delegate_stub.cpp b/interfaces/inner_api/ability_manager/src/status_bar_delegate/status_bar_delegate_stub.cpp deleted file mode 100644 index d76f320bbb4083fdc5908905ee199dfeccd0f2db..0000000000000000000000000000000000000000 --- a/interfaces/inner_api/ability_manager/src/status_bar_delegate/status_bar_delegate_stub.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2024 Huawei Device Co., Ltd. - * 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. - */ - -#include "status_bar_delegate_stub.h" - -#include "ability_manager_errors.h" -#include "hilog_tag_wrapper.h" -#include "message_parcel.h" - -namespace OHOS { -namespace AbilityRuntime { -StatusBarDelegateStub::StatusBarDelegateStub() {} - -int32_t StatusBarDelegateStub::OnRemoteRequest( - uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) -{ - std::u16string descriptor = StatusBarDelegateStub::GetDescriptor(); - std::u16string remoteDescriptor = data.ReadInterfaceToken(); - if (descriptor != remoteDescriptor) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "invalid descriptor"); - return ERR_INVALID_STATE; - } - - if (code < static_cast(StatusBarDelegateCmd::END)) { - switch (code) { - case static_cast(StatusBarDelegateCmd::CHECK_IF_STATUS_BAR_ITEM_EXISTS): - return HandleCheckIfStatusBarItemExists(data, reply); - case static_cast(StatusBarDelegateCmd::ATTACH_PID_TO_STATUS_BAR_ITEM): - return HandleAttachPidToStatusBarItem(data, reply); - case static_cast(StatusBarDelegateCmd::DETACH_PID_TO_STATUS_BAR_ITEM): - return HandleDetachPidToStatusBarItem(data, reply); - } - } - return IPCObjectStub::OnRemoteRequest(code, data, reply, option); -} - -int32_t StatusBarDelegateStub::HandleCheckIfStatusBarItemExists(MessageParcel &data, MessageParcel &reply) -{ - TAG_LOGI(AAFwkTag::ABILITYMGR, "call"); - uint32_t accessTokenId = data.ReadUint32(); - auto instanceKey = data.ReadString(); - bool isExist = false; - auto result = CheckIfStatusBarItemExists(accessTokenId, instanceKey, isExist); - if (!reply.WriteBool(result)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write result failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - if (!reply.WriteBool(isExist)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write isExist failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - return NO_ERROR; -} - -int32_t StatusBarDelegateStub::HandleAttachPidToStatusBarItem(MessageParcel &data, MessageParcel &reply) -{ - TAG_LOGI(AAFwkTag::ABILITYMGR, "call"); - uint32_t accessTokenId = data.ReadUint32(); - int32_t pid = data.ReadInt32(); - auto instanceKey = data.ReadString(); - auto result = AttachPidToStatusBarItem(accessTokenId, pid, instanceKey); - if (!reply.WriteInt32(result)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write result failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - return NO_ERROR; -} - -int32_t StatusBarDelegateStub::HandleDetachPidToStatusBarItem(MessageParcel &data, MessageParcel &reply) -{ - TAG_LOGI(AAFwkTag::ABILITYMGR, "call HandleDetachPidToStatusBarItem"); - uint32_t accessTokenId = data.ReadUint32(); - int32_t pid = data.ReadInt32(); - auto instanceKey = data.ReadString(); - auto result = DetachPidToStatusBarItem(accessTokenId, pid, instanceKey); - if (!reply.WriteInt32(result)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "write result failed"); - return AAFwk::ERR_NATIVE_IPC_PARCEL_FAILED; - } - return NO_ERROR; -} -} // namespace AbilityRuntime -} // namespace OHOS \ No newline at end of file diff --git a/interfaces/inner_api/app_manager/BUILD.gn b/interfaces/inner_api/app_manager/BUILD.gn index 591df09f20e905c1f071c790fe60879d77935c5f..3654def073e091ea18550dde45a5709f333e49f9 100644 --- a/interfaces/inner_api/app_manager/BUILD.gn +++ b/interfaces/inner_api/app_manager/BUILD.gn @@ -41,6 +41,11 @@ config("appmgr_core_config") { } ohos_shared_library("app_manager") { + sanitize = { + cfi = true + cfi_cross_dso = true + debug = false + } branch_protector_ret = "pac_ret" include_dirs = [ @@ -126,6 +131,7 @@ ohos_shared_library("app_manager") { public_configs = [ ":appmgr_core_config", ":appmgr_sdk_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", ] defines = [ "AMS_LOG_TAG = \"AppexecfwkCore\"" ] diff --git a/interfaces/inner_api/wantagent/BUILD.gn b/interfaces/inner_api/wantagent/BUILD.gn index b1e9d373d3d8c656be1e22591d06408609ceea4b..6428c8a4d58cee910d4a5b591c771a788f3280c1 100644 --- a/interfaces/inner_api/wantagent/BUILD.gn +++ b/interfaces/inner_api/wantagent/BUILD.gn @@ -64,7 +64,10 @@ ohos_shared_library("wantagent_innerkits") { "src/want_agent_info.cpp", ] - public_configs = [ ":wantagent_innerkits_public_config" ] + public_configs = [ + ":wantagent_innerkits_public_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", + ] deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_start_options", diff --git a/services/abilitymgr/BUILD.gn b/services/abilitymgr/BUILD.gn index b0fd3beeac876bf5434115ebc2555215b245e4e8..8654cd86fb696978dbd0c361fbfdef7c927de7fd 100644 --- a/services/abilitymgr/BUILD.gn +++ b/services/abilitymgr/BUILD.gn @@ -121,6 +121,7 @@ ohos_shared_library("abilityms") { configs = [ ":abilityms_config", ":abilityms_exception_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", ] include_dirs = [ "${ability_runtime_services_path}/appdfr/include", diff --git a/services/abilitymgr/include/scene_board/status_bar_delegate_manager.h b/services/abilitymgr/include/scene_board/status_bar_delegate_manager.h index 7fb0c6fb24ae6227e9e2e417cd1ee8f85ef9b210..140f8b98445a4447bf2a03cfe6fec837744a28cb 100644 --- a/services/abilitymgr/include/scene_board/status_bar_delegate_manager.h +++ b/services/abilitymgr/include/scene_board/status_bar_delegate_manager.h @@ -19,7 +19,7 @@ #include "cpp/mutex.h" #include "ability_record.h" -#include "status_bar_delegate_interface.h" +#include "istatus_bar_delegate.h" namespace OHOS { namespace AAFwk { diff --git a/services/abilitymgr/src/ability_manager_client.cpp b/services/abilitymgr/src/ability_manager_client.cpp index 725fe34e76ff658d22d61659dc817a6f6cb839b4..cb9a174ddfd66b033fd0f1e642c7952cfd273662 100644 --- a/services/abilitymgr/src/ability_manager_client.cpp +++ b/services/abilitymgr/src/ability_manager_client.cpp @@ -25,7 +25,7 @@ #include "scene_board_judgement.h" #include "session_manager_lite.h" #endif // SUPPORT_SCREEN -#include "status_bar_delegate_interface.h" +#include "istatus_bar_delegate.h" #include "system_ability_definition.h" namespace OHOS { diff --git a/services/abilitymgr/src/ability_manager_proxy.cpp b/services/abilitymgr/src/ability_manager_proxy.cpp index 0a126a60808d930d560de5bc0a49844ba70aab2e..45b3f276994881443733db99757fb3113fe9780c 100644 --- a/services/abilitymgr/src/ability_manager_proxy.cpp +++ b/services/abilitymgr/src/ability_manager_proxy.cpp @@ -21,7 +21,7 @@ #include "hitrace_meter.h" #include "ipc_capacity_wrap.h" #include "server_constant.h" -#include "status_bar_delegate_interface.h" +#include "istatus_bar_delegate.h" #include "mission_listener_interface.h" #include "mission_snapshot.h" #include "snapshot.h" diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index c5e3ccdc9ba15788d51d76d8e7d446170798a0d8..28988781a1b5d2e42f5947c519131370184671e9 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -86,7 +86,7 @@ #include "start_ability_utils.h" #include "hidden_start_utils.h" #include "startup_util.h" -#include "status_bar_delegate_interface.h" +#include "istatus_bar_delegate.h" #include "string_wrapper.h" #include "ui_extension_utils.h" #include "ui_service_extension_connection_constants.h" diff --git a/services/abilitymgr/src/ability_manager_stub.cpp b/services/abilitymgr/src/ability_manager_stub.cpp index 2e5e177fdacbf766d071b95e053cd36854fe4616..4010336982da93c135755f4bbb2481920dc1d768 100644 --- a/services/abilitymgr/src/ability_manager_stub.cpp +++ b/services/abilitymgr/src/ability_manager_stub.cpp @@ -20,7 +20,7 @@ #include "fd_guard.h" #include "hilog_tag_wrapper.h" #include "hitrace_meter.h" -#include "status_bar_delegate_interface.h" +#include "istatus_bar_delegate.h" #include #include "mission_listener_interface.h" #include "mission_snapshot.h" diff --git a/tools/aa/BUILD.gn b/tools/aa/BUILD.gn index d6ec4e440c24ab088a7c976c62ade9d8402e6b8c..adbc1535afc4fb36a138a0fc24fb0f79a6be9f13 100644 --- a/tools/aa/BUILD.gn +++ b/tools/aa/BUILD.gn @@ -47,6 +47,7 @@ ohos_static_library("tools_aa_source_set") { ":ability_command_exception_config", "${ability_runtime_services_path}/abilitymgr:abilityms_config", "${ability_runtime_services_path}/common:common_config", + "${ability_runtime_innerkits_path}/ability_manager:ability_manager_idl_config", ] cflags = []