diff --git a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp index a6bc4aa..d1ac38c 100755 --- a/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp +++ b/services/bundlemgr_lite/src/gt_bundle_manager_service.cpp @@ -14,6 +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" @@ -35,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..5f23f16 --- /dev/null +++ b/utils/bundle_lite/aafwk_event_error_code.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020-2022 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" + +using namespace OHOS::ACELite; + +namespace OHOS { +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 diff --git a/utils/bundle_lite/aafwk_event_error_code.h b/utils/bundle_lite/aafwk_event_error_code.h index 6b2c959..f402fd6 100644 --- a/utils/bundle_lite/aafwk_event_error_code.h +++ b/utils/bundle_lite/aafwk_event_error_code.h @@ -13,46 +13,30 @@ * 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" +#include "aafwk_event_error__id.h" + +using namespace OHOS::ACELite; 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; - } + static AafwkEventCodePrint *GetInstance(); - void AafwkEventPrint(uint8_t info2, uint8_t info3) - { - ProductAdapter::PrintEventTrace(0, info2, info3); - } + void AafwkEventPrint(uint8_t info2, uint8_t info3); - void AafwkEventPrint(uint8_t info1, uint8_t info2, uint8_t info3) - { - ProductAdapter::PrintEventTrace(info1, info2, info3); - } + void AafwkEventPrint(uint8_t info1, uint8_t info2, uint8_t info3); - void AafwkErrorPrint(uint8_t info1, uint16_t info2) - { - ProductAdapter::PrintErrCode(info1, info2); - } + void AafwkErrorPrint(uint8_t info2, uint16_t info3); }; -} -} -#endif \ No newline at end of file +} \ 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 9d09de0..dc748fe 100644 --- a/utils/bundle_lite/aafwk_event_error_id.h +++ b/utils/bundle_lite/aafwk_event_error_id.h @@ -16,6 +16,8 @@ #ifndef UTILS_BUNDLE_LITE_AAFWK_EVENT_ERROR_ID_H #define UTILS_BUNDLE_LITE_AAFWK_EVENT_ERROR_ID_H +using namespace OHOS::ACELite; + namespace OHOS { // event codes enum { diff --git a/utils/bundle_lite/adapter.h b/utils/bundle_lite/adapter.h index 0f53edb..e52402b 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)