From 27784db35b6aee0bf82a7f0cad119126a98b4581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=8F=9E=E9=A3=8E?= Date: Tue, 22 Feb 2022 12:43:34 +0000 Subject: [PATCH 01/10] Description:suitable for the daily record Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No #I4TYVU; Signed-off-by: wuluofeng --- services/bundlemgr_lite/BUILD.gn | 1 + .../src/gt_bundle_manager_service.cpp | 5 ++- utils/bundle_lite/aafwk_event_error_code.cpp | 42 +++++++++++++++++++ utils/bundle_lite/aafwk_event_error_code.h | 42 +++++++++++++++++++ utils/bundle_lite/aafwk_event_error_id.h | 35 ++++++++++++++++ utils/bundle_lite/adapter.h | 2 - 6 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 utils/bundle_lite/aafwk_event_error_code.cpp create mode 100644 utils/bundle_lite/aafwk_event_error_code.h create mode 100644 utils/bundle_lite/aafwk_event_error_id.h diff --git a/services/bundlemgr_lite/BUILD.gn b/services/bundlemgr_lite/BUILD.gn index 60bbb54..530cd86 100644 --- a/services/bundlemgr_lite/BUILD.gn +++ b/services/bundlemgr_lite/BUILD.gn @@ -29,6 +29,7 @@ if (ohos_kernel_type == "liteos_m") { "src/gt_bundle_manager_service.cpp", "src/gt_bundle_parser.cpp", "src/gt_extractor_util.cpp", + "../../utils/bundle_lite/aafwk_event_error_code.cpp", ] deps = [ "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", diff --git a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp index 99b3717..fc35e02 100755 --- a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp @@ -14,7 +14,8 @@ */ #include "gt_bundle_manager_service.h" - +#include "aafwk_event_error_id.h" +#include "aafwk_event_error_code.h" #include "ability_info_utils.h" #include "ability_message_id.h" #include "appexecfwk_errors.h" @@ -36,6 +37,8 @@ #include "utils.h" #include "want.h" +using namespace OHOS::ACELite; + namespace OHOS { const uint8_t OPERATION_DOING = 200; const uint8_t BMS_INSTALLATION_START = 101; diff --git a/utils/bundle_lite/aafwk_event_error_code.cpp b/utils/bundle_lite/aafwk_event_error_code.cpp new file mode 100644 index 0000000..63963ea --- /dev/null +++ b/utils/bundle_lite/aafwk_event_error_code.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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 "aafwk_event_error_code.h" +#include "product_adapter.h" + +namespace OHOS { +namespace ACELite { +AafwkEventCodePrint *AafwkEventCodePrint::GetInstance() +{ + static AafwkEventCodePrint printInstance; + return &printInstance; +} + +void AafwkEventCodePrint::AafwkEventPrint(uint8_t info2, uint8_t info3) +{ + ProductAdapter::PrintEventTrace(0, info2, info3); +} + +void AafwkEventCodePrint::AafwkEventPrint(uint8_t info1, uint8_t info2, uint8_t info3) +{ + ProductAdapter::PrintEventTrace(info1, info2, info3); +} + +void AafwkEventCodePrint::AafwkErrorPrint(uint8_t info1, uint16_t info2) +{ + ProductAdapter::PrintErrCode(info1, info2); +} +} +} \ No newline at end of file diff --git a/utils/bundle_lite/aafwk_event_error_code.h b/utils/bundle_lite/aafwk_event_error_code.h new file mode 100644 index 0000000..cb5152b --- /dev/null +++ b/utils/bundle_lite/aafwk_event_error_code.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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 "memory_heap.h" +#include "aafwk_event_error_id.h" + +namespace OHOS { +namespace ACELite { +#define APP_EVENT(code1) \ + AafwkEventCodePrint::GetInstance()->AafwkEventPrint(code1, 0) +#define APP_ERRCODE_EXTRA(code1, code2) \ + AafwkEventCodePrint::GetInstance()->AafwkErrorPrint(code1, code2) + +class AafwkEventCodePrint final : public MemoryHeap { +public: + + AafwkEventCodePrint() = default; + + ~AafwkEventCodePrint() = default; + + static AafwkEventCodePrint *GetInstance(); + + void AafwkEventPrint(uint8_t info2, uint8_t info3); + + void AafwkEventPrint(uint8_t info1, uint8_t info2, uint8_t info3); + + void AafwkErrorPrint(uint8_t info2, uint16_t info3); +}; +} +} \ No newline at end of file diff --git a/utils/bundle_lite/aafwk_event_error_id.h b/utils/bundle_lite/aafwk_event_error_id.h new file mode 100644 index 0000000..8e0d273 --- /dev/null +++ b/utils/bundle_lite/aafwk_event_error_id.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020 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. + */ + +// event codes +#define MT_ACE_APP_START 0x00 +#define MT_ACE_APP_ACTIVE 0x01 +#define MT_ACE_APP_BACKGROUND 0x02 +#define MT_ACE_APP_STOP 0x03 + +// error codes +#define EXCE_ACE_APP_START 0x01 +#define EXCE_ACE_APP_SCAN 0x07 + +#define EXCE_ACE_APP_START_UNKNOWN_BUNDLE_INFO 0x0 +#define EXCE_ACE_APP_STOP_NO_ABILITY_RUNNING 0x5 +#define EXCE_ACE_APP_STOP_UNKNOWN_ABILITY_TOKEN 0x6 +#define EXCE_ACE_APP_START_CREATE_TSAK_FAILED 0x3 +#define EXCE_ACE_APP_START_LAUNCHER_EXIT_FAILED 0x4 + +#define EXCE_ACE_APP_SCAN_INVALID_SYSTEM_APP 0x0 +#define EXCE_ACE_APP_SCAN_UNKNOWN_BUNDLE_INFO 0x3 +#define EXCE_ACE_APP_SCAN_PARSE_JSON_FALIED 0x1 +#define EXCE_ACE_APP_SCAN_PARSE_PROFILE_FALIED 0x2 \ No newline at end of file diff --git a/utils/bundle_lite/adapter.h b/utils/bundle_lite/adapter.h index 7cdc82b..2039c89 100755 --- a/utils/bundle_lite/adapter.h +++ b/utils/bundle_lite/adapter.h @@ -76,8 +76,6 @@ const unsigned int RETRY_TIMES = 10; } \ } while (0) -#define APP_ERRCODE_EXTRA(code1, code2) -#define APP_EVENT(code1) #define RecordAbiityInfoEvt(code1) #define MutexDelete(a) osMutexDelete(a) #define MutexAcquire(a, b) osMutexAcquire(a, b) -- Gitee From d73232229a979dc4ccfedc945c14cf03b650f3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=8F=9E=E9=A3=8E?= Date: Tue, 22 Feb 2022 13:13:22 +0000 Subject: [PATCH 02/10] Description:suitable for the daily record Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No #I4TYVU; Signed-off-by: wuluofeng --- services/bundlemgr_lite/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/bundlemgr_lite/BUILD.gn b/services/bundlemgr_lite/BUILD.gn index 530cd86..e84ce98 100644 --- a/services/bundlemgr_lite/BUILD.gn +++ b/services/bundlemgr_lite/BUILD.gn @@ -29,7 +29,7 @@ if (ohos_kernel_type == "liteos_m") { "src/gt_bundle_manager_service.cpp", "src/gt_bundle_parser.cpp", "src/gt_extractor_util.cpp", - "../../utils/bundle_lite/aafwk_event_error_code.cpp", + "../../../utils/bundle_lite/aafwk_event_error_code.cpp", ] deps = [ "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", -- Gitee From ae27d520cb3721406f5a2b8c661058d8602be9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=8F=9E=E9=A3=8E?= Date: Tue, 22 Feb 2022 13:32:41 +0000 Subject: [PATCH 03/10] Description:suitable for the daily record Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No #I4TYVU; Signed-off-by: wuluofeng --- services/bundlemgr_lite/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/bundlemgr_lite/BUILD.gn b/services/bundlemgr_lite/BUILD.gn index e84ce98..3287667 100644 --- a/services/bundlemgr_lite/BUILD.gn +++ b/services/bundlemgr_lite/BUILD.gn @@ -29,7 +29,7 @@ if (ohos_kernel_type == "liteos_m") { "src/gt_bundle_manager_service.cpp", "src/gt_bundle_parser.cpp", "src/gt_extractor_util.cpp", - "../../../utils/bundle_lite/aafwk_event_error_code.cpp", + "${appexecfwk_lite_path}/utils/bundle_lite/aafwk_event_error_code.cpp", ] deps = [ "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", -- Gitee From 65f9426540b49c0a61c514f2422fe2b7ba80b493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=8F=9E=E9=A3=8E?= Date: Tue, 22 Feb 2022 15:52:10 +0000 Subject: [PATCH 04/10] Description:suitable for the daily record Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No #I4TYVU; Signed-off-by: wuluofeng -- Gitee From 96b067ca2d20dd6fb14d027695a382541b090bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=8F=9E=E9=A3=8E?= Date: Wed, 23 Feb 2022 01:39:43 +0000 Subject: [PATCH 05/10] Description:suitable for the daily record Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No #I4TYVU; Signed-off-by: wuluofeng --- services/bundlemgr_lite/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/bundlemgr_lite/BUILD.gn b/services/bundlemgr_lite/BUILD.gn index 3287667..4c534d4 100644 --- a/services/bundlemgr_lite/BUILD.gn +++ b/services/bundlemgr_lite/BUILD.gn @@ -29,7 +29,7 @@ if (ohos_kernel_type == "liteos_m") { "src/gt_bundle_manager_service.cpp", "src/gt_bundle_parser.cpp", "src/gt_extractor_util.cpp", - "${appexecfwk_lite_path}/utils/bundle_lite/aafwk_event_error_code.cpp", + "aafwk_event_error_code.cpp", ] deps = [ "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", -- Gitee From 9d384a448b4a243c9117fcaea8598dc2ead65798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=8F=9E=E9=A3=8E?= Date: Wed, 23 Feb 2022 02:19:30 +0000 Subject: [PATCH 06/10] Description:suitable for the daily record Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No #I4TYVU; Signed-off-by: wuluofeng --- services/bundlemgr_lite/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/bundlemgr_lite/BUILD.gn b/services/bundlemgr_lite/BUILD.gn index 4c534d4..3287667 100644 --- a/services/bundlemgr_lite/BUILD.gn +++ b/services/bundlemgr_lite/BUILD.gn @@ -29,7 +29,7 @@ if (ohos_kernel_type == "liteos_m") { "src/gt_bundle_manager_service.cpp", "src/gt_bundle_parser.cpp", "src/gt_extractor_util.cpp", - "aafwk_event_error_code.cpp", + "${appexecfwk_lite_path}/utils/bundle_lite/aafwk_event_error_code.cpp", ] deps = [ "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", -- Gitee From 9565ace6092dee60e95b9f2d93fe2c64ecc98965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=8F=9E=E9=A3=8E?= Date: Wed, 23 Feb 2022 02:31:47 +0000 Subject: [PATCH 07/10] Description:suitable for the daily record Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No #I4TYVU; Signed-off-by: wuluofeng --- services/bundlemgr_lite/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/bundlemgr_lite/BUILD.gn b/services/bundlemgr_lite/BUILD.gn index 3287667..ab1a301 100644 --- a/services/bundlemgr_lite/BUILD.gn +++ b/services/bundlemgr_lite/BUILD.gn @@ -29,7 +29,7 @@ if (ohos_kernel_type == "liteos_m") { "src/gt_bundle_manager_service.cpp", "src/gt_bundle_parser.cpp", "src/gt_extractor_util.cpp", - "${appexecfwk_lite_path}/utils/bundle_lite/aafwk_event_error_code.cpp", + "//foundation/appexecfwk/appexecfwk_lite/utils/bundle_lite/aafwk_event_error_code.cpp", ] deps = [ "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", -- Gitee From 9fba3776a868699cdd3baf197c7e089f1b4dbf6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=8F=9E=E9=A3=8E?= Date: Wed, 23 Feb 2022 02:47:50 +0000 Subject: [PATCH 08/10] Description:suitable for the daily record Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No #I4TYVU; Signed-off-by: wuluofeng --- services/bundlemgr_lite/BUILD.gn | 1 - utils/bundle_lite/aafwk_event_error_code.cpp | 42 ------------------- utils/bundle_lite/aafwk_event_error_code.h | 22 ++++++++-- 3 files changed, 18 insertions(+), 47 deletions(-) diff --git a/services/bundlemgr_lite/BUILD.gn b/services/bundlemgr_lite/BUILD.gn index ab1a301..60bbb54 100644 --- a/services/bundlemgr_lite/BUILD.gn +++ b/services/bundlemgr_lite/BUILD.gn @@ -29,7 +29,6 @@ if (ohos_kernel_type == "liteos_m") { "src/gt_bundle_manager_service.cpp", "src/gt_bundle_parser.cpp", "src/gt_extractor_util.cpp", - "//foundation/appexecfwk/appexecfwk_lite/utils/bundle_lite/aafwk_event_error_code.cpp", ] deps = [ "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", diff --git a/utils/bundle_lite/aafwk_event_error_code.cpp b/utils/bundle_lite/aafwk_event_error_code.cpp index 63963ea..e69de29 100644 --- a/utils/bundle_lite/aafwk_event_error_code.cpp +++ b/utils/bundle_lite/aafwk_event_error_code.cpp @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2020 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 "aafwk_event_error_code.h" -#include "product_adapter.h" - -namespace OHOS { -namespace ACELite { -AafwkEventCodePrint *AafwkEventCodePrint::GetInstance() -{ - static AafwkEventCodePrint printInstance; - return &printInstance; -} - -void AafwkEventCodePrint::AafwkEventPrint(uint8_t info2, uint8_t info3) -{ - ProductAdapter::PrintEventTrace(0, info2, info3); -} - -void AafwkEventCodePrint::AafwkEventPrint(uint8_t info1, uint8_t info2, uint8_t info3) -{ - ProductAdapter::PrintEventTrace(info1, info2, info3); -} - -void AafwkEventCodePrint::AafwkErrorPrint(uint8_t info1, uint16_t info2) -{ - ProductAdapter::PrintErrCode(info1, info2); -} -} -} \ No newline at end of file diff --git a/utils/bundle_lite/aafwk_event_error_code.h b/utils/bundle_lite/aafwk_event_error_code.h index cb5152b..0063856 100644 --- a/utils/bundle_lite/aafwk_event_error_code.h +++ b/utils/bundle_lite/aafwk_event_error_code.h @@ -14,6 +14,7 @@ */ #include "memory_heap.h" +#include "product_adapter.h" #include "aafwk_event_error_id.h" namespace OHOS { @@ -30,13 +31,26 @@ public: ~AafwkEventCodePrint() = default; - static AafwkEventCodePrint *GetInstance(); + static AafwkEventCodePrint *GetInstance() + { + static AafwkEventCodePrint printInstance; + return &printInstance; + } - void AafwkEventPrint(uint8_t info2, uint8_t info3); + void AafwkEventPrint(uint8_t info2, uint8_t info3) + { + ProductAdapter::PrintEventTrace(0, info2, info3); + } - void AafwkEventPrint(uint8_t info1, uint8_t info2, uint8_t info3); + void AafwkEventPrint(uint8_t info1, uint8_t info2, uint8_t info3) + { + ProductAdapter::PrintEventTrace(info1, info2, info3); + } - void AafwkErrorPrint(uint8_t info2, uint16_t info3); + void AafwkErrorPrint(uint8_t info2, uint16_t info3) + { + ProductAdapter::PrintErrCode(info1, info2); + } }; } } \ No newline at end of file -- Gitee From 421bcd9b95ee5e41700df9e30980633a79f992dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=8F=9E=E9=A3=8E?= Date: Wed, 23 Feb 2022 03:00:15 +0000 Subject: [PATCH 09/10] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20utils/bundl?= =?UTF-8?q?e=5Flite/aafwk=5Fevent=5Ferror=5Fcode.h=20=20=E4=B8=BA=20utils/?= =?UTF-8?q?bundle=5Flite/aafwk=5Fevent=5Ferror=5Fcode.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{aafwk_event_error_code.h => aafwk_event_error_code.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename utils/bundle_lite/{aafwk_event_error_code.h => aafwk_event_error_code.h} (100%) diff --git a/utils/bundle_lite/aafwk_event_error_code.h b/utils/bundle_lite/aafwk_event_error_code.h similarity index 100% rename from utils/bundle_lite/aafwk_event_error_code.h rename to utils/bundle_lite/aafwk_event_error_code.h -- Gitee From a0b9daaeef598e3f0277d9e0076a2760b70af0d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=8F=9E=E9=A3=8E?= Date: Wed, 23 Feb 2022 03:14:48 +0000 Subject: [PATCH 10/10] Description:suitable for the daily record Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No #I4TYVU; Signed-off-by: wuluofeng --- utils/bundle_lite/aafwk_event_error_code.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/bundle_lite/aafwk_event_error_code.h b/utils/bundle_lite/aafwk_event_error_code.h index 0063856..877ab75 100644 --- a/utils/bundle_lite/aafwk_event_error_code.h +++ b/utils/bundle_lite/aafwk_event_error_code.h @@ -47,7 +47,7 @@ public: ProductAdapter::PrintEventTrace(info1, info2, info3); } - void AafwkErrorPrint(uint8_t info2, uint16_t info3) + void AafwkErrorPrint(uint8_t info1, uint16_t info2) { ProductAdapter::PrintErrCode(info1, info2); } -- Gitee