diff --git a/services/bundlemgr_lite/BUILD.gn b/services/bundlemgr_lite/BUILD.gn index 60bbb54a03176a8a5ec8916b713184f1ae9c2081..32876679f93d78e4d35fff182188c019ea249c4b 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", + "${appexecfwk_lite_path}/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 99b37175899cf4e7474c53b28537099b25767873..3c92a4028017432faf2b61a839bd2f7da133a6f1 100755 --- a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp @@ -13,8 +13,9 @@ * limitations under the License. */ +#include "aafwk_event_error_id.h" +#include "aafwk_event_error_code.h" #include "gt_bundle_manager_service.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 0000000000000000000000000000000000000000..22c02114ba73d2c187a4729c29383bae27367d76 --- /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); +} +} +} // namespace OHOS \ 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 0000000000000000000000000000000000000000..8f27e8af9c50befb533cebd2744ccc42355f4a9f --- /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); +}; +} +} 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 0000000000000000000000000000000000000000..8e0d2736c725228ee57b53b5a75eceb3b22dbbd7 --- /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 7cdc82b8583fd9f9c5a3acbacdf7a7dd71a28599..2039c89301474c3001c57adbd7114eec8fb9fea4 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)