mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-12-04 05:22:25 +00:00
commit
0d993428ea
@ -1049,5 +1049,15 @@ ErrCode AbilityContextImpl::OpenLink(const AAFwk::Want& want, int requestCode)
|
||||
TAG_LOGD(AAFwkTag::CONTEXT, "called");
|
||||
return AAFwk::AbilityManagerClient::GetInstance()->OpenLink(want, token_, -1, requestCode);
|
||||
}
|
||||
|
||||
std::shared_ptr<AAFwk::Want> AbilityContextImpl::GetWant()
|
||||
{
|
||||
auto abilityCallback = abilityCallback_.lock();
|
||||
if (abilityCallback == nullptr) {
|
||||
TAG_LOGW(AAFwkTag::CONTEXT, "abilityCallback is nullptr.");
|
||||
return nullptr;
|
||||
}
|
||||
return abilityCallback->GetWant();
|
||||
}
|
||||
} // namespace AbilityRuntime
|
||||
} // namespace OHOS
|
||||
|
@ -349,6 +349,8 @@ public:
|
||||
virtual void SetRestoreEnabled(bool enabled) = 0;
|
||||
virtual bool GetRestoreEnabled() = 0;
|
||||
|
||||
virtual std::shared_ptr<AAFwk::Want> GetWant() = 0;
|
||||
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
#ifdef SUPPORT_SCREEN
|
||||
/**
|
||||
|
@ -240,6 +240,8 @@ public:
|
||||
void SetRestoreEnabled(bool enabled) override;
|
||||
bool GetRestoreEnabled() override;
|
||||
|
||||
std::shared_ptr<AAFwk::Want> GetWant() override;
|
||||
|
||||
#ifdef SUPPORT_SCREEN
|
||||
/**
|
||||
* @brief Set mission label of this ability.
|
||||
|
@ -454,7 +454,7 @@ public:
|
||||
*
|
||||
* @return Returns the Want object that starts this ability.
|
||||
*/
|
||||
std::shared_ptr<AAFwk::Want> GetWant();
|
||||
std::shared_ptr<AAFwk::Want> GetWant() override;
|
||||
|
||||
/**
|
||||
* @brief Sets the result code and data to be returned by this Page ability to the caller.
|
||||
|
@ -102,6 +102,8 @@ public:
|
||||
* @param observer the lifecycle observer to be unregistered on ability.
|
||||
*/
|
||||
virtual void UnregisterAbilityLifecycleObserver(const std::shared_ptr<ILifecycleObserver> &observer) = 0;
|
||||
|
||||
virtual std::shared_ptr<AAFwk::Want> GetWant() = 0;
|
||||
};
|
||||
} // namespace AppExecFwk
|
||||
} // namespace OHOS
|
||||
|
@ -102,7 +102,7 @@ public:
|
||||
* @brief Obtains the Want object that starts this ability.
|
||||
* @return Returns the Want object that starts this ability.
|
||||
*/
|
||||
std::shared_ptr<AAFwk::Want> GetWant();
|
||||
std::shared_ptr<AAFwk::Want> GetWant() override;
|
||||
|
||||
/**
|
||||
* @brief Init the UIability
|
||||
|
@ -86,6 +86,11 @@ public:
|
||||
void UnregisterAbilityLifecycleObserver(const std::shared_ptr<ILifecycleObserver> &observer)
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<AAFwk::Want> GetWant()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
class AbilityContextImplTest : public testing::Test {
|
||||
|
@ -63,6 +63,11 @@ public:
|
||||
void UnregisterAbilityLifecycleObserver(const std::shared_ptr<ILifecycleObserver> &observer)
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<AAFwk::Want> GetWant()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
class DialogUIExtensionCallbackTest : public testing::Test {
|
||||
|
Loading…
Reference in New Issue
Block a user