From 2ef2e0ce934ac6831cf7522a65fc16def1609658 Mon Sep 17 00:00:00 2001 From: Zhaoyuan Date: Fri, 16 Jul 2021 10:45:12 +0800 Subject: [PATCH 1/2] move kernel include and fix bugs --- frameworks/ability_lite/BUILD.gn | 2 -- frameworks/ability_lite/example/BUILD.gn | 2 -- frameworks/abilitymgr_lite/BUILD.gn | 2 -- frameworks/abilitymgr_lite/include/abilityms_slite_client.h | 2 ++ .../abilitymgr_lite/src/slite/ability_manager_inner.cpp | 4 ++-- frameworks/want_lite/BUILD.gn | 2 -- services/abilitymgr_lite/BUILD.gn | 2 -- services/abilitymgr_lite/src/ability_mgr_service.cpp | 2 +- services/abilitymgr_lite/src/ability_service.cpp | 4 ++-- services/abilitymgr_lite/tools/BUILD.gn | 2 -- .../unittest/test_lv0/page_ability_test/BUILD.gn | 2 -- 11 files changed, 7 insertions(+), 19 deletions(-) diff --git a/frameworks/ability_lite/BUILD.gn b/frameworks/ability_lite/BUILD.gn index 85b1a61..c57d378 100755 --- a/frameworks/ability_lite/BUILD.gn +++ b/frameworks/ability_lite/BUILD.gn @@ -79,8 +79,6 @@ lite_library("ability") { "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", "//foundation/communication/ipc_lite/frameworks/liteipc/include", - "//kernel/liteos_a/kernel/include", - "//kernel/liteos_a/kernel/common", "//third_party/bounds_checking_function/include", "//third_party/freetype/include", "//utils/native/lite/kv_store/innerkits", diff --git a/frameworks/ability_lite/example/BUILD.gn b/frameworks/ability_lite/example/BUILD.gn index 5005a7e..d568217 100644 --- a/frameworks/ability_lite/example/BUILD.gn +++ b/frameworks/ability_lite/example/BUILD.gn @@ -47,8 +47,6 @@ lite_library("hiability") { "//foundation/graphic/utils/interfaces/innerkits", "//foundation/graphic/ui/interfaces/kits", "//foundation/graphic/utils/interfaces/kits/gfx_utils", - "//kernel/liteos_a/kernel/common", - "//kernel/liteos_a/kernel/include", ] deps = [ diff --git a/frameworks/abilitymgr_lite/BUILD.gn b/frameworks/abilitymgr_lite/BUILD.gn index e6f6180..e66514c 100755 --- a/frameworks/abilitymgr_lite/BUILD.gn +++ b/frameworks/abilitymgr_lite/BUILD.gn @@ -41,8 +41,6 @@ lite_library("abilitymanager") { "${appexecfwk_lite_path}/frameworks/bundle_lite/include", "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//kernel/liteos_a/kernel/include", - "//kernel/liteos_a/kernel/common", "//third_party/bounds_checking_function/include", "//utils/native/lite/kv_store/innerkits", "//utils/native/lite/include", diff --git a/frameworks/abilitymgr_lite/include/abilityms_slite_client.h b/frameworks/abilitymgr_lite/include/abilityms_slite_client.h index 21e71ed..a87d3d3 100755 --- a/frameworks/abilitymgr_lite/include/abilityms_slite_client.h +++ b/frameworks/abilitymgr_lite/include/abilityms_slite_client.h @@ -42,6 +42,8 @@ public: int ForceStopBundle(uint64_t token) const; + int ForceStop(char *bundlename) const; + ElementName *GetTopAbility() const; private: diff --git a/frameworks/abilitymgr_lite/src/slite/ability_manager_inner.cpp b/frameworks/abilitymgr_lite/src/slite/ability_manager_inner.cpp index 3c1103c..e79972f 100755 --- a/frameworks/abilitymgr_lite/src/slite/ability_manager_inner.cpp +++ b/frameworks/abilitymgr_lite/src/slite/ability_manager_inner.cpp @@ -17,7 +17,7 @@ #include "abilityms_slite_client.h" -StartCheckFunc CALLBACKFUNC; +StartCheckFunc CALLBACKFUNC = nullptr; extern "C" { int RegAbilityCallback(StartCheckFunc startChecktCallback) @@ -43,6 +43,6 @@ int ForceStop(char *bundlename) StartCheckFunc getAbilityCallback() { - return CALLBACKFUNC + return CALLBACKFUNC; } } diff --git a/frameworks/want_lite/BUILD.gn b/frameworks/want_lite/BUILD.gn index 2d74e5a..016cad7 100755 --- a/frameworks/want_lite/BUILD.gn +++ b/frameworks/want_lite/BUILD.gn @@ -34,8 +34,6 @@ source_set("want") { "${appexecfwk_lite_path}/frameworks/bundle_lite/include", "${appexecfwk_lite_path}/utils/bundle_lite", "//foundation/communication/ipc_lite/interfaces/kits", - "//kernel/liteos_a/kernel/include", - "//kernel/liteos_a/kernel/common", ] defines = [ "OHOS_APPEXECFWK_BMS_BUNDLEMANAGER" ] diff --git a/services/abilitymgr_lite/BUILD.gn b/services/abilitymgr_lite/BUILD.gn index ba3479b..072dbd0 100644 --- a/services/abilitymgr_lite/BUILD.gn +++ b/services/abilitymgr_lite/BUILD.gn @@ -83,8 +83,6 @@ lite_library("abilityms") { "//base/startup/appspawn_lite/services/include", "//base/security/permission/interfaces/kits/permission_lite", "//base/security/permission/services/permission_lite/pms/include", - "//kernel/liteos_a/kernel/include", - "//kernel/liteos_a/kernel/common", "//third_party/bounds_checking_function/include", "//utils/native/lite/include", "include", diff --git a/services/abilitymgr_lite/src/ability_mgr_service.cpp b/services/abilitymgr_lite/src/ability_mgr_service.cpp index 07af420..ccac550 100755 --- a/services/abilitymgr_lite/src/ability_mgr_service.cpp +++ b/services/abilitymgr_lite/src/ability_mgr_service.cpp @@ -91,7 +91,7 @@ BOOL AbilityMgrService::ServiceMessageHandle(Service *service, Request *request) } else if (request->msgId == TERMINATE_APP) { ret = AbilityService::GetInstance().ForceStopBundle(request->msgValue); } else if (request->msgId == TERMINATE_APP_BY_BUNDLENAME) { - char* bundleName = reinterpret_cast(request->data) + char* bundleName = reinterpret_cast(request->data); ret = AbilityService::GetInstance().ForceStop(bundleName); } return ret == ERR_OK; diff --git a/services/abilitymgr_lite/src/ability_service.cpp b/services/abilitymgr_lite/src/ability_service.cpp index 7755ebf..b5e5cd6 100755 --- a/services/abilitymgr_lite/src/ability_service.cpp +++ b/services/abilitymgr_lite/src/ability_service.cpp @@ -178,7 +178,7 @@ int32_t AbilityService::StartAbility(AbilitySvcInfo *info) // js to js HILOG_INFO(HILOG_MODULE_AAFWK, "Terminate pre js app when js to js") TerminateAbility(topRecord->GetToken()); - pendingToken_ = GenerateToken() + pendingToken_ = GenerateToken(); } } @@ -248,7 +248,7 @@ int32_t AbilityService::ForceStop(char* bundlename) } //stop js app - if (strcmp(GetTopAbility()->bundlename, bundlename) == 0) { + if (strcmp(abilityStack_.GetTopAbility()->GetAppName(), bundlename) == 0) { HILOG_INFO(HILOG_MODULE_AAFWK, "ForceStop [%s]", bundlename); AbilityRecord *topRecord = const_cast(abilityStack_.GetTopAbility()); return TerminateAbility(topRecord->GetToken()); diff --git a/services/abilitymgr_lite/tools/BUILD.gn b/services/abilitymgr_lite/tools/BUILD.gn index 6280e90..7f5b6cd 100755 --- a/services/abilitymgr_lite/tools/BUILD.gn +++ b/services/abilitymgr_lite/tools/BUILD.gn @@ -69,8 +69,6 @@ executable("aa") { "//foundation/communication/ipc_lite/interfaces/kits", "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//kernel/liteos_a/kernel/include", - "//kernel/liteos_a/kernel/common", "//third_party/bounds_checking_function/include", "//third_party/cJSON", "//utils/native/lite/include", diff --git a/services/abilitymgr_lite/unittest/test_lv0/page_ability_test/BUILD.gn b/services/abilitymgr_lite/unittest/test_lv0/page_ability_test/BUILD.gn index b259a0a..db1a2a5 100644 --- a/services/abilitymgr_lite/unittest/test_lv0/page_ability_test/BUILD.gn +++ b/services/abilitymgr_lite/unittest/test_lv0/page_ability_test/BUILD.gn @@ -39,8 +39,6 @@ unittest("ability_test_pageAbilityTest_lv0") { "${appexecfwk_lite_path}/kits/appkit_lite/appkit_utils/include", "//foundation/distributedschedule/samgr_lite/interfaces/innerkits/samgr", "//foundation/distributedschedule/samgr_lite/interfaces/innerkits/registry", - "//kernel/liteos_a/kernel/include", - "//kernel/liteos_a/kernel/common", "//third_party/cJSON", "//utils/native/lite/include", ] -- Gitee From 36d6eba8d358d10f44c094866e5e4811ffc8fbdb Mon Sep 17 00:00:00 2001 From: Zhaoyuan Date: Fri, 16 Jul 2021 10:45:12 +0800 Subject: [PATCH 2/2] move kernel include and fix bugs Signed-off-by: Zhaoyuan --- frameworks/ability_lite/BUILD.gn | 2 -- frameworks/ability_lite/example/BUILD.gn | 2 -- frameworks/abilitymgr_lite/BUILD.gn | 2 -- frameworks/abilitymgr_lite/include/abilityms_slite_client.h | 2 ++ .../abilitymgr_lite/src/slite/ability_manager_inner.cpp | 4 ++-- frameworks/want_lite/BUILD.gn | 2 -- services/abilitymgr_lite/BUILD.gn | 2 -- services/abilitymgr_lite/src/ability_mgr_service.cpp | 2 +- services/abilitymgr_lite/src/ability_service.cpp | 4 ++-- services/abilitymgr_lite/tools/BUILD.gn | 2 -- .../unittest/test_lv0/page_ability_test/BUILD.gn | 2 -- 11 files changed, 7 insertions(+), 19 deletions(-) diff --git a/frameworks/ability_lite/BUILD.gn b/frameworks/ability_lite/BUILD.gn index 85b1a61..c57d378 100755 --- a/frameworks/ability_lite/BUILD.gn +++ b/frameworks/ability_lite/BUILD.gn @@ -79,8 +79,6 @@ lite_library("ability") { "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", "//foundation/communication/ipc_lite/frameworks/liteipc/include", - "//kernel/liteos_a/kernel/include", - "//kernel/liteos_a/kernel/common", "//third_party/bounds_checking_function/include", "//third_party/freetype/include", "//utils/native/lite/kv_store/innerkits", diff --git a/frameworks/ability_lite/example/BUILD.gn b/frameworks/ability_lite/example/BUILD.gn index 5005a7e..d568217 100644 --- a/frameworks/ability_lite/example/BUILD.gn +++ b/frameworks/ability_lite/example/BUILD.gn @@ -47,8 +47,6 @@ lite_library("hiability") { "//foundation/graphic/utils/interfaces/innerkits", "//foundation/graphic/ui/interfaces/kits", "//foundation/graphic/utils/interfaces/kits/gfx_utils", - "//kernel/liteos_a/kernel/common", - "//kernel/liteos_a/kernel/include", ] deps = [ diff --git a/frameworks/abilitymgr_lite/BUILD.gn b/frameworks/abilitymgr_lite/BUILD.gn index e6f6180..e66514c 100755 --- a/frameworks/abilitymgr_lite/BUILD.gn +++ b/frameworks/abilitymgr_lite/BUILD.gn @@ -41,8 +41,6 @@ lite_library("abilitymanager") { "${appexecfwk_lite_path}/frameworks/bundle_lite/include", "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//kernel/liteos_a/kernel/include", - "//kernel/liteos_a/kernel/common", "//third_party/bounds_checking_function/include", "//utils/native/lite/kv_store/innerkits", "//utils/native/lite/include", diff --git a/frameworks/abilitymgr_lite/include/abilityms_slite_client.h b/frameworks/abilitymgr_lite/include/abilityms_slite_client.h index 21e71ed..a87d3d3 100755 --- a/frameworks/abilitymgr_lite/include/abilityms_slite_client.h +++ b/frameworks/abilitymgr_lite/include/abilityms_slite_client.h @@ -42,6 +42,8 @@ public: int ForceStopBundle(uint64_t token) const; + int ForceStop(char *bundlename) const; + ElementName *GetTopAbility() const; private: diff --git a/frameworks/abilitymgr_lite/src/slite/ability_manager_inner.cpp b/frameworks/abilitymgr_lite/src/slite/ability_manager_inner.cpp index 3c1103c..e79972f 100755 --- a/frameworks/abilitymgr_lite/src/slite/ability_manager_inner.cpp +++ b/frameworks/abilitymgr_lite/src/slite/ability_manager_inner.cpp @@ -17,7 +17,7 @@ #include "abilityms_slite_client.h" -StartCheckFunc CALLBACKFUNC; +StartCheckFunc CALLBACKFUNC = nullptr; extern "C" { int RegAbilityCallback(StartCheckFunc startChecktCallback) @@ -43,6 +43,6 @@ int ForceStop(char *bundlename) StartCheckFunc getAbilityCallback() { - return CALLBACKFUNC + return CALLBACKFUNC; } } diff --git a/frameworks/want_lite/BUILD.gn b/frameworks/want_lite/BUILD.gn index 2d74e5a..016cad7 100755 --- a/frameworks/want_lite/BUILD.gn +++ b/frameworks/want_lite/BUILD.gn @@ -34,8 +34,6 @@ source_set("want") { "${appexecfwk_lite_path}/frameworks/bundle_lite/include", "${appexecfwk_lite_path}/utils/bundle_lite", "//foundation/communication/ipc_lite/interfaces/kits", - "//kernel/liteos_a/kernel/include", - "//kernel/liteos_a/kernel/common", ] defines = [ "OHOS_APPEXECFWK_BMS_BUNDLEMANAGER" ] diff --git a/services/abilitymgr_lite/BUILD.gn b/services/abilitymgr_lite/BUILD.gn index ba3479b..072dbd0 100644 --- a/services/abilitymgr_lite/BUILD.gn +++ b/services/abilitymgr_lite/BUILD.gn @@ -83,8 +83,6 @@ lite_library("abilityms") { "//base/startup/appspawn_lite/services/include", "//base/security/permission/interfaces/kits/permission_lite", "//base/security/permission/services/permission_lite/pms/include", - "//kernel/liteos_a/kernel/include", - "//kernel/liteos_a/kernel/common", "//third_party/bounds_checking_function/include", "//utils/native/lite/include", "include", diff --git a/services/abilitymgr_lite/src/ability_mgr_service.cpp b/services/abilitymgr_lite/src/ability_mgr_service.cpp index 07af420..ccac550 100755 --- a/services/abilitymgr_lite/src/ability_mgr_service.cpp +++ b/services/abilitymgr_lite/src/ability_mgr_service.cpp @@ -91,7 +91,7 @@ BOOL AbilityMgrService::ServiceMessageHandle(Service *service, Request *request) } else if (request->msgId == TERMINATE_APP) { ret = AbilityService::GetInstance().ForceStopBundle(request->msgValue); } else if (request->msgId == TERMINATE_APP_BY_BUNDLENAME) { - char* bundleName = reinterpret_cast(request->data) + char* bundleName = reinterpret_cast(request->data); ret = AbilityService::GetInstance().ForceStop(bundleName); } return ret == ERR_OK; diff --git a/services/abilitymgr_lite/src/ability_service.cpp b/services/abilitymgr_lite/src/ability_service.cpp index 7755ebf..b5e5cd6 100755 --- a/services/abilitymgr_lite/src/ability_service.cpp +++ b/services/abilitymgr_lite/src/ability_service.cpp @@ -178,7 +178,7 @@ int32_t AbilityService::StartAbility(AbilitySvcInfo *info) // js to js HILOG_INFO(HILOG_MODULE_AAFWK, "Terminate pre js app when js to js") TerminateAbility(topRecord->GetToken()); - pendingToken_ = GenerateToken() + pendingToken_ = GenerateToken(); } } @@ -248,7 +248,7 @@ int32_t AbilityService::ForceStop(char* bundlename) } //stop js app - if (strcmp(GetTopAbility()->bundlename, bundlename) == 0) { + if (strcmp(abilityStack_.GetTopAbility()->GetAppName(), bundlename) == 0) { HILOG_INFO(HILOG_MODULE_AAFWK, "ForceStop [%s]", bundlename); AbilityRecord *topRecord = const_cast(abilityStack_.GetTopAbility()); return TerminateAbility(topRecord->GetToken()); diff --git a/services/abilitymgr_lite/tools/BUILD.gn b/services/abilitymgr_lite/tools/BUILD.gn index 6280e90..7f5b6cd 100755 --- a/services/abilitymgr_lite/tools/BUILD.gn +++ b/services/abilitymgr_lite/tools/BUILD.gn @@ -69,8 +69,6 @@ executable("aa") { "//foundation/communication/ipc_lite/interfaces/kits", "//foundation/distributedschedule/samgr_lite/interfaces/kits/registry", "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr", - "//kernel/liteos_a/kernel/include", - "//kernel/liteos_a/kernel/common", "//third_party/bounds_checking_function/include", "//third_party/cJSON", "//utils/native/lite/include", diff --git a/services/abilitymgr_lite/unittest/test_lv0/page_ability_test/BUILD.gn b/services/abilitymgr_lite/unittest/test_lv0/page_ability_test/BUILD.gn index b259a0a..db1a2a5 100644 --- a/services/abilitymgr_lite/unittest/test_lv0/page_ability_test/BUILD.gn +++ b/services/abilitymgr_lite/unittest/test_lv0/page_ability_test/BUILD.gn @@ -39,8 +39,6 @@ unittest("ability_test_pageAbilityTest_lv0") { "${appexecfwk_lite_path}/kits/appkit_lite/appkit_utils/include", "//foundation/distributedschedule/samgr_lite/interfaces/innerkits/samgr", "//foundation/distributedschedule/samgr_lite/interfaces/innerkits/registry", - "//kernel/liteos_a/kernel/include", - "//kernel/liteos_a/kernel/common", "//third_party/cJSON", "//utils/native/lite/include", ] -- Gitee