Signed-off-by: zhoushicheng2@huawei.com <zhoushicheng2@huawei.com>
Change-Id: I153d2151a4eb0d936b7bf96944076e873a79720e
This commit is contained in:
zhoushicheng2@huawei.com 2022-05-26 01:26:58 +08:00
parent 3a6c0b0145
commit 00294e240a
10 changed files with 318 additions and 167 deletions

View File

@ -16,53 +16,53 @@ domain: AAFWK
# form behavior event
ADD_FORM:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: form manager}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: form manager}
FORM_ID: {type: INT64, desc: formId}
BUNDLE_NAME: {type: STRING, desc: bundle name}
MODULE_NAME: {type: STRING, desc: module name}
ABILITY_NAME: {type: STRING, desc: ability name}
REQUEST_FORM:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: form manager}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: form manager}
FORM_ID: {type: INT64, desc: formId}
BUNDLE_NAME: {type: STRING, desc: bundle name}
MODULE_NAME: {type: STRING, desc: module name}
ABILITY_NAME: {type: STRING, desc: ability name}
DELETE_FORM:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: form manager}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: form manager}
FORM_ID: {type: INT64, desc: formId}
CASTTEMP_FORM:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: form manager}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: form manager}
FORM_ID: {type: INT64, desc: formId}
ACQUIREFORMSTATE_FORM:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: form manager}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: form manager}
BUNDLE_NAME: {type: STRING, desc: bundle name}
MODULE_NAME: {type: STRING, desc: module name}
ABILITY_NAME: {type: STRING, desc: ability name}
MESSAGE_EVENT_FORM:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: form manager}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: form manager}
BUNDLE_NAME: {type: STRING, desc: bundle name}
MODULE_NAME: {type: STRING, desc: module name}
ABILITY_NAME: {type: STRING, desc: ability name}
ROUTE_EVENT_FORM:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: form manager}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: form manager}
FORM_ID: {type: INT64, desc: formId}
BUNDLE_NAME: {type: STRING, desc: bundle name}
MODULE_NAME: {type: STRING, desc: module name}
ABILITY_NAME: {type: STRING, desc: ability name}
RELEASE_FORM:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: form manager}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: form manager}
FORM_ID: {type: INT64, desc: formId}
DELETE_INVALID_FORM:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: form manager}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: form manager}
SET_NEXT_REFRESH_TIME_FORM:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: form manager}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: form manager}
FORM_ID: {type: INT64, desc: formId}

View File

