From 7aa755edc0f3c433f4bcb19a5ab0653742a8aad7 Mon Sep 17 00:00:00 2001 From: zhangqiang Date: Thu, 6 Apr 2023 21:19:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?IssueNo:=20state=5Fregistry=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E4=BE=9D=E8=B5=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: state_registry部件间依赖解耦,清理不合理依赖 Sig: SIG_Telephony Feature or Bugfix: Feature Binary Source: No Signed-off-by: zhangqiang Change-Id: I6eb0b8c28f667c673c5faaa9df2d77e5fd3259ef --- BUILD.gn | 28 ++++++++----------- bundle.json | 3 +- frameworks/js/napi/BUILD.gn | 21 ++++---------- .../js/napi/src/event_listener_handler.cpp | 1 - frameworks/native/observer/BUILD.gn | 19 ++++--------- test/unittest/state_test/BUILD.gn | 13 +++------ 6 files changed, 28 insertions(+), 57 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 30e541c..838da81 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -10,38 +10,32 @@ # 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. - -import("//base/telephony/core_service/telephony.gni") import("//build/ohos.gni") -SOURCE_DIR = "//base/telephony/state_registry" -CORE_DIR = "//base/telephony/core_service" ohos_shared_library("tel_state_registry") { part_name = "state_registry" subsystem_name = "telephony" sources = [ - "$SOURCE_DIR/frameworks/native/observer/src/telephony_observer_proxy.cpp", - "$SOURCE_DIR/services/src/telephony_state_registry_dump_helper.cpp", - "$SOURCE_DIR/services/src/telephony_state_registry_record.cpp", - "$SOURCE_DIR/services/src/telephony_state_registry_service.cpp", - "$SOURCE_DIR/services/src/telephony_state_registry_stub.cpp", + "frameworks/native/observer/src/telephony_observer_proxy.cpp", + "services/src/telephony_state_registry_dump_helper.cpp", + "services/src/telephony_state_registry_record.cpp", + "services/src/telephony_state_registry_service.cpp", + "services/src/telephony_state_registry_stub.cpp", ] include_dirs = [ - "$SOURCE_DIR/frameworks/native/observer/include", - "$SOURCE_DIR/frameworks/native/common/include", - "$SOURCE_DIR/services/include", + "frameworks/native/observer/include", + "frameworks/native/common/include", + "services/include", ] - configs = [ "//base/telephony/core_service/utils:telephony_log_config" ] - - deps = [ "$CORE_DIR/utils:libtel_common" ] - external_deps = [ "ability_base:want", + "c_utils:utils", "call_manager:tel_call_manager_api", "common_event_service:cesfwk_innerkits", + "core_service:libtel_common", "core_service:tel_core_service_api", "hiviewdfx_hilog_native:libhilog", "init:libbegetutil", @@ -50,7 +44,7 @@ ohos_shared_library("tel_state_registry") { "samgr:samgr_proxy", ] - defines += [ + defines = [ "TELEPHONY_LOG_TAG = \"StateRegistry\"", "LOG_DOMAIN = 0xD001F07", ] diff --git a/bundle.json b/bundle.json index dc5a64d..934b140 100755 --- a/bundle.json +++ b/bundle.json @@ -1,6 +1,6 @@ { "name": "@ohos/state_registry", - "version": "3.1.0", + "version": "4.0", "description": "telephony state_registry service", "publishAs": "code-segment", "homePage": "https://gitee.com/openharmony", @@ -32,6 +32,7 @@ "components": [ "ability_base", "c_utils", + "call_manager", "common_event_service", "core_service", "eventhandler", diff --git a/frameworks/js/napi/BUILD.gn b/frameworks/js/napi/BUILD.gn index a7041c4..106e49f 100644 --- a/frameworks/js/napi/BUILD.gn +++ b/frameworks/js/napi/BUILD.gn @@ -10,47 +10,38 @@ # 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. -import("//base/telephony/core_service/telephony.gni") import("//build/ohos.gni") -SUBSYSTEM_DIR = "//base/telephony" +SUBSYSTEM_DIR = "../../../.." ohos_shared_library("observer") { include_dirs = [ "//third_party/node/src", "include", "$SUBSYSTEM_DIR/state_registry/frameworks/native/observer/include", - "$SUBSYSTEM_DIR/core_service/frameworks/js/sim/include", - "$SUBSYSTEM_DIR/core_service/frameworks/js/network_search/include", - "$SUBSYSTEM_DIR/core_service/frameworks/js/napi", - "$SUBSYSTEM_DIR/call_manager/interfaces/innerkits", - "//third_party/libuv/include", ] sources = [ - "$SUBSYSTEM_DIR/core_service/frameworks/js/napi/napi_util.cpp", "src/event_listener_handler.cpp", "src/event_listener_manager.cpp", "src/napi_state_registry.cpp", "src/napi_telephony_observer.cpp", ] - configs = [ "//base/telephony/core_service/utils:telephony_log_config" ] - - deps = [ - "//foundation/arkui/napi:ace_napi", - "//third_party/libuv:uv", - ] + deps = [ "//third_party/libuv:uv" ] external_deps = [ "c_utils:utils", + "call_manager:tel_call_manager_api", + "core_service:libtel_common", "core_service:tel_core_service_api", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "init:libbegetutil", "ipc:ipc_core", + "napi:ace_napi", "state_registry:tel_state_registry_api", ] - defines += [ + defines = [ "TELEPHONY_LOG_TAG = \"StateRegistryJsApi\"", "LOG_DOMAIN = 0xD001F07", ] diff --git a/frameworks/js/napi/src/event_listener_handler.cpp b/frameworks/js/napi/src/event_listener_handler.cpp index 3540ea2..3e4c278 100644 --- a/frameworks/js/napi/src/event_listener_handler.cpp +++ b/frameworks/js/napi/src/event_listener_handler.cpp @@ -22,7 +22,6 @@ #include "inner_event.h" #include "napi_parameter_util.h" #include "napi_radio_types.h" -#include "napi_sim_type.h" #include "napi_state_registry.h" #include "napi_telephony_observer.h" #include "napi_util.h" diff --git a/frameworks/native/observer/BUILD.gn b/frameworks/native/observer/BUILD.gn index f6387e5..005b27f 100644 --- a/frameworks/native/observer/BUILD.gn +++ b/frameworks/native/observer/BUILD.gn @@ -11,8 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") -SUBSYSTEM_DIR = "//base/telephony/state_registry" -CORE_DIR = "//base/telephony/core_service" +SUBSYSTEM_DIR = "../../.." config("state_registry_observer_config") { include_dirs = [ @@ -23,28 +22,20 @@ config("state_registry_observer_config") { ohos_shared_library("tel_state_registry_api") { sources = [ - "$CORE_DIR/frameworks/native/src/cell_information.cpp", - "$CORE_DIR/frameworks/native/src/network_state.cpp", - "$CORE_DIR/frameworks/native/src/signal_information.cpp", - "$CORE_DIR/frameworks/native/src/telephony_state_registry_proxy.cpp", "$SUBSYSTEM_DIR/frameworks/native/observer/src/telephony_observer.cpp", "$SUBSYSTEM_DIR/frameworks/native/observer/src/telephony_observer_client.cpp", "$SUBSYSTEM_DIR/frameworks/native/observer/src/telephony_observer_proxy.cpp", "$SUBSYSTEM_DIR/frameworks/native/observer/src/telephony_state_manager.cpp", ] - include_dirs = [ - "$SUBSYSTEM_DIR/frameworks/native/observer/include", - "$CORE_DIR/interfaces/innerkits/include", - ] - - configs = [ "//base/telephony/core_service/utils:telephony_log_config" ] + include_dirs = [ "$SUBSYSTEM_DIR/frameworks/native/observer/include" ] public_configs = [ ":state_registry_observer_config" ] - deps = [ "$CORE_DIR/utils:libtel_common" ] - external_deps = [ + "c_utils:utils", + "core_service:libtel_common", + "core_service:tel_core_service_api", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", "samgr:samgr_proxy", diff --git a/test/unittest/state_test/BUILD.gn b/test/unittest/state_test/BUILD.gn index d270475..337296f 100644 --- a/test/unittest/state_test/BUILD.gn +++ b/test/unittest/state_test/BUILD.gn @@ -12,7 +12,7 @@ # limitations under the License. import("//build/test.gni") -SOURCE_DIR = "//base/telephony/state_registry" +SOURCE_DIR = "../../.." ohos_unittest("tel_state_registry_test") { part_name = "state_registry" @@ -20,11 +20,7 @@ ohos_unittest("tel_state_registry_test") { test_module = "tel_state_registry_test" module_out_path = part_name + "/" + test_module - sources = [ - "$SOURCE_DIR/test/unittest/state_test/state_registry_test.cpp", - "//base/telephony/core_service/frameworks/native/src/telephony_state_registry_client.cpp", - "//base/telephony/core_service/frameworks/native/src/telephony_state_registry_proxy.cpp", - ] + sources = [ "$SOURCE_DIR/test/unittest/state_test/state_registry_test.cpp" ] include_dirs = [ "$SOURCE_DIR/interfaces/innerkits/notify", @@ -33,15 +29,14 @@ ohos_unittest("tel_state_registry_test") { "$SOURCE_DIR/services/include", ] - configs = [ "//base/telephony/core_service/utils:telephony_log_config" ] - - deps = [ "//base/telephony/state_registry/frameworks/native/observer:tel_state_registry_api" ] + deps = [ "$SOURCE_DIR/frameworks/native/observer:tel_state_registry_api" ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", + "core_service:libtel_common", "core_service:tel_core_service_api", "init:libbegetutil", "ipc:ipc_core", -- Gitee From f4fb9f26a61cb96318de1f600b95d80a37ac2a38 Mon Sep 17 00:00:00 2001 From: zhangqiang Date: Thu, 6 Apr 2023 21:19:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?IssueNo:=20state=5Fregistry=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E4=BE=9D=E8=B5=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: state_registry部件间依赖解耦,清理不合理依赖 Sig: SIG_Telephony Feature or Bugfix: Feature Binary Source: No Signed-off-by: zhangqiang Change-Id: I6eb0b8c28f667c673c5faaa9df2d77e5fd3259ef --- BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILD.gn b/BUILD.gn index 838da81..48a36aa 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -10,6 +10,7 @@ # 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. + import("//build/ohos.gni") ohos_shared_library("tel_state_registry") { -- Gitee