From 6019b6deeac5edcb73f46b228dc27ec5ff21b83a 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:26:29 +0000 Subject: [PATCH 1/3] Description:suitable for the daily record Sig:appexecfwk Feature or Bugfix:Bugfix Binary Source:No #I4TYVU; Signed-off-by: wuluofeng --- .../src/gt_bundle_manager_service.cpp | 5 +- utils/bundle_lite/aafwk_event_error__id.h | 35 ++++++++++++ utils/bundle_lite/aafwk_event_error_code.h | 56 +++++++++++++++++++ utils/bundle_lite/adapter.h | 2 - 4 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 utils/bundle_lite/aafwk_event_error__id.h create mode 100644 utils/bundle_lite/aafwk_event_error_code.h 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__id.h b/utils/bundle_lite/aafwk_event_error__id.h new file mode 100644 index 0000000..611dfa8 --- /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/aafwk_event_error_code.h b/utils/bundle_lite/aafwk_event_error_code.h new file mode 100644 index 0000000..877ab75 --- /dev/null +++ b/utils/bundle_lite/aafwk_event_error_code.h @@ -0,0 +1,56 @@ +/* + * 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 "product_adapter.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() + { + static AafwkEventCodePrint printInstance; + return &printInstance; + } + + void AafwkEventPrint(uint8_t info2, uint8_t info3) + { + ProductAdapter::PrintEventTrace(0, info2, info3); + } + + void AafwkEventPrint(uint8_t info1, uint8_t info2, uint8_t info3) + { + ProductAdapter::PrintEventTrace(info1, info2, info3); + } + + void AafwkErrorPrint(uint8_t info1, uint16_t info2) + { + ProductAdapter::PrintErrCode(info1, info2); + } +}; +} +} \ 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 1f8e5efe7830c8f10aad3d70fee1143b6d1cb40c 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 05:10:56 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20utils/bundle?= =?UTF-8?q?=5Flite/aafwk=5Fevent=5Ferror=5F=5Fid.h=20=E4=B8=BA=20utils/bun?= =?UTF-8?q?dle=5Flite/aafwk=5Fevent=5Ferror=5Fid.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{aafwk_event_error__id.h => aafwk_event_error_id.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename utils/bundle_lite/{aafwk_event_error__id.h => aafwk_event_error_id.h} (100%) diff --git a/utils/bundle_lite/aafwk_event_error__id.h b/utils/bundle_lite/aafwk_event_error_id.h similarity index 100% rename from utils/bundle_lite/aafwk_event_error__id.h rename to utils/bundle_lite/aafwk_event_error_id.h -- Gitee From 851b065169199bb3ca7f45ee712ebb4f55277ba8 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 06:21:32 +0000 Subject: [PATCH 3/3] 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 | 6 +++++- utils/bundle_lite/aafwk_event_error_id.h | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/utils/bundle_lite/aafwk_event_error_code.h b/utils/bundle_lite/aafwk_event_error_code.h index 877ab75..9a687bc 100644 --- a/utils/bundle_lite/aafwk_event_error_code.h +++ b/utils/bundle_lite/aafwk_event_error_code.h @@ -13,6 +13,9 @@ * limitations under the License. */ +#ifndef UTILS_BUNDLE_LITE_AAFWK_EVENT_ERROR_CODE_H +#define UTILS_BUNDLE_LITE_AAFWK_EVENT_ERROR_CODE_H + #include "memory_heap.h" #include "product_adapter.h" #include "aafwk_event_error_id.h" @@ -53,4 +56,5 @@ public: } }; } -} \ No newline at end of file +} +#endif \ 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 index 611dfa8..6b5168a 100644 --- a/utils/bundle_lite/aafwk_event_error_id.h +++ b/utils/bundle_lite/aafwk_event_error_id.h @@ -12,6 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#ifndef UTILS_BUNDLE_LITE_AAFWK_EVENT_ERROR_ID_H +#define UTILS_BUNDLE_LITE_AAFWK_EVENT_ERROR_ID_H + // event codes #define MT_ACE_APP_START 0x00 #define MT_ACE_APP_ACTIVE 0x01 @@ -32,4 +36,6 @@ #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 +#define EXCE_ACE_APP_SCAN_PARSE_PROFILE_FALIED 0x2 + +#endif \ No newline at end of file -- Gitee