@ -41,6 +41,7 @@
#include "string_ex.h"
#include "system_ability_definition.h"
#include "event_report.h"
#include "hisysevent.h"
namespace OHOS {
namespace AppExecFwk {
@ -97,7 +98,7 @@ int FormMgrService::AddForm(const int64_t formId, const Want &want,
eventInfo.bundleName = want.GetElement().GetBundleName();
eventInfo.moduleName = want.GetElement().GetModuleName();
eventInfo.abilityName = want.GetElement().GetAbilityName();
AAFWK::EventReport::SendFormEvent(AAFWK::ADD_FORM, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendFormEvent(AAFWK::ADD_FORM, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
if (ret != ERR_OK) {
HILOG_ERROR("%{public}s fail, add form permission denied", __func__);
return ret;
@ -120,7 +121,7 @@ int FormMgrService::DeleteForm(const int64_t formId, const sptr<IRemoteObject> &
}
AAFWK::EventInfo eventInfo;
eventInfo.userId = formId;
AAFWK::EventReport::SendFormEvent(AAFWK::DELETE_FORM, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendFormEvent(AAFWK::DELETE_FORM, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
return FormMgrAdapter::GetInstance().DeleteForm(formId, callerToken);
}
@ -141,7 +142,7 @@ int FormMgrService::ReleaseForm(const int64_t formId, const sptr<IRemoteObject>
}
AAFWK::EventInfo eventInfo;
eventInfo.userId = formId;
AAFWK::EventReport::SendFormEvent(AAFWK::RELEASE_FORM, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendFormEvent(AAFWK::RELEASE_FORM, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
return FormMgrAdapter::GetInstance().ReleaseForm(formId, callerToken, delCache);
}
@ -191,7 +192,7 @@ int FormMgrService::RequestForm(const int64_t formId, const sptr<IRemoteObject>
eventInfo.bundleName = want.GetElement().GetBundleName();
eventInfo.moduleName = want.GetElement().GetModuleName();
eventInfo.abilityName = want.GetElement().GetAbilityName();
AAFWK::EventReport::SendFormEvent(AAFWK::REQUEST_FORM, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendFormEvent(AAFWK::REQUEST_FORM, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
return FormMgrAdapter::GetInstance().RequestForm(formId, callerToken, want);
}
@ -208,7 +209,7 @@ int FormMgrService::SetNextRefreshTime(const int64_t formId, const int64_t nextT
HILOG_INFO("%{public}s called.", __func__);
AAFWK::EventInfo eventInfo;
eventInfo.userId = formId;
AAFWK::EventReport::SendFormEvent(AAFWK::SET_NEXT_REFRESH_TIME_FORM, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendFormEvent(AAFWK::SET_NEXT_REFRESH_TIME_FORM, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
return FormMgrAdapter::GetInstance().SetNextRefreshTime(formId, nextTime);
}
@ -248,7 +249,7 @@ int FormMgrService::CastTempForm(const int64_t formId, const sptr<IRemoteObject>
}
AAFWK::EventInfo eventInfo;
eventInfo.userId = formId;
AAFWK::EventReport::SendFormEvent(AAFWK::CASTTEMP_FORM, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendFormEvent(AAFWK::CASTTEMP_FORM, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
return FormMgrAdapter::GetInstance().CastTempForm(formId, callerToken);
}
@ -335,7 +336,7 @@ int FormMgrService::MessageEvent(const int64_t formId, const Want &want, const s
eventInfo.bundleName = want.GetElement().GetBundleName();
eventInfo.moduleName = want.GetElement().GetModuleName();
eventInfo.abilityName = want.GetElement().GetAbilityName();
AAFWK::EventReport::SendFormEvent(AAFWK::MESSAGE_EVENT_FORM, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendFormEvent(AAFWK::MESSAGE_EVENT_FORM, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
return FormMgrAdapter::GetInstance().MessageEvent(formId, want, callerToken);
}
@ -358,7 +359,7 @@ int FormMgrService::RouterEvent(const int64_t formId, Want &want)
eventInfo.bundleName = want.GetElement().GetBundleName();
eventInfo.moduleName = want.GetElement().GetModuleName();
eventInfo.abilityName = want.GetElement().GetAbilityName();
AAFWK::EventReport::SendFormEvent(AAFWK::ROUTE_EVENT_FORM, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendFormEvent(AAFWK::ROUTE_EVENT_FORM, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
return FormMgrAdapter::GetInstance().RouterEvent(formId, want);
}
@ -531,7 +532,7 @@ int FormMgrService::DeleteInvalidForms(const std::vector<int64_t> &formIds, cons
return ret;
}
AAFWK::EventInfo eventInfo;
AAFWK::EventReport::SendFormEvent(AAFWK::DELETE_INVALID_FORM, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendFormEvent(AAFWK::DELETE_INVALID_FORM, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
return FormMgrAdapter::GetInstance().DeleteInvalidForms(formIds, callerToken, numFormsDeleted);
}
@ -554,7 +555,7 @@ int FormMgrService::AcquireFormState(const Want &want, const sptr<IRemoteObject>
eventInfo.bundleName = want.GetElement().GetBundleName();
eventInfo.moduleName = want.GetElement().GetModuleName();
eventInfo.abilityName = want.GetElement().GetAbilityName();
AAFWK::EventReport::SendFormEvent(AAFWK::ACQUIREFORMSTATE_FORM, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendFormEvent(AAFWK::ACQUIREFORMSTATE_FORM, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
return FormMgrAdapter::GetInstance().AcquireFormState(want, callerToken, stateInfo);
}

View File

@ -49,11 +49,11 @@ THREAD_BLOCK_6S:
# fault event
START_ABILITY_ERROR:
__BASE: {type: FAULT, level: MINOR, tag: IDENTIFICATION, desc: start ability error}
__BASE: {type: FAULT, level: MINOR, tag: ability, desc: start ability error}
ABILITY_NAME: {type: STRING, desc: ability name}
TERMINATE_ABILITY_ERROR:
__BASE: {type: FAULT, level: MINOR, tag: IDENTIFICATION, desc: terminate ability error}
__BASE: {type: FAULT, level: MINOR, tag: ability, desc: terminate ability error}
USER_ID: {type: INT32, desc: userId}
ERROR_CODE: {type: INT32, desc: error code}
BUNDLE_NAME: {type: STRING, desc: bundle name}
@ -61,7 +61,7 @@ TERMINATE_ABILITY_ERROR:
ABILITY_NAME: {type: STRING, desc: ability name}
START_EXTENSION_ERROR:
__BASE: {type: FAULT, level: MINOR, tag: IDENTIFICATION, desc: start extensionAbility error}
__BASE: {type: FAULT, level: MINOR, tag: ability, desc: start extensionAbility error}
USER_ID: {type: INT32, desc: userId}
ERROR_CODE: {type: INT32, desc: error code}
BUNDLE_NAME: {type: STRING, desc: bundle name}
@ -69,7 +69,7 @@ START_EXTENSION_ERROR:
ABILITY_NAME: {type: STRING, desc: ability name}
STOP_EXTENSION_ERROR:
__BASE: {type: FAULT, level: MINOR, tag: IDENTIFICATION, desc: stop extensionAbility error}
__BASE: {type: FAULT, level: MINOR, tag: ability, desc: stop extensionAbility error}
USER_ID: {type: INT32, desc: userId}
ERROR_CODE: {type: INT32, desc: error code}
BUNDLE_NAME: {type: STRING, desc: bundle name}
@ -77,7 +77,7 @@ STOP_EXTENSION_ERROR:
ABILITY_NAME: {type: STRING, desc: ability name}
CONNECT_SERVICE_ERROR:
__BASE: {type: FAULT, level: MINOR, tag: IDENTIFICATION, desc: connnect serviceExtensionAbility error}
__BASE: {type: FAULT, level: MINOR, tag: ability, desc: connnect serviceExtensionAbility error}
USER_ID: {type: INT32, desc: userId}
ERROR_CODE: {type: INT32, desc: error code}
BUNDLE_NAME: {type: STRING, desc: bundle name}
@ -85,7 +85,7 @@ CONNECT_SERVICE_ERROR:
ABILITY_NAME: {type: STRING, desc: ability name}
DISCONNECT_SERVICE_ERROR:
__BASE: {type: FAULT, level: MINOR, tag: IDENTIFICATION, desc: disconnect serviceExtensionAbility error}
__BASE: {type: FAULT, level: MINOR, tag: ability, desc: disconnect serviceExtensionAbility error}
USER_ID: {type: INT32, desc: userId}
ERROR_CODE: {type: INT32, desc: error code}
BUNDLE_NAME: {type: STRING, desc: bundle name}
@ -95,30 +95,30 @@ DISCONNECT_SERVICE_ERROR:
# ability behavior event
START_ABILITY:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: start ability}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: start ability}
USER_ID: {type: INT32, desc: userId}
BUNDLE_NAME: {type: STRING, desc: bundle name}
MODULE_NAME: {type: STRING, desc: module name}
ABILITY_NAME: {type: STRING, desc: ability name}
DO_FOREGROUND_ABILITY:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: foreground ability}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: foreground ability}
SCENE_FLAG: {type: STRING, desc: scene flag}
DO_BACKGROUND_ABILITY:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: background ability}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: background ability}
SCENE_FLAG: {type: STRING, desc: scene flag}
CLOSE_ABILITY:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: close ability}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: close ability}
TERMINATE_ABILITY:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: terminate ability}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: terminate ability}
# serviceExtensionAbility behavior event
START_SERVICE_EXTENSION:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: start serviceExtensionAbility}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: start serviceExtensionAbility}
USER_ID: {type: INT32, desc: userId}
BUNDLE_NAME: {type: STRING, desc: bundle name}
MODULE_NAME: {type: STRING, desc: module name}
@ -126,61 +126,61 @@ START_SERVICE_EXTENSION:
EXTENSION_TYPE: {type: STRING, desc: extension type}
STOP_SERVICE_EXTENSION:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: stop serviceExtensionAbility}
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: stop serviceExtensionAbility}
USER_ID: {type: INT32, desc: userId}
BUNDLE_NAME: {type: STRING, desc: bundle name}
MODULE_NAME: {type: STRING, desc: module name}
ABILITY_NAME: {type: STRING, desc: ability name}
EXTENSION_TYPE: {type: STRING, desc: extension type}
CONNECT_SERVICE_EXTENSION:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: connect serviceExtensionAbility}
CONNECT_SERVICE:
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: connect serviceAbility}
USER_ID: {type: INT32, desc: userId}
BUNDLE_NAME: {type: STRING, desc: bundle name}
MODULE_NAME: {type: STRING, desc: module name}
ABILITY_NAME: {type: STRING, desc: ability name}
DISCONNECT_SERVICE_EXTENSION:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: disconnect serviceExtensionAbility}
DISCONNECT_SERVICE:
__BASE: {type: BEHAVIOR, level: MINOR, tag: ability, desc: disconnect serviceAbility}
# app behavior event
APP_ATTACH:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: attach app}
NAME: {type: STRING, desc: application name}
__BASE: {type: BEHAVIOR, level: MINOR, tag: app, desc: attach app}
BUNDLE_NAME: {type: STRING, desc: bundle name}
VERSION_NAME: {type: STRING, desc: version name}
VERSION_CODE: {type: INT32, desc: version code}
PROCESS: {type: STRING, desc: process}
PID: {type: INT32, desc: pid}
TIME_STAMP: {type: INT32, desc: time stamp}
APP_LAUNCH:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: launch app}
NAME: {type: STRING, desc: application name}
__BASE: {type: BEHAVIOR, level: MINOR, tag: app, desc: launch app}
BUNDLE_NAME: {type: STRING, desc: bundle name}
VERSION_NAME: {type: STRING, desc: version name}
VERSION_CODE: {type: INT32, desc: version code}
PROCESS: {type: STRING, desc: process}
PID: {type: INT32, desc: pid}
TIME_STAMP: {type: INT32, desc: time stamp}
APP_FOREGROUND:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: foreground app}
NAME: {type: STRING, desc: application name}
__BASE: {type: BEHAVIOR, level: MINOR, tag: app, desc: foreground app}
BUNDLE_NAME: {type: STRING, desc: bundle name}
VERSION_NAME: {type: STRING, desc: version name}
VERSION_CODE: {type: INT32, desc: version code}
PROCESS: {type: STRING, desc: process}
PID: {type: INT32, desc: pid}
TIME_STAMP: {type: INT32, desc: time stamp}
APP_BACKGROUND:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: background app}
NAME: {type: STRING, desc: application name}
__BASE: {type: BEHAVIOR, level: MINOR, tag: app, desc: background app}
BUNDLE_NAME: {type: STRING, desc: bundle name}
VERSION_NAME: {type: STRING, desc: version name}
VERSION_CODE: {type: INT32, desc: version code}
PROCESS: {type: STRING, desc: process}
PID: {type: INT32, desc: pid}
TIME_STAMP: {type: INT32, desc: time stamp}
APP_TERMINATE:
__BASE: {type: BEHAVIOR, level: MINOR, tag: IDENTIFICATION, desc: terminate app}
NAME: {type: STRING, desc: application name}
__BASE: {type: BEHAVIOR, level: MINOR, tag: app, desc: terminate app}
BUNDLE_NAME: {type: STRING, desc: bundle name}
VERSION_NAME: {type: STRING, desc: version name}
VERSION_CODE: {type: INT32, desc: version code}
PROCESS: {type: STRING, desc: process}
PID: {type: INT32, desc: pid}
TIME_STAMP: {type: INT32, desc: time stamp}

