Projects
Eulaceura:Factory
hiviewdfx_hisysevent
_service:obs_scm:0009-remove-dependency-and-ada...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0009-remove-dependency-and-adapt-for-build-device_auth.patch of Package hiviewdfx_hisysevent
From 7b37fc1df4da5befa175ff6687238c0012d2bb5e Mon Sep 17 00:00:00 2001 From: heppen <hepeng68@huawei.com> Date: Tue, 20 Jun 2023 17:37:06 +0800 Subject: [PATCH] remove dependency and adapt for build --- services/BUILD.gn | 16 +++---- .../src/hiview_adapter/hisysevent_adapter.cpp | 33 +++++++------- .../src/hiview_adapter/hitrace_adapter.cpp | 10 +++-- .../permission_adapter/permission_adapter.cpp | 43 ++++++++++--------- 4 files changed, 53 insertions(+), 49 deletions(-) diff --git a/services/BUILD.gn b/services/BUILD.gn index 655f169..967d958 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -176,8 +176,8 @@ if (os_level == "mini" || os_level == "small") { external_deps = [ "c_utils:utils", "dsoftbus:softbus_client", - "hisysevent_native:libhisysevent", - "hitrace_native:hitrace_meter", + # "hisysevent_native:libhisysevent", + # "hitrace_native:hitrace_meter", "hiviewdfx_hilog_native:libhilog", ] if (support_jsapi) { @@ -225,10 +225,10 @@ if (os_level == "mini" || os_level == "small") { ] external_deps = [ - "access_token:libaccesstoken_sdk", + # "access_token:libaccesstoken_sdk", "c_utils:utils", - "hisysevent_native:libhisysevent", - "hitrace_native:hitrace_meter", + # "hisysevent_native:libhisysevent", + # "hitrace_native:hitrace_meter", "hiviewdfx_hilog_native:libhilog", "init:libbegetutil", "ipc:ipc_core", @@ -269,10 +269,10 @@ if (os_level == "mini" || os_level == "small") { ] external_deps = [ - "access_token:libaccesstoken_sdk", + # "access_token:libaccesstoken_sdk", "c_utils:utils", - "hisysevent_native:libhisysevent", - "hitrace_native:hitrace_meter", + # "hisysevent_native:libhisysevent", + # "hitrace_native:hitrace_meter", "hiviewdfx_hilog_native:libhilog", "init:libbegetutil", "ipc:ipc_core", diff --git a/services/frameworks/src/hiview_adapter/hisysevent_adapter.cpp b/services/frameworks/src/hiview_adapter/hisysevent_adapter.cpp index 3954919..f5b3380 100644 --- a/services/frameworks/src/hiview_adapter/hisysevent_adapter.cpp +++ b/services/frameworks/src/hiview_adapter/hisysevent_adapter.cpp @@ -14,33 +14,34 @@ */ #include "hisysevent_adapter.h" -#include "hisysevent.h" +// #include "hisysevent.h" #ifdef __cplusplus extern "C" { #endif -constexpr char STR_EVENT_CORE_FUNCTION[] = "CORE_FUNCTION"; -constexpr char STR_EVENT[] = "EVENT"; -constexpr char STR_APP_ID[] = "APP_ID"; -constexpr char STR_BATCH_NUMBER[] = "BATCH_NUMBER"; -constexpr char STR_RESULT[] = "RESULT"; -constexpr char STR_OS_ACCOUNT_ID[] = "OS_ACCOUNT_ID"; +// constexpr char STR_EVENT_CORE_FUNCTION[] = "CORE_FUNCTION"; +// constexpr char STR_EVENT[] = "EVENT"; +// constexpr char STR_APP_ID[] = "APP_ID"; +// constexpr char STR_BATCH_NUMBER[] = "BATCH_NUMBER"; +// constexpr char STR_RESULT[] = "RESULT"; +// constexpr char STR_OS_ACCOUNT_ID[] = "OS_ACCOUNT_ID"; void ReportCoreFuncInvokeEvent(const InvokeEvent *event) { + return; if (event == nullptr) { return; } - OHOS::HiviewDFX::HiSysEvent::Write( - OHOS::HiviewDFX::HiSysEvent::Domain::DEVICE_AUTH, - STR_EVENT_CORE_FUNCTION, - OHOS::HiviewDFX::HiSysEvent::EventType::STATISTIC, - STR_EVENT, event->eventId, - STR_APP_ID, event->appId, - STR_BATCH_NUMBER, event->batchNumber, - STR_RESULT, event->result, - STR_OS_ACCOUNT_ID, event->osAccountId); + // OHOS::HiviewDFX::HiSysEvent::Write( + // OHOS::HiviewDFX::HiSysEvent::Domain::DEVICE_AUTH, + // STR_EVENT_CORE_FUNCTION, + // OHOS::HiviewDFX::HiSysEvent::EventType::STATISTIC, + // STR_EVENT, event->eventId, + // STR_APP_ID, event->appId, + // STR_BATCH_NUMBER, event->batchNumber, + // STR_RESULT, event->result, + // STR_OS_ACCOUNT_ID, event->osAccountId); } #ifdef __cplusplus diff --git a/services/frameworks/src/hiview_adapter/hitrace_adapter.cpp b/services/frameworks/src/hiview_adapter/hitrace_adapter.cpp index 57eca82..0beea45 100644 --- a/services/frameworks/src/hiview_adapter/hitrace_adapter.cpp +++ b/services/frameworks/src/hiview_adapter/hitrace_adapter.cpp @@ -15,24 +15,26 @@ #include "hitrace_adapter.h" -#include "hitrace_meter.h" +// #include "hitrace_meter.h" #ifdef __cplusplus extern "C" { #endif void DevAuthStartTrace(const char *value) -{ +{ + return; if (value == nullptr) { return; } - StartTrace(HITRACE_TAG_APP, value); + // StartTrace(HITRACE_TAG_APP, value); } void DevAuthFinishTrace(void) { - FinishTrace(HITRACE_TAG_APP); + return; + // FinishTrace(HITRACE_TAG_APP); } #ifdef __cplusplus diff --git a/services/frameworks/src/permission_adapter/permission_adapter.cpp b/services/frameworks/src/permission_adapter/permission_adapter.cpp index b4b1eb2..74f1d92 100644 --- a/services/frameworks/src/permission_adapter/permission_adapter.cpp +++ b/services/frameworks/src/permission_adapter/permission_adapter.cpp @@ -15,34 +15,35 @@ #include "permission_adapter.h" -#include "accesstoken_kit.h" +// #include "accesstoken_kit.h" #include "ipc_skeleton.h" #include "device_auth_defines.h" #include "hc_log.h" using namespace OHOS; -using namespace OHOS::Security::AccessToken; +// using namespace OHOS::Security::AccessToken; int32_t CheckPermission(void) { - AccessTokenID tokenId = IPCSkeleton::GetCallingTokenID(); - ATokenTypeEnum tokenType = AccessTokenKit::GetTokenTypeFlag(tokenId); - if (tokenType == TOKEN_NATIVE) { - NativeTokenInfo findInfo; - if (AccessTokenKit::GetNativeTokenInfo(tokenId, findInfo) != 0) { - LOGE("GetNativeTokenInfo failed!"); - return HC_ERROR; - } - if ((findInfo.apl == APL_SYSTEM_CORE) || (findInfo.apl == APL_SYSTEM_BASIC)) { - LOGI("Check permission(APL3=SYSTEM_CORE or APL2=SYSTEM_BASIC) success!"); - return HC_SUCCESS; - } else { - LOGE("Check permission(APL3=SYSTEM_CORE or APL2=SYSTEM_BASIC) failed! APL: %d", findInfo.apl); - return HC_ERROR; - } - } else { - LOGE("Invalid token type: %d", tokenType); - return HC_ERROR; - } + // AccessTokenID tokenId = IPCSkeleton::GetCallingTokenID(); + // ATokenTypeEnum tokenType = AccessTokenKit::GetTokenTypeFlag(tokenId); + // if (tokenType == TOKEN_NATIVE) { + // NativeTokenInfo findInfo; + // if (AccessTokenKit::GetNativeTokenInfo(tokenId, findInfo) != 0) { + // LOGE("GetNativeTokenInfo failed!"); + // return HC_ERROR; + // } + // if ((findInfo.apl == APL_SYSTEM_CORE) || (findInfo.apl == APL_SYSTEM_BASIC)) { + // LOGI("Check permission(APL3=SYSTEM_CORE or APL2=SYSTEM_BASIC) success!"); + // return HC_SUCCESS; + // } else { + // LOGE("Check permission(APL3=SYSTEM_CORE or APL2=SYSTEM_BASIC) failed! APL: %d", findInfo.apl); + // return HC_ERROR; + // } + // } else { + // LOGE("Invalid token type: %d", tokenType); + // return HC_ERROR; + // } + return HC_SUCCESS; } \ No newline at end of file -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2