From 659b1dcd38213f839f3b91399d9ca207909e9b9f Mon Sep 17 00:00:00 2001 From: huangshiwei Date: Sat, 7 Oct 2023 17:29:43 +0800 Subject: [PATCH] huangshiwei4@huawei.com Signed-off-by: huangshiwei --- .../ability_runtime/ability_context_impl.cpp | 6 ++++++ frameworks/native/ability/native/ability.cpp | 4 ++++ .../native/ability/native/ability_impl.cpp | 7 +++++++ .../native/ability_runtime/js_ability.cpp | 2 ++ .../native/ability/native/ability_thread.cpp | 4 ++++ .../native/ability/native/data_ability_impl.cpp | 2 ++ .../native/ability/native/fa_ability_thread.cpp | 12 +++++++++++- .../native/ability/native/new_ability_impl.cpp | 2 ++ .../ability/native/recovery/app_recovery.cpp | 2 ++ .../ability/native/service_ability_impl.cpp | 2 ++ .../include/ability_manager_client.h | 16 ++++++++++++++++ interfaces/kits/native/ability/native/ability.h | 2 ++ .../kits/native/ability/native/ability_impl.h | 4 ++++ .../ability/native/ability_runtime/js_ability.h | 2 ++ .../kits/native/ability/native/ability_thread.h | 4 ++++ .../native/ability/native/data_ability_impl.h | 2 ++ .../native/ability/native/fa_ability_thread.h | 8 ++++++++ .../native/ability/native/new_ability_impl.h | 2 ++ .../native/ability/native/service_ability_impl.h | 2 ++ 19 files changed, 84 insertions(+), 1 deletion(-) diff --git a/frameworks/native/ability/ability_runtime/ability_context_impl.cpp b/frameworks/native/ability/ability_runtime/ability_context_impl.cpp index be51ae65ce2..a377b5e8a5a 100644 --- a/frameworks/native/ability/ability_runtime/ability_context_impl.cpp +++ b/frameworks/native/ability/ability_runtime/ability_context_impl.cpp @@ -456,7 +456,9 @@ ErrCode AbilityContextImpl::OnBackPressedCallBack(bool &needMoveToBackground) HILOG_ERROR("abilityCallback is nullptr."); return ERR_INVALID_VALUE; } +#ifdef SUPPORT_GRAPHICS needMoveToBackground = abilityCallback->OnBackPress(); +#endif return ERR_OK; } @@ -569,12 +571,14 @@ void AbilityContextImpl::RegisterAbilityCallback(std::weak_ptrGetWindowRect(left, top, width, height); } } +#endif #ifdef SUPPORT_GRAPHICS ErrCode AbilityContextImpl::SetMissionLabel(const std::string& label) diff --git a/frameworks/native/ability/native/ability.cpp b/frameworks/native/ability/native/ability.cpp index 81c3df3c5f8..22d4dbc5e6b 100644 --- a/frameworks/native/ability/native/ability.cpp +++ b/frameworks/native/ability/native/ability.cpp @@ -159,6 +159,7 @@ bool Ability::IsUpdatingConfigurations() return AbilityContext::IsUpdatingConfigurations(); } +#ifdef SUPPORT_GRAPHICS void Ability::OnStart(const Want &want, sptr sessionInfo) { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); @@ -247,6 +248,7 @@ void Ability::OnStart(const Want &want, sptr sessionInfo) lifecycle_->DispatchLifecycle(LifeCycle::Event::ON_START, want); HILOG_DEBUG("end"); } +#endif void Ability::OnStop() { @@ -596,11 +598,13 @@ void Ability::InitConfigurationProperties(const Configuration& changeConfigurati void Ability::OnMemoryLevel(int level) { HILOG_INFO("called"); +#ifdef SUPPORT_GRAPHICS if (scene_ == nullptr) { HILOG_DEBUG("WindowScene is null"); return; } scene_->NotifyMemoryLevel(level); +#endif } int Ability::OpenRawFile(const Uri &uri, const std::string &mode) diff --git a/frameworks/native/ability/native/ability_impl.cpp b/frameworks/native/ability/native/ability_impl.cpp index c534f0a1439..ffecebfa2bc 100644 --- a/frameworks/native/ability/native/ability_impl.cpp +++ b/frameworks/native/ability/native/ability_impl.cpp @@ -62,6 +62,7 @@ void AbilityImpl::Init(const std::shared_ptr &application, HILOG_DEBUG("AbilityImpl::init end"); } +#ifdef SUPPORT_GRAPHICS void AbilityImpl::Start(const Want &want, sptr sessionInfo) { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); @@ -101,6 +102,7 @@ void AbilityImpl::Start(const Want &want, sptr sessionInfo) abilityLifecycleCallbacks_->OnAbilityStart(ability_); HILOG_DEBUG("%{public}s end.", __func__); } +#endif void AbilityImpl::Stop() { @@ -253,9 +255,11 @@ void AbilityImpl::DispatchRestoreAbilityState(const PacMap &inState) HILOG_DEBUG("%{public}s end.", __func__); } +#ifdef SUPPORT_GRAPHICS void AbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState, sptr sessionInfo) {} +#endif void AbilityImpl::HandleShareData(const int32_t &requestCode) {} @@ -308,9 +312,12 @@ bool AbilityImpl::PrepareTerminateAbility() HILOG_ERROR("ability_ is nullptr."); return false; } +#ifdef SUPPORT_GRAPHICS bool ret = ability_->OnPrepareTerminate(); HILOG_DEBUG("end, ret = %{public}d", ret); return ret; +#endif + return true; } int AbilityImpl::GetCurrentState() diff --git a/frameworks/native/ability/native/ability_runtime/js_ability.cpp b/frameworks/native/ability/native/ability_runtime/js_ability.cpp index 4f163f98351..b6c12f5c2f6 100644 --- a/frameworks/native/ability/native/ability_runtime/js_ability.cpp +++ b/frameworks/native/ability/native/ability_runtime/js_ability.cpp @@ -193,6 +193,7 @@ void JsAbility::Init(const std::shared_ptr &abilityInfo, nullptr, nullptr); } +#ifdef SUPPORT_GRAPHICS void JsAbility::OnStart(const Want &want, sptr sessionInfo) { HITRACE_METER_NAME(HITRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__); @@ -239,6 +240,7 @@ void JsAbility::OnStart(const Want &want, sptr sessionInfo) } HILOG_DEBUG("OnStart end, ability is %{public}s.", GetAbilityName().c_str()); } +#endif int32_t JsAbility::OnShare(WantParams &wantParam) { diff --git a/frameworks/native/ability/native/ability_thread.cpp b/frameworks/native/ability/native/ability_thread.cpp index 257aa30bf44..17fb7f7e78e 100644 --- a/frameworks/native/ability/native/ability_thread.cpp +++ b/frameworks/native/ability/native/ability_thread.cpp @@ -86,11 +86,13 @@ void AbilityThread::AbilityThreadMain(const std::shared_ptr &ap HILOG_DEBUG("end"); } +#ifdef SUPPORT_GRAPHICS void AbilityThread::ScheduleAbilityTransaction( const Want &want, const LifeCycleStateInfo &targetState, sptr sessionInfo) { HILOG_DEBUG("called"); } +#endif void AbilityThread::ScheduleShareData(const int32_t &requestCode) { @@ -112,11 +114,13 @@ void AbilityThread::ScheduleCommandAbility(const Want &want, bool restart, int s HILOG_DEBUG("called"); } +#ifdef SUPPORT_GRAPHICS void AbilityThread::ScheduleCommandAbilityWindow( const Want &want, const sptr &sessionInfo, AAFwk::WindowCommand winCmd) { HILOG_DEBUG("called"); } +#endif bool AbilityThread::SchedulePrepareTerminateAbility() { diff --git a/frameworks/native/ability/native/data_ability_impl.cpp b/frameworks/native/ability/native/data_ability_impl.cpp index 89830fb4d81..014c636d012 100644 --- a/frameworks/native/ability/native/data_ability_impl.cpp +++ b/frameworks/native/ability/native/data_ability_impl.cpp @@ -31,6 +31,7 @@ const std::string WRITE = "w"; } using AbilityManagerClient = OHOS::AAFwk::AbilityManagerClient; using OHOS::Security::AccessToken::AccessTokenKit; +#ifdef SUPPORT_GRAPHICS void DataAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState, sptr sessionInfo) { @@ -62,6 +63,7 @@ void DataAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::Li AbilityManagerClient::GetInstance()->AbilityTransitionDone(token_, targetState.state, GetRestoreData()); } +#endif /** * @brief Obtains the MIME types of files supported. diff --git a/frameworks/native/ability/native/fa_ability_thread.cpp b/frameworks/native/ability/native/fa_ability_thread.cpp index 821717db697..4f3afee5351 100644 --- a/frameworks/native/ability/native/fa_ability_thread.cpp +++ b/frameworks/native/ability/native/fa_ability_thread.cpp @@ -197,7 +197,6 @@ void FAAbilityThread::CreateExtensionAbilityNameSupportGraphics( if (abilityInfo->formEnabled || abilityInfo->extensionAbilityType == AppExecFwk::ExtensionAbilityType::FORM) { abilityName = FORM_EXTENSION; } -#endif if (AAFwk::UIExtensionUtils::IsUIExtension(abilityInfo->extensionAbilityType)) { if (abilityInfo->extensionAbilityType == AppExecFwk::ExtensionAbilityType::SHARE) { abilityName = SHARE_EXTENSION; @@ -217,6 +216,7 @@ void FAAbilityThread::CreateExtensionAbilityNameSupportGraphics( abilityInfo->type == AppExecFwk::AbilityType::EXTENSION) { abilityName = abilityInfo->extensionTypeName + CUSTOM_EXTENSION; } +#endif } std::shared_ptr FAAbilityThread::CreateAndInitContextDeal( @@ -466,6 +466,7 @@ void FAAbilityThread::Attach(const std::shared_ptr HILOG_DEBUG("end"); } +#ifdef SUPPORT_GRAPHICS void FAAbilityThread::HandleAbilityTransaction( const Want &want, const LifeCycleStateInfo &lifeCycleStateInfo, sptr sessionInfo) { @@ -483,6 +484,7 @@ void FAAbilityThread::HandleAbilityTransaction( abilityImpl_->HandleAbilityTransaction(want, lifeCycleStateInfo, sessionInfo); HILOG_DEBUG("end"); } +#endif void FAAbilityThread::HandleShareData(const int32_t &uniqueId) { @@ -495,6 +497,7 @@ void FAAbilityThread::HandleShareData(const int32_t &uniqueId) HILOG_DEBUG("end"); } +#ifdef SUPPORT_GRAPHICS void FAAbilityThread::HandleExtensionTransaction( const Want &want, const LifeCycleStateInfo &lifeCycleStateInfo, sptr sessionInfo) { @@ -507,6 +510,7 @@ void FAAbilityThread::HandleExtensionTransaction( extensionImpl_->HandleExtensionTransaction(want, lifeCycleStateInfo, sessionInfo); HILOG_DEBUG("end"); } +#endif void FAAbilityThread::HandleConnectAbility(const Want &want) { @@ -606,6 +610,7 @@ void FAAbilityThread::HandleCommandExtension(const Want &want, bool restart, int HILOG_DEBUG("end"); } +#ifdef SUPPORT_GRAPHICS void FAAbilityThread::HandleCommandExtensionWindow( const Want &want, const sptr &sessionInfo, AAFwk::WindowCommand winCmd) { @@ -618,6 +623,7 @@ void FAAbilityThread::HandleCommandExtensionWindow( extensionImpl_->CommandExtensionWindow(want, sessionInfo, winCmd); HILOG_DEBUG("end"); } +#endif void FAAbilityThread::HandleRestoreAbilityState(const AppExecFwk::PacMap &state) { @@ -706,6 +712,7 @@ void FAAbilityThread::HandleExtensionUpdateConfiguration(const AppExecFwk::Confi HILOG_DEBUG("end"); } +#ifdef SUPPORT_GRAPHICS void FAAbilityThread::ScheduleAbilityTransaction( const Want &want, const LifeCycleStateInfo &lifeCycleStateInfo, sptr sessionInfo) { @@ -743,6 +750,7 @@ void FAAbilityThread::ScheduleAbilityTransaction( HILOG_ERROR("PostTask error"); } } +#endif void FAAbilityThread::ScheduleShareData(const int32_t &uniqueId) { @@ -907,6 +915,7 @@ bool FAAbilityThread::SchedulePrepareTerminateAbility() return isPrepareTerminate_; } +#ifdef SUPPORT_GRAPHICS void FAAbilityThread::ScheduleCommandAbilityWindow( const Want &want, const sptr &sessionInfo, AAFwk::WindowCommand winCmd) { @@ -930,6 +939,7 @@ void FAAbilityThread::ScheduleCommandAbilityWindow( } HILOG_DEBUG("end"); } +#endif void FAAbilityThread::SendResult(int requestCode, int resultCode, const Want &want) { diff --git a/frameworks/native/ability/native/new_ability_impl.cpp b/frameworks/native/ability/native/new_ability_impl.cpp index 3342e49162e..a60a2a71966 100644 --- a/frameworks/native/ability/native/new_ability_impl.cpp +++ b/frameworks/native/ability/native/new_ability_impl.cpp @@ -21,6 +21,7 @@ namespace OHOS { namespace AppExecFwk { using AbilityManagerClient = OHOS::AAFwk::AbilityManagerClient; +#ifdef SUPPORT_GRAPHICS /** * @brief Handling the life cycle switching of NewAbility. * @@ -68,6 +69,7 @@ void NewAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::Lif AbilityTransactionCallback(targetState.state); } } +#endif void NewAbilityImpl::HandleShareData(const int32_t &uniqueId) { diff --git a/frameworks/native/ability/native/recovery/app_recovery.cpp b/frameworks/native/ability/native/recovery/app_recovery.cpp index d635f539b84..ae78783a549 100644 --- a/frameworks/native/ability/native/recovery/app_recovery.cpp +++ b/frameworks/native/ability/native/recovery/app_recovery.cpp @@ -190,10 +190,12 @@ bool AppRecovery::ScheduleSaveAppState(StateReason reason, uintptr_t ability) HILOG_ERROR("AppRecovery Failed to block main thread, skip save state when appfreeze"); return false; } +#ifdef SUPPORT_GRAPHICS OHOS::AbilityRuntime::JsAbility& jsAbility = static_cast(*abilityPtr); AbilityRuntime::JsRuntime& runtime = const_cast(jsAbility.GetJsRuntime()); auto& nativeEngine = runtime.GetNativeEngine(); nativeEngine.AllowCrossThreadExecution(); +#endif AppRecovery::GetInstance().DoSaveAppState(reason, ability); return true; } diff --git a/frameworks/native/ability/native/service_ability_impl.cpp b/frameworks/native/ability/native/service_ability_impl.cpp index 15a444e5c08..ddf30f322c7 100644 --- a/frameworks/native/ability/native/service_ability_impl.cpp +++ b/frameworks/native/ability/native/service_ability_impl.cpp @@ -19,6 +19,7 @@ namespace OHOS { namespace AppExecFwk { using AbilityManagerClient = OHOS::AAFwk::AbilityManagerClient; +#ifdef SUPPORT_GRAPHICS void ServiceAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState, sptr sessionInfo) { @@ -63,6 +64,7 @@ void ServiceAbilityImpl::HandleAbilityTransaction(const Want &want, const AAFwk: AbilityTransactionCallback(targetState.state); } } +#endif void ServiceAbilityImpl::AbilityTransactionCallback(const AbilityLifeCycleState &state) { diff --git a/interfaces/inner_api/ability_manager/include/ability_manager_client.h b/interfaces/inner_api/ability_manager/include/ability_manager_client.h index 3d19e744106..673078437ba 100644 --- a/interfaces/inner_api/ability_manager/include/ability_manager_client.h +++ b/interfaces/inner_api/ability_manager/include/ability_manager_client.h @@ -85,11 +85,13 @@ public: */ ErrCode ScheduleCommandAbilityDone(const sptr &token); +#ifdef SUPPORT_GRAPHICS ErrCode ScheduleCommandAbilityWindowDone( const sptr &token, const sptr &sessionInfo, WindowCommand winCmd, AbilityCommand abilityCmd); +#endif /** * Get top ability. @@ -193,6 +195,7 @@ public: int requestCode = DEFAULT_INVAL_VALUE, int32_t userId = DEFAULT_INVAL_VALUE); +#ifdef SUPPORT_GRAPHICS /** * Start ui session ability with extension session info, send session info to ability manager service. * @@ -226,6 +229,7 @@ public: const sptr &sessionInfo, int requestCode = DEFAULT_INVAL_VALUE, int32_t userId = DEFAULT_INVAL_VALUE); +#endif /** * Start extension ability with want, send want to ability manager service. @@ -242,6 +246,7 @@ public: int32_t userId = DEFAULT_INVAL_VALUE, AppExecFwk::ExtensionAbilityType extensionType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED); +#ifdef SUPPORT_GRAPHICS /** * Start ui extension ability with extension session info, send extension session info to ability manager service. * @@ -260,6 +265,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ ErrCode StartUIAbilityBySCB(sptr sessionInfo); +#endif /** * Stop extension ability with want, send want to ability manager service. @@ -286,6 +292,7 @@ public: */ ErrCode TerminateAbility(const sptr &token, int resultCode, const Want *resultWant); +#ifdef SUPPORT_GRAPHICS /** * TerminateUIExtensionAbility with want, return want from ability manager service. * @@ -304,6 +311,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ ErrCode CloseUIAbilityBySCB(const sptr &sessionInfo); +#endif /** * SendResultToAbility with want, return resultWant from ability manager service. @@ -343,6 +351,7 @@ public: */ ErrCode MinimizeAbility(const sptr &token, bool fromUser = false); +#ifdef SUPPORT_GRAPHICS /** * MinimizeUIExtensionAbility, minimize the special ui extension ability. * @@ -360,6 +369,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ ErrCode MinimizeUIAbilityBySCB(const sptr &sessionInfo, bool fromUser = false); +#endif /** * ConnectAbility, connect session with service ability. @@ -406,6 +416,7 @@ public: ErrCode ConnectExtensionAbility(const Want &want, const sptr &connect, int32_t userId = DEFAULT_INVAL_VALUE); +#ifdef SUPPORT_GRAPHICS /** * Connect ui extension ability. * @@ -417,6 +428,7 @@ public: */ ErrCode ConnectUIExtensionAbility(const Want &want, const sptr &connect, const sptr &sessionInfo, int32_t userId = DEFAULT_INVAL_VALUE); +#endif /** * DisconnectAbility, disconnect session with service ability. @@ -837,6 +849,7 @@ public: */ ErrCode PrepareTerminateAbility(const sptr &token, sptr &callback); +#ifdef SUPPORT_GRAPHICS /** * PrepareTerminateAbilityBySCB, prepare to terminate ability by scb. * @@ -845,6 +858,7 @@ public: * @return Returns ERR_OK on success, others on failure. */ ErrCode PrepareTerminateAbilityBySCB(const sptr &sessionInfo, bool &isPrepareTerminate); +#endif /** * Set mission continue state of this ability. @@ -1116,12 +1130,14 @@ public: */ void SetRootSceneSession(const sptr &rootSceneSession); +#ifdef SUPPORT_GRAPHICS /** * Call UIAbility by SCB. * * @param sessionInfo the session info of the ability to be called. */ void CallUIAbilityBySCB(const sptr &sessionInfo); +#endif /** * Start specified ability by SCB. diff --git a/interfaces/kits/native/ability/native/ability.h b/interfaces/kits/native/ability/native/ability.h index fc68c7d58c5..32c96820341 100644 --- a/interfaces/kits/native/ability/native/ability.h +++ b/interfaces/kits/native/ability/native/ability.h @@ -180,6 +180,7 @@ public: void AttachAbilityContext(const std::shared_ptr &abilityContext); +#ifdef SUPPORT_GRAPHICS /** * @brief Called when this ability is started. You must override this function if you want to perform some * initialization operations during ability startup. @@ -189,6 +190,7 @@ public: * @param sessionInfo Indicates the sessionInfo. */ virtual void OnStart(const Want &want, sptr sessionInfo = nullptr); +#endif /** * @brief Called when this ability enters the STATE_STOP state. diff --git a/interfaces/kits/native/ability/native/ability_impl.h b/interfaces/kits/native/ability/native/ability_impl.h index 9e4d75f056d..c7daed8feaa 100644 --- a/interfaces/kits/native/ability/native/ability_impl.h +++ b/interfaces/kits/native/ability/native/ability_impl.h @@ -102,9 +102,11 @@ public: */ void DispatchRestoreAbilityState(const PacMap &inState); +#ifdef SUPPORT_GRAPHICS // Page Service Ability has different AbilityTransaction virtual void HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState, sptr sessionInfo = nullptr); +#endif /** * @brief The life cycle callback. @@ -399,6 +401,7 @@ protected: #endif protected: +#ifdef SUPPORT_GRAPHICS /** * @brief Toggles the lifecycle status of Ability to AAFwk::ABILITY_STATE_INACTIVE. And notifies the application * that it belongs to of the lifecycle status. @@ -407,6 +410,7 @@ protected: * @param sessionInfo Indicates the sessionInfo. */ void Start(const Want &want, sptr sessionInfo = nullptr); +#endif /** * @brief Toggles the lifecycle status of Ability to AAFwk::ABILITY_STATE_INITIAL. And notifies the application diff --git a/interfaces/kits/native/ability/native/ability_runtime/js_ability.h b/interfaces/kits/native/ability/native/ability_runtime/js_ability.h index 1a2ad8c9e8f..9156ff46889 100644 --- a/interfaces/kits/native/ability/native/ability_runtime/js_ability.h +++ b/interfaces/kits/native/ability/native/ability_runtime/js_ability.h @@ -44,7 +44,9 @@ public: void Init(const std::shared_ptr &abilityInfo, const std::shared_ptr application, std::shared_ptr &handler, const sptr &token) override; +#ifdef SUPPORT_GRAPHICS void OnStart(const Want &want, sptr sessionInfo = nullptr) override; +#endif void OnStop() override; void OnStop(AppExecFwk::AbilityTransactionCallbackInfo<> *callbackInfo, bool &isAsyncCallback) override; void OnStopCallback() override; diff --git a/interfaces/kits/native/ability/native/ability_thread.h b/interfaces/kits/native/ability/native/ability_thread.h index 8407642efa8..fc8ad449581 100644 --- a/interfaces/kits/native/ability/native/ability_thread.h +++ b/interfaces/kits/native/ability/native/ability_thread.h @@ -87,6 +87,7 @@ public: */ virtual void NotifyMemoryLevel(int32_t level) = 0; +#ifdef SUPPORT_GRAPHICS /** * @brief Provide operating system AbilityTransaction information to the observer * @param want Indicates the structure containing Transaction information about the ability. @@ -95,6 +96,7 @@ public: */ void ScheduleAbilityTransaction( const Want &want, const LifeCycleStateInfo &targetState, sptr sessionInfo = nullptr) override; +#endif /** * @brief Provide operating system ShareData information to the observer @@ -125,6 +127,7 @@ public: */ void ScheduleCommandAbility(const Want &want, bool restart, int startId) override; +#ifdef SUPPORT_GRAPHICS /** * @brief Schedule Command AbilityWindow * @param want The Want object to command to. @@ -133,6 +136,7 @@ public: */ void ScheduleCommandAbilityWindow( const Want &want, const sptr &sessionInfo, AAFwk::WindowCommand winCmd) override; +#endif /** * @brief Provide operating system PrepareTerminateAbility information to the observer diff --git a/interfaces/kits/native/ability/native/data_ability_impl.h b/interfaces/kits/native/ability/native/data_ability_impl.h index 2f4fe126621..04cbb68e024 100644 --- a/interfaces/kits/native/ability/native/data_ability_impl.h +++ b/interfaces/kits/native/ability/native/data_ability_impl.h @@ -38,6 +38,7 @@ public: */ ~DataAbilityImpl() = default; +#ifdef SUPPORT_GRAPHICS /** * @brief Handling the life cycle switching of PageAbility. * @@ -48,6 +49,7 @@ public: */ void HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState, sptr sessionInfo = nullptr); +#endif /** * @brief Obtains the MIME types of files supported. diff --git a/interfaces/kits/native/ability/native/fa_ability_thread.h b/interfaces/kits/native/ability/native/fa_ability_thread.h index 1b656beaa96..dc24b30840c 100644 --- a/interfaces/kits/native/ability/native/fa_ability_thread.h +++ b/interfaces/kits/native/ability/native/fa_ability_thread.h @@ -65,6 +65,7 @@ public: const std::shared_ptr &abilityRecord, const std::shared_ptr &appContext) override; +#ifdef SUPPORT_GRAPHICS /** * @brief Provide operating system AbilityTransaction information to the observer * @param want Indicates the structure containing Transaction information about the ability. @@ -73,6 +74,7 @@ public: */ void ScheduleAbilityTransaction(const Want &want, const LifeCycleStateInfo &targetState, sptr sessionInfo = nullptr) override; +#endif /** * @brief Provide operating system ShareData information to the observer @@ -103,6 +105,7 @@ public: */ void ScheduleCommandAbility(const Want &want, bool restart, int startId) override; +#ifdef SUPPORT_GRAPHICS /** * @brief Schedule Command AbilityWindow * @param want The Want object to command to. @@ -111,6 +114,7 @@ public: */ void ScheduleCommandAbilityWindow( const Want &want, const sptr &sessionInfo, AAFwk::WindowCommand winCmd) override; +#endif /** * @brief Provide operating system PrepareTerminateAbility information to the observer @@ -418,6 +422,7 @@ private: const std::shared_ptr &abilityRecord, const std::shared_ptr &abilityObject); +#ifdef SUPPORT_GRAPHICS /** * @brief Handle the life cycle of Ability. * @param want Indicates the structure containing lifecycle information about the ability. @@ -435,6 +440,7 @@ private: */ void HandleExtensionTransaction(const Want &want, const LifeCycleStateInfo &lifeCycleStateInfo, sptr sessionInfo = nullptr); +#endif /** * @brief Handle the current connection of Ability. @@ -482,6 +488,7 @@ private: */ void HandleCommandExtension(const Want &want, bool restart, int32_t startId); +#ifdef SUPPORT_GRAPHICS /** * @brief Handle Command Extension Window * @param want The Want object to command to. @@ -490,6 +497,7 @@ private: */ void HandleCommandExtensionWindow( const Want &want, const sptr &sessionInfo, AAFwk::WindowCommand winCmd); +#endif /** * @brief Handle the restoreAbility state. diff --git a/interfaces/kits/native/ability/native/new_ability_impl.h b/interfaces/kits/native/ability/native/new_ability_impl.h index 2d49ddfdfc8..3711bc211bd 100644 --- a/interfaces/kits/native/ability/native/new_ability_impl.h +++ b/interfaces/kits/native/ability/native/new_ability_impl.h @@ -38,6 +38,7 @@ public: */ ~NewAbilityImpl() = default; +#ifdef SUPPORT_GRAPHICS /** * @brief Handling the life cycle switching of NewAbility. * @@ -48,6 +49,7 @@ public: */ void HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState, sptr sessionInfo = nullptr) override; +#endif /** * @brief The life cycle callback of NewAbility. diff --git a/interfaces/kits/native/ability/native/service_ability_impl.h b/interfaces/kits/native/ability/native/service_ability_impl.h index ccb0bb78639..1918a98c34d 100644 --- a/interfaces/kits/native/ability/native/service_ability_impl.h +++ b/interfaces/kits/native/ability/native/service_ability_impl.h @@ -38,6 +38,7 @@ public: */ ~ServiceAbilityImpl() override = default; +#ifdef SUPPORT_GRAPHICS /** * @brief Handling the life cycle switching of PageAbility. * @@ -48,6 +49,7 @@ public: */ void HandleAbilityTransaction(const Want &want, const AAFwk::LifeCycleStateInfo &targetState, sptr sessionInfo = nullptr) override; +#endif /** * @brief The life cycle callback of NewAbility. -- Gitee