diff --git a/services/common/include/bundle_active_app_state_observer.h b/services/common/include/bundle_active_app_state_observer.h index ae985eabf45ab6ae6b351737c67c47b287cd5501..29ab05b68e188572e6807cdeae292c8a58568c14 100644 --- a/services/common/include/bundle_active_app_state_observer.h +++ b/services/common/include/bundle_active_app_state_observer.h @@ -46,7 +46,7 @@ private: return abilityStateData.uid > 0 && abilityStateData.pid >= 0 && abilityStateData.bundleName.size() > 0 && abilityStateData.abilityName.size() > 0 - && abilityStateData.token != nullptr; + && abilityStateData.abilityRecordId >= 0; } inline bool ValidateProcessData(const ProcessData &processData) const diff --git a/services/common/src/bundle_active_app_state_obsever.cpp b/services/common/src/bundle_active_app_state_obsever.cpp index 84d8613671b08b9c30d30dadd0aa8316f47eab52..3f66666c00542de06ef20e2d85ee0038cfef51e1 100644 --- a/services/common/src/bundle_active_app_state_obsever.cpp +++ b/services/common/src/bundle_active_app_state_obsever.cpp @@ -42,8 +42,6 @@ void BundleActiveAppStateObserver::OnAbilityStateChanged(const AbilityStateData int32_t userId = -1; OHOS::ErrCode ret = BundleActiveAccountHelper::GetUserId(abilityStateData.uid, userId); if (ret == ERR_OK && userId != -1) { - std::stringstream stream; - stream << abilityStateData.token.GetRefPtr(); BundleActiveReportHandlerObject tmpHandlerObject(userId, ""); BundleActiveEvent event(abilityStateData.bundleName, abilityStateData.abilityName, abilityStateData.abilityName, abilityStateData.moduleName);