View File

@ -1016,6 +1016,7 @@ private:
const sptr<IRemoteObject> &callerToken, int32_t userId);
int CheckOptExtensionAbility(const Want &want, AbilityRequest &abilityRequest,
int32_t validUserId, AppExecFwk::ExtensionAbilityType extensionType);
std::string GetExtensionType(AppExecFwk::ExtensionAbilityType extensionType);
constexpr static int REPOLL_TIME_MICRO_SECONDS = 1000000;
constexpr static int WAITING_BOOT_ANIMATION_TIMER = 5;

View File

@ -57,6 +57,7 @@
#include "xcollie/watchdog.h"
#include "parameter.h"
#include "event_report.h"
#include "hisysevent.h"
#ifdef SUPPORT_GRAPHICS
#include "display_manager.h"
@ -263,8 +264,13 @@ int AbilityManagerService::StartAbility(const Want &want, int32_t userId, int re
eventInfo.bundleName = want.GetElement().GetBundleName();
eventInfo.moduleName = want.GetElement().GetModuleName();
eventInfo.abilityName = want.GetElement().GetAbilityName();
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
return StartAbilityInner(want, nullptr, requestCode, -1, userId);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
int32_t ret = StartAbilityInner(want, nullptr, requestCode, -1, userId);
if (ret != ERR_OK) {
eventInfo.errCode = ret;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
}
return ret;
}
int AbilityManagerService::StartAbility(const Want &want, const sptr<IRemoteObject> &callerToken,
@ -277,11 +283,11 @@ int AbilityManagerService::StartAbility(const Want &want, const sptr<IRemoteObje
eventInfo.bundleName = want.GetElement().GetBundleName();
eventInfo.moduleName = want.GetElement().GetModuleName();
eventInfo.abilityName = want.GetElement().GetAbilityName();
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
if ((flags & Want::FLAG_ABILITY_CONTINUATION) == Want::FLAG_ABILITY_CONTINUATION) {
HILOG_ERROR("StartAbility with continuation flags is not allowed!");
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return ERR_INVALID_VALUE;
}
@ -296,7 +302,7 @@ int AbilityManagerService::StartAbility(const Want &want, const sptr<IRemoteObje
auto manager = std::make_shared<FreeInstallManager>(weak_from_this());
eventInfo.errCode = manager->FreeInstall(fiWant, validUserId, requestCode, callerToken,
CheckIfOperateRemote(want));
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return eventInfo.errCode;
}
@ -305,10 +311,15 @@ int AbilityManagerService::StartAbility(const Want &want, const sptr<IRemoteObje
if (CheckIfOperateRemote(want)) {
HILOG_INFO("AbilityManagerService::StartAbility. try to StartRemoteAbility");
eventInfo.errCode = StartRemoteAbility(want, requestCode);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return eventInfo.errCode;
}
return StartAbilityInner(want, callerToken, requestCode, -1, userId);
int32_t ret = StartAbilityInner(want, callerToken, requestCode, -1, userId);
if (ret != ERR_OK) {
eventInfo.errCode = ret;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
}
return ret;
}
int AbilityManagerService::StartAbilityInner(const Want &want, const sptr<IRemoteObject> &callerToken,
@ -403,18 +414,18 @@ int AbilityManagerService::StartAbility(const Want &want, const AbilityStartSett
eventInfo.bundleName = want.GetElement().GetBundleName();
eventInfo.moduleName = want.GetElement().GetModuleName();
eventInfo.abilityName = want.GetElement().GetAbilityName();
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
if (VerifyAccountPermission(userId) == CHECK_PERMISSION_FAILED) {
HILOG_ERROR("%{public}s: Permission verification failed", __func__);
eventInfo.errCode = CHECK_PERMISSION_FAILED;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return CHECK_PERMISSION_FAILED;
}
if (callerToken != nullptr && !VerificationAllToken(callerToken)) {
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return ERR_INVALID_VALUE;
}
int32_t oriValidUserId = GetValidUserId(userId);
@ -422,7 +433,7 @@ int AbilityManagerService::StartAbility(const Want &want, const AbilityStartSett
if (!JudgeMultiUserConcurrency(validUserId)) {
HILOG_ERROR("Multi-user non-concurrent mode is not satisfied.");
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return ERR_INVALID_VALUE;
}
@ -431,7 +442,7 @@ int AbilityManagerService::StartAbility(const Want &want, const AbilityStartSett
if (result != ERR_OK) {
HILOG_ERROR("Generate ability request local error.");
eventInfo.errCode = result;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return result;
}
auto abilityInfo = abilityRequest.abilityInfo;
@ -442,14 +453,14 @@ int AbilityManagerService::StartAbility(const Want &want, const AbilityStartSett
result = CheckStaticCfgPermission(abilityInfo);
if (result != AppExecFwk::Constants::PERMISSION_GRANTED) {
eventInfo.errCode = result;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return result;
}
result = AbilityUtil::JudgeAbilityVisibleControl(abilityInfo);
if (result != ERR_OK) {
HILOG_ERROR("%{public}s JudgeAbilityVisibleControl error.", __func__);
eventInfo.errCode = result;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return result;
}
@ -458,7 +469,7 @@ int AbilityManagerService::StartAbility(const Want &want, const AbilityStartSett
if (abilityInfo.type == AppExecFwk::AbilityType::DATA) {
HILOG_ERROR("Cannot start data ability, use 'AcquireDataAbility()' instead.");
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return ERR_INVALID_VALUE;
}
@ -469,7 +480,7 @@ int AbilityManagerService::StartAbility(const Want &want, const AbilityStartSett
abilityInfo.bundleName.c_str(),
result);
eventInfo.errCode = result;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return result;
}
}
@ -477,23 +488,28 @@ int AbilityManagerService::StartAbility(const Want &want, const AbilityStartSett
if (abilityInfo.type != AppExecFwk::AbilityType::PAGE) {
HILOG_ERROR("Only support for page type ability.");
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return ERR_INVALID_VALUE;
}
#endif
if (!IsAbilityControllerStart(want, abilityInfo.bundleName)) {
eventInfo.errCode = ERR_WOULD_BLOCK;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return ERR_WOULD_BLOCK;
}
auto missionListManager = GetListManagerByUserId(oriValidUserId);
if (missionListManager == nullptr) {
HILOG_ERROR("missionListManager is Null. userId=%{public}d", validUserId);
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return ERR_INVALID_VALUE;
}
return missionListManager->StartAbility(abilityRequest);
int32_t ret = missionListManager->StartAbility(abilityRequest);
if (ret != ERR_OK) {
eventInfo.errCode = ret;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
}
return ret;
}
int AbilityManagerService::StartAbility(const Want &want, const StartOptions &startOptions,
@ -506,18 +522,18 @@ int AbilityManagerService::StartAbility(const Want &want, const StartOptions &st
eventInfo.bundleName = want.GetElement().GetBundleName();
eventInfo.moduleName = want.GetElement().GetModuleName();
eventInfo.abilityName = want.GetElement().GetAbilityName();
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
if (VerifyAccountPermission(userId) == CHECK_PERMISSION_FAILED) {
HILOG_ERROR("%{public}s: Permission verification failed", __func__);
eventInfo.errCode = CHECK_PERMISSION_FAILED;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return CHECK_PERMISSION_FAILED;
}
if (callerToken != nullptr && !VerificationAllToken(callerToken)) {
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return ERR_INVALID_VALUE;
}
int32_t oriValidUserId = GetValidUserId(userId);
@ -525,7 +541,7 @@ int AbilityManagerService::StartAbility(const Want &want, const StartOptions &st
if (!JudgeMultiUserConcurrency(validUserId)) {
HILOG_ERROR("Multi-user non-concurrent mode is not satisfied.");
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return ERR_INVALID_VALUE;
}
@ -534,7 +550,7 @@ int AbilityManagerService::StartAbility(const Want &want, const StartOptions &st
if (result != ERR_OK) {
HILOG_ERROR("Generate ability request local error.");
eventInfo.errCode = result;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return result;
}
@ -546,21 +562,21 @@ int AbilityManagerService::StartAbility(const Want &want, const StartOptions &st
result = CheckStaticCfgPermission(abilityInfo);
if (result != AppExecFwk::Constants::PERMISSION_GRANTED) {
eventInfo.errCode = result;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return result;
}
result = AbilityUtil::JudgeAbilityVisibleControl(abilityInfo);
if (result != ERR_OK) {
HILOG_ERROR("%{public}s JudgeAbilityVisibleControl error.", __func__);
eventInfo.errCode = result;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return result;
}
if (abilityInfo.type != AppExecFwk::AbilityType::PAGE) {
HILOG_ERROR("Only support for page type ability.");
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return ERR_INVALID_VALUE;
}
@ -571,14 +587,14 @@ int AbilityManagerService::StartAbility(const Want &want, const StartOptions &st
abilityInfo.bundleName.c_str(),
result);
eventInfo.errCode = result;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return result;
}
}
if (!IsAbilityControllerStart(want, abilityInfo.bundleName)) {
eventInfo.errCode = ERR_WOULD_BLOCK;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return ERR_WOULD_BLOCK;
}
GrantUriPermission(want, validUserId);
@ -588,10 +604,15 @@ int AbilityManagerService::StartAbility(const Want &want, const StartOptions &st
if (missionListManager == nullptr) {
HILOG_ERROR("missionListManager is Null. userId=%{public}d", validUserId);
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
return ERR_INVALID_VALUE;
}
return missionListManager->StartAbility(abilityRequest);
int32_t ret = missionListManager->StartAbility(abilityRequest);
if (ret != ERR_OK) {
eventInfo.errCode = ret;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
}
return ret;
}
int AbilityManagerService::CheckOptExtensionAbility(const Want &want, AbilityRequest &abilityRequest,
@ -637,11 +658,12 @@ int AbilityManagerService::StartExtensionAbility(const Want &want, const sptr<IR
eventInfo.bundleName = want.GetElement().GetBundleName();
eventInfo.moduleName = want.GetElement().GetModuleName();
eventInfo.abilityName = want.GetElement().GetAbilityName();
AAFWK::EventReport::SendExtensionEvent(AAFWK::START_SERVICE_EXTENSION, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
eventInfo.extensionType = GetExtensionType(extensionType);
AAFWK::EventReport::SendExtensionEvent(AAFWK::START_SERVICE_EXTENSION, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
if (VerifyAccountPermission(userId) == CHECK_PERMISSION_FAILED) {
HILOG_ERROR("%{public}s: Permission verification failed.", __func__);
eventInfo.errCode = CHECK_PERMISSION_FAILED;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_EXTENSION_ERROR, AAFWK::HiSysEventType::FAULT,
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_EXTENSION_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
eventInfo);
return CHECK_PERMISSION_FAILED;
}
@ -649,7 +671,7 @@ int AbilityManagerService::StartExtensionAbility(const Want &want, const sptr<IR
if (callerToken != nullptr && !VerificationAllToken(callerToken)) {
HILOG_ERROR("%{public}s VerificationAllToken failed.", __func__);
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_EXTENSION_ERROR, AAFWK::HiSysEventType::FAULT,
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_EXTENSION_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
eventInfo);
return ERR_INVALID_VALUE;
}
@ -657,7 +679,7 @@ int AbilityManagerService::StartExtensionAbility(const Want &want, const sptr<IR
if (!JudgeMultiUserConcurrency(validUserId)) {
HILOG_ERROR("Multi-user non-concurrent mode is not satisfied.");
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_EXTENSION_ERROR, AAFWK::HiSysEventType::FAULT,
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_EXTENSION_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
eventInfo);
return ERR_INVALID_VALUE;
}
@ -667,7 +689,7 @@ int AbilityManagerService::StartExtensionAbility(const Want &want, const sptr<IR
if (result != ERR_OK) {
HILOG_ERROR("Generate ability request local error.");
eventInfo.errCode = result;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_EXTENSION_ERROR, AAFWK::HiSysEventType::FAULT,
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_EXTENSION_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
eventInfo);
return result;
}
@ -681,7 +703,7 @@ int AbilityManagerService::StartExtensionAbility(const Want &want, const sptr<IR
if (result != ERR_OK) {
HILOG_ERROR("CheckOptExtensionAbility error.");
eventInfo.errCode = result;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_EXTENSION_ERROR, AAFWK::HiSysEventType::FAULT,
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_EXTENSION_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
eventInfo);
return result;
}
@ -690,7 +712,7 @@ int AbilityManagerService::StartExtensionAbility(const Want &want, const sptr<IR
if (!connectManager) {
HILOG_ERROR("connectManager is nullptr. userId=%{public}d", validUserId);
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_EXTENSION_ERROR, AAFWK::HiSysEventType::FAULT,
AAFWK::EventReport::SendAbilityEvent(AAFWK::START_EXTENSION_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
eventInfo);
return ERR_INVALID_VALUE;
}
@ -708,11 +730,12 @@ int AbilityManagerService::StopExtensionAbility(const Want &want, const sptr<IRe
eventInfo.bundleName = want.GetElement().GetBundleName();
eventInfo.moduleName = want.GetElement().GetModuleName();
eventInfo.abilityName = want.GetElement().GetAbilityName();
AAFWK::EventReport::SendExtensionEvent(AAFWK::STOP_SERVICE_EXTENSION, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
eventInfo.extensionType = GetExtensionType(extensionType);
AAFWK::EventReport::SendExtensionEvent(AAFWK::STOP_SERVICE_EXTENSION, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
if (VerifyAccountPermission(userId) == CHECK_PERMISSION_FAILED) {
HILOG_ERROR("%{public}s: Permission verification failed.", __func__);
eventInfo.errCode = CHECK_PERMISSION_FAILED;
AAFWK::EventReport::SendAbilityEvent(AAFWK::STOP_EXTENSION_ERROR, AAFWK::HiSysEventType::FAULT,
AAFWK::EventReport::SendAbilityEvent(AAFWK::STOP_EXTENSION_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
eventInfo);
return CHECK_PERMISSION_FAILED;
}
@ -720,7 +743,7 @@ int AbilityManagerService::StopExtensionAbility(const Want &want, const sptr<IRe
if (callerToken != nullptr && !VerificationAllToken(callerToken)) {
HILOG_ERROR("%{public}s VerificationAllToken failed.", __func__);
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::STOP_EXTENSION_ERROR, AAFWK::HiSysEventType::FAULT,
AAFWK::EventReport::SendAbilityEvent(AAFWK::STOP_EXTENSION_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
eventInfo);
return ERR_INVALID_VALUE;
}
@ -728,7 +751,7 @@ int AbilityManagerService::StopExtensionAbility(const Want &want, const sptr<IRe
if (!JudgeMultiUserConcurrency(validUserId)) {
HILOG_ERROR("Multi-user non-concurrent mode is not satisfied.");
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::STOP_EXTENSION_ERROR, AAFWK::HiSysEventType::FAULT,
AAFWK::EventReport::SendAbilityEvent(AAFWK::STOP_EXTENSION_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
eventInfo);
return ERR_INVALID_VALUE;
}
@ -738,7 +761,7 @@ int AbilityManagerService::StopExtensionAbility(const Want &want, const sptr<IRe
if (result != ERR_OK) {
HILOG_ERROR("Generate ability request local error.");
eventInfo.errCode = result;
AAFWK::EventReport::SendAbilityEvent(AAFWK::STOP_EXTENSION_ERROR, AAFWK::HiSysEventType::FAULT,
AAFWK::EventReport::SendAbilityEvent(AAFWK::STOP_EXTENSION_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
eventInfo);
return result;
}
@ -752,7 +775,7 @@ int AbilityManagerService::StopExtensionAbility(const Want &want, const sptr<IRe
if (result != ERR_OK) {
HILOG_ERROR("CheckOptExtensionAbility error.");
eventInfo.errCode = result;
AAFWK::EventReport::SendAbilityEvent(AAFWK::STOP_EXTENSION_ERROR, AAFWK::HiSysEventType::FAULT,
AAFWK::EventReport::SendAbilityEvent(AAFWK::STOP_EXTENSION_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
eventInfo);
return result;
}
@ -761,7 +784,7 @@ int AbilityManagerService::StopExtensionAbility(const Want &want, const sptr<IRe
if (!connectManager) {
HILOG_ERROR("connectManager is nullptr. userId=%{public}d", validUserId);
eventInfo.errCode = ERR_INVALID_VALUE;
AAFWK::EventReport::SendAbilityEvent(AAFWK::STOP_EXTENSION_ERROR, AAFWK::HiSysEventType::FAULT,
AAFWK::EventReport::SendAbilityEvent(AAFWK::STOP_EXTENSION_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT,
eventInfo);
return ERR_INVALID_VALUE;
}
@ -832,9 +855,9 @@ int AbilityManagerService::TerminateAbility(const sptr<IRemoteObject> &token, in
eventInfo.moduleName = resultWant->GetElement().GetModuleName();
eventInfo.abilityName = resultWant->GetElement().GetAbilityName();
eventInfo.errCode = TerminateAbilityWithFlag(token, resultCode, resultWant, true);
AAFWK::EventReport::SendAbilityEvent(AAFWK::TERMINATE_ABILITY, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::TERMINATE_ABILITY, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
if (eventInfo.errCode != ERR_OK) {
AAFWK::EventReport::SendAbilityEvent(AAFWK::TERMINATE_ABILITY_ERROR, AAFWK::HiSysEventType::FAULT, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::TERMINATE_ABILITY_ERROR, OHOS::HiviewDFX::HiSysEvent::EventType::FAULT, eventInfo);
}
return eventInfo.errCode;
}
@ -842,7 +865,7 @@ int AbilityManagerService::TerminateAbility(const sptr<IRemoteObject> &token, in
int AbilityManagerService::CloseAbility(const sptr<IRemoteObject> &token, int resultCode, const Want *resultWant)
{
AAFWK::EventInfo eventInfo;
AAFWK::EventReport::SendAbilityEvent(AAFWK::CLOSE_ABILITY, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::CLOSE_ABILITY, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
return TerminateAbilityWithFlag(token, resultCode, resultWant, false);
}
@ -1090,7 +1113,7 @@ int AbilityManagerService::ConnectAbility(
eventInfo.bundleName = want.GetElement().GetBundleName();
eventInfo.moduleName = want.GetElement().GetModuleName();
eventInfo.abilityName = want.GetElement().GetAbilityName();
AAFWK::EventReport::SendExtensionEvent(AAFWK::CONNECT_SERVICE_EXTENSION, AAFWK::HiSysEventType::BEHAVIOR,
AAFWK::EventReport::SendExtensionEvent(AAFWK::CONNECT_SERVICE, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR,
eventInfo);
if (VerifyAccountPermission(userId) == CHECK_PERMISSION_FAILED) {
@ -1147,7 +1170,7 @@ int AbilityManagerService::DisconnectAbility(const sptr<IAbilityConnection> &con
DisconnectLocalAbility(connect);
DisconnectRemoteAbility(connect->AsObject());
AAFWK::EventInfo eventInfo;
AAFWK::EventReport::SendExtensionEvent(AAFWK::DISCONNECT_SERVICE_EXTENSION, AAFWK::HiSysEventType::BEHAVIOR,
AAFWK::EventReport::SendExtensionEvent(AAFWK::DISCONNECT_SERVICE, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR,
eventInfo);
return ERR_OK;
}
@ -4057,7 +4080,7 @@ int AbilityManagerService::DoAbilityForeground(const sptr<IRemoteObject> &token,
abilityRecord->ProcessForegroundAbility(flag);
AAFWK::EventInfo eventInfo;
eventInfo.sceneFlag = flag;
AAFWK::EventReport::SendAbilityEvent(AAFWK::DO_FOREGROUND_ABILITY, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::DO_FOREGROUND_ABILITY, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
return ERR_OK;
}
@ -4074,7 +4097,7 @@ int AbilityManagerService::DoAbilityBackground(const sptr<IRemoteObject> &token,
abilityRecord->lifeCycleStateInfo_.sceneFlag = SCENE_FLAG_NORMAL;
AAFWK::EventInfo eventInfo;
eventInfo.sceneFlag = flag;
AAFWK::EventReport::SendAbilityEvent(AAFWK::DO_FOREGROUND_ABILITY, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendAbilityEvent(AAFWK::DO_FOREGROUND_ABILITY, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
return ret;
}
@ -4615,6 +4638,49 @@ int AbilityManagerService::DumpAbilityInfoDone(std::vector<std::string> &infos,
return ERR_OK;
}
std::string AbilityManagerService::GetExtensionType(AppExecFwk::ExtensionAbilityType extensionType)
{
std::string extensionTypeStr;
if (extensionType == AppExecFwk::ExtensionAbilityType::FORM)
{
extensionTypeStr = "FOMR";
} else if (extensionType == AppExecFwk::ExtensionAbilityType::WORK_SCHEDULER)
{
extensionTypeStr = "WORK_SCHEDULER";
} else if (extensionType == AppExecFwk::ExtensionAbilityType::INPUTMETHOD)
{
extensionTypeStr = "INPUTMETHOD";
} else if (extensionType == AppExecFwk::ExtensionAbilityType::SERVICE)
{
extensionTypeStr = "SERVICE";
} else if (extensionType == AppExecFwk::ExtensionAbilityType::ACCESSIBILITY)
{
extensionTypeStr = "ACCESSIBILITY";
} else if (extensionType == AppExecFwk::ExtensionAbilityType::DATASHARE)
{
extensionTypeStr = "DATASHARE";
} else if (extensionType == AppExecFwk::ExtensionAbilityType::FILESHARE)
{
extensionTypeStr = "FILESHARE";
} else if (extensionType == AppExecFwk::ExtensionAbilityType::STATICSUBSCRIBER)
{
extensionTypeStr = "STATICSUBSCRIBER";
} else if (extensionType == AppExecFwk::ExtensionAbilityType::WALLPAPER)
{
extensionTypeStr = "WALLPAPER";
} else if (extensionType == AppExecFwk::ExtensionAbilityType::BACKUP)
{
extensionTypeStr = "BACKUP";
} else if (extensionType == AppExecFwk::ExtensionAbilityType::WINDOW)
{
extensionTypeStr = "WINDOW";
} else
{
extensionTypeStr = "UNSPECIFIED";
}
return extensionTypeStr;
}
#ifdef SUPPORT_GRAPHICS
int AbilityManagerService::SetMissionLabel(const sptr<IRemoteObject> &token, const std::string &label)
{

View File

@ -50,6 +50,7 @@
#endif
#include "uri_permission_manager_client.h"
#include "event_report.h"
#include "hisysevent.h"
namespace OHOS {
namespace AppExecFwk {
@ -279,7 +280,7 @@ void AppMgrServiceInner::AttachApplication(const pid_t pid, const sptr<IAppSched
eventInfo.timeStamp =
std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch())
.count();
AAFWK::EventReport::SendAppEvent(AAFWK::APP_ATTACH, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendAppEvent(AAFWK::APP_ATTACH, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
}
void AppMgrServiceInner::LaunchApplication(const std::shared_ptr<AppRunningRecord> &appRecord)
@ -324,7 +325,7 @@ void AppMgrServiceInner::LaunchApplication(const std::shared_ptr<AppRunningRecor
eventInfo.timeStamp =
std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch())
.count();
AAFWK::EventReport::SendAppEvent(AAFWK::APP_LAUNCH, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendAppEvent(AAFWK::APP_LAUNCH, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
}
void AppMgrServiceInner::AddAbilityStageDone(const int32_t recordId)
@ -368,7 +369,7 @@ void AppMgrServiceInner::ApplicationForegrounded(const int32_t recordId)
eventInfo.timeStamp =
std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch())
.count();
AAFWK::EventReport::SendAppEvent(AAFWK::APP_FOREGROUND, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendAppEvent(AAFWK::APP_FOREGROUND, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
}
void AppMgrServiceInner::ApplicationBackgrounded(const int32_t recordId)
@ -398,7 +399,7 @@ void AppMgrServiceInner::ApplicationBackgrounded(const int32_t recordId)
eventInfo.timeStamp =
std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch())
.count();
AAFWK::EventReport::SendAppEvent(AAFWK::APP_BACKGROUND, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendAppEvent(AAFWK::APP_BACKGROUND, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
}
void AppMgrServiceInner::ApplicationTerminated(const int32_t recordId)
@ -428,9 +429,6 @@ void AppMgrServiceInner::ApplicationTerminated(const int32_t recordId)
OnAppStateChanged(appRecord, ApplicationState::APP_STATE_TERMINATED);
appRunningManager_->RemoveAppRunningRecordById(recordId);
RemoveAppFromRecentListById(recordId);
DelayedSingleton<AppStateObserverManager>::GetInstance()->OnProcessDied(appRecord);
HILOG_INFO("application is terminated");
AAFWK::EventInfo eventInfo;
auto applicationInfo = appRecord->GetApplicationInfo();
eventInfo.pid = appRecord->GetPriorityObject()->GetPid();
@ -440,7 +438,10 @@ void AppMgrServiceInner::ApplicationTerminated(const int32_t recordId)
eventInfo.timeStamp =
std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch())
.count();
AAFWK::EventReport::SendAppEvent(AAFWK::APP_TERMINATE, AAFWK::HiSysEventType::BEHAVIOR, eventInfo);
AAFWK::EventReport::SendAppEvent(AAFWK::APP_TERMINATE, OHOS::HiviewDFX::HiSysEvent::EventType::BEHAVIOR, eventInfo);
DelayedSingleton<AppStateObserverManager>::GetInstance()->OnProcessDied(appRecord);
HILOG_INFO("application is terminated");
}
int32_t AppMgrServiceInner::KillApplication(const std::string &bundleName)

View File

@ -52,7 +52,6 @@ ohos_shared_library("perm_verification") {
]
external_deps = [
"ability_base:want",
"access_token:libaccesstoken_sdk",
"bundle_framework:appexecfwk_base",
"hisysevent_native:libhisysevent",

View File

@ -19,14 +19,12 @@
#include <string>
#include <unordered_map>
#include "application_info.h"
#include "want.h"
#include "errors.h"
#include "hisysevent.h"
namespace OHOS {
namespace AAFWK {
namespace {
// event type
// fault event
const std::string START_ABILITY_ERROR = "START_ABILITY_ERROR";
const std::string TERMINATE_ABILITY_ERROR = "TERMINATE_ABILITY_ERROR";
@ -43,8 +41,8 @@ const std::string DO_BACKGROUND_ABILITY = "DO_BACKGROUND_ABILITY";
// serviceExtensionAbility behavior event
const std::string START_SERVICE_EXTENSION = "START_SERVICE_EXTENSION";
const std::string STOP_SERVICE_EXTENSION = "STOP_SERVICE_EXTENSION";
const std::string CONNECT_SERVICE_EXTENSION = "CONNECT_SERVICE_EXTENSION";
const std::string DISCONNECT_SERVICE_EXTENSION = "DISCONNECT_SERVICE_EXTENSION";
const std::string CONNECT_SERVICE = "CONNECT_SERVICE";
const std::string DISCONNECT_SERVICE = "DISCONNECT_SERVICE";
// form behavior event
const std::string ADD_FORM = "ADD_FORM";
const std::string REQUEST_FORM = "REQUEST_FORM";
@ -64,13 +62,6 @@ const std::string APP_BACKGROUND = "APP_BACKGROUND";
const std::string APP_TERMINATE = "APP_TERMINATE";
}
enum HiSysEventType {
FAULT = 1,
STATISTIC = 2,
SECURITY = 3,
BEHAVIOR = 4,
};
struct EventInfo {
int32_t pid = -1;
int32_t userId = -1;
@ -82,6 +73,7 @@ struct EventInfo {
std::string bundleName;
std::string moduleName;
std::string abilityName;
std::string extensionType;
// olny used in fault event
ErrCode errCode = ERR_OK;
@ -98,15 +90,20 @@ struct EventInfo {
bundleName.clear();
moduleName.clear();
abilityName.clear();
extensionType.clear();
errCode = ERR_OK;
}
};
class EventReport {
public:
static void SendAppEvent(const std::string &eventName, HiSysEventType type, const EventInfo& eventInfo);
static void SendAbilityEvent(const std::string &eventName, HiSysEventType type, const EventInfo& eventInfo);
static void SendExtensionEvent(const std::string &eventName, HiSysEventType type, const EventInfo& eventInfo);
static void SendFormEvent(const std::string &eventName, HiSysEventType type, const EventInfo& eventInfo);
static void SendAppEvent(const std::string &eventName, OHOS::HiviewDFX::HiSysEvent::EventType type,
const EventInfo& eventInfo);
static void SendAbilityEvent(const std::string &eventName, OHOS::HiviewDFX::HiSysEvent::EventType type,
const EventInfo& eventInfo);
static void SendExtensionEvent(const std::string &eventName, OHOS::HiviewDFX::HiSysEvent::EventType type,
const EventInfo& eventInfo);
static void SendFormEvent(const std::string &eventName, OHOS::HiviewDFX::HiSysEvent::EventType type,
const EventInfo& eventInfo);
};
} // namespace AAFWK
} // namespace OHOS

View File

@ -19,8 +19,6 @@
#include <chrono>
using HiSysEvent = OHOS::HiviewDFX::HiSysEvent;
namespace OHOS {
namespace AAFWK {
namespace {
@ -37,14 +35,16 @@ const std::string EVENT_KEY_MODULE_NAME = "MODULE_NAME";
const std::string EVENT_KEY_ABILITY_NAME = "ABILITY_NAME";
const std::string EVENT_KEY_VERSION_NAME = "VERSION_NAME";
const std::string EVENT_KEY_VERSION_CODE = "VERSION_CODE";
const std::string EVENT_KEY_EXTENSION_TYPE = "EXTENSION_TYPE";
}
void EventReport::SendAppEvent(const std::string &eventName, HiSysEventType type, const EventInfo& eventInfo)
void EventReport::SendAppEvent(const std::string &eventName, OHOS::HiviewDFX::HiSysEvent::EventType type,
const EventInfo& eventInfo)
{
HiSysEvent::Write(
HiSysEvent::Domain::AAFWK,
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
static_cast<HiSysEvent::EventType>(type),
type,
EVENT_KEY_BUNDLE_NAME, eventInfo.bundleName,
EVENT_KEY_VERSION_NAME, eventInfo.versionName,
EVENT_KEY_VERSION_CODE, eventInfo.versionCode,
@ -52,43 +52,128 @@ void EventReport::SendAppEvent(const std::string &eventName, HiSysEventType type
EVENT_KEY_TIME_STAMP, eventInfo.timeStamp);
}
void EventReport::SendAbilityEvent(const std::string &eventName, HiSysEventType type, const EventInfo& eventInfo)
void EventReport::SendAbilityEvent(const std::string &eventName, OHOS::HiviewDFX::HiSysEvent::EventType type,
const EventInfo& eventInfo)
{
HiSysEvent::Write(
HiSysEvent::Domain::AAFWK,
eventName,
static_cast<HiSysEvent::EventType>(type),
EVENT_KEY_USERID, eventInfo.userId,
EVENT_KEY_SCENE_FLAG, eventInfo.sceneFlag,
EVENT_KEY_BUNDLE_NAME, eventInfo.bundleName,
EVENT_KEY_MODULE_NAME, eventInfo.moduleName,
EVENT_KEY_ABILITY_NAME, eventInfo.abilityName,
EVENT_KEY_ERROR_CODE, eventInfo.errCode);
if (eventName == START_ABILITY_ERROR | eventName == TERMINATE_ABILITY_ERROR)
{
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
type,
EVENT_KEY_USERID, eventInfo.userId,
EVENT_KEY_BUNDLE_NAME, eventInfo.bundleName,
EVENT_KEY_MODULE_NAME, eventInfo.moduleName,
EVENT_KEY_ABILITY_NAME, eventInfo.abilityName,
EVENT_KEY_ERROR_CODE, eventInfo.errCode);
} else if (eventName == START_ABILITY_ERROR)
{
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
type,
EVENT_KEY_USERID, eventInfo.userId,
EVENT_KEY_BUNDLE_NAME, eventInfo.bundleName,
EVENT_KEY_MODULE_NAME, eventInfo.moduleName,
EVENT_KEY_ABILITY_NAME, eventInfo.abilityName);
} else if (eventName == DO_FOREGROUND_ABILITY | eventName == DO_BACKGROUND_ABILITY)
{
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
type,
EVENT_KEY_SCENE_FLAG, eventInfo.sceneFlag);
} else
{
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
type);
}
}
void EventReport::SendExtensionEvent(const std::string &eventName, HiSysEventType type, const EventInfo& eventInfo)
void EventReport::SendExtensionEvent(const std::string &eventName, OHOS::HiviewDFX::HiSysEvent::EventType type,
const EventInfo& eventInfo)
{
HiSysEvent::Write(
HiSysEvent::Domain::AAFWK,
eventName,
static_cast<HiSysEvent::EventType>(type),
EVENT_KEY_USERID, eventInfo.userId,
EVENT_KEY_BUNDLE_NAME, eventInfo.bundleName,
EVENT_KEY_MODULE_NAME, eventInfo.moduleName,
EVENT_KEY_ABILITY_NAME, eventInfo.abilityName,
EVENT_KEY_ERROR_CODE, eventInfo.errCode);
if (eventName == DISCONNECT_SERVICE)
{
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
type);
} else if (eventName ==CONNECT_SERVICE)
{
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
type,
EVENT_KEY_USERID, eventInfo.userId,
EVENT_KEY_BUNDLE_NAME, eventInfo.bundleName,
EVENT_KEY_MODULE_NAME, eventInfo.moduleName,
EVENT_KEY_ABILITY_NAME, eventInfo.abilityName);
} else if (eventName == START_SERVICE_EXTENSION | eventName == STOP_SERVICE_EXTENSION)
{
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
type,
EVENT_KEY_USERID, eventInfo.userId,
EVENT_KEY_BUNDLE_NAME, eventInfo.bundleName,
EVENT_KEY_MODULE_NAME, eventInfo.moduleName,
EVENT_KEY_ABILITY_NAME, eventInfo.abilityName,
EVENT_KEY_EXTENSION_TYPE, eventInfo.extensionType);
} else
{
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
type,
EVENT_KEY_USERID, eventInfo.userId,
EVENT_KEY_BUNDLE_NAME, eventInfo.bundleName,
EVENT_KEY_MODULE_NAME, eventInfo.moduleName,
EVENT_KEY_ABILITY_NAME, eventInfo.abilityName,
EVENT_KEY_ERROR_CODE, eventInfo.errCode);
}
}
void EventReport::SendFormEvent(const std::string &eventName, HiSysEventType type, const EventInfo& eventInfo)
void EventReport::SendFormEvent(const std::string &eventName, OHOS::HiviewDFX::HiSysEvent::EventType type,
const EventInfo& eventInfo)
{
HiSysEvent::Write(
HiSysEvent::Domain::AAFWK,
eventName,
static_cast<HiSysEvent::EventType>(type),
EVENT_KEY_ABILITY_NAME, eventInfo.formId,
EVENT_KEY_BUNDLE_NAME, eventInfo.bundleName,
EVENT_KEY_MODULE_NAME, eventInfo.moduleName,
EVENT_KEY_ABILITY_NAME, eventInfo.abilityName);
if (eventName == DELETE_INVALID_FORM)
{
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
type);
} else if (eventName == ACQUIREFORMSTATE_FORM | eventName == MESSAGE_EVENT_FORM)
{
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
type,
EVENT_KEY_BUNDLE_NAME, eventInfo.bundleName,
EVENT_KEY_MODULE_NAME, eventInfo.moduleName,
EVENT_KEY_ABILITY_NAME, eventInfo.abilityName);
} else if (eventName == ADD_FORM | eventName == REQUEST_FORM | eventName == ROUTE_EVENT_FORM)
{
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
type,
EVENT_KEY_ABILITY_NAME, eventInfo.formId,
EVENT_KEY_BUNDLE_NAME, eventInfo.bundleName,
EVENT_KEY_MODULE_NAME, eventInfo.moduleName,
EVENT_KEY_ABILITY_NAME, eventInfo.abilityName);
} else
{
OHOS::HiviewDFX::HiSysEvent::Write(
OHOS::HiviewDFX::HiSysEvent::Domain::AAFWK,
eventName,
type,
EVENT_KEY_ABILITY_NAME, eventInfo.formId);
}
}
} // namespace AAFWK
} // namespace OHOS

View File

@ -32,6 +32,7 @@ ohos_moduletest("specified_ability_service_test") {
"${aafwk_path}/services/abilitymgr/src/ability_manager_proxy.cpp",
"${aafwk_path}/services/abilitymgr/src/ability_manager_service.cpp",
"${aafwk_path}/services/abilitymgr/test/mock/libs/sa_mgr/src/sa_mgr_client_mock.cpp",
"${aafwk_path}/services/common/src/event_report.cpp",
"${aafwk_path}/services/common/src/permission_verification.cpp",
"${aafwk_path}/services/test/mock/src/mock_app_mgr_client.cpp",
"${aafwk_path}/services/test/mock/src/mock_bundle_mgr.cpp",
@ -59,7 +60,6 @@ ohos_moduletest("specified_ability_service_test") {
"${distributedschedule_path}/safwk/interfaces/innerkits/safwk:system_ability_fwk",
"${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
"${innerkits_path}/uri_permission:uri_permission_mgr",
"${services_path}/common:perm_verification",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
"//third_party/jsoncpp:jsoncpp",
@ -89,6 +89,7 @@ ohos_moduletest("specified_ability_service_test") {
"dataability:native_dataability",
"dsoftbus_standard:softbus_client",
"hicollie_native:libhicollie",
"hisysevent_native:libhisysevent",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog",
"ipc:ipc_core",