mirror of
https://github.com/openharmony/miscservices_time.git
synced 2026-07-19 12:02:04 -04:00
Description:adapt wantagent change Sig: SIG_ApplicationFramework Feature or Bugfix: Binary Source:No Signed-off-by: liqiang <liqiang121@huawei.com> Change-Id: Iaabd2c5234d958dd7227c5e6745d1be96182666c
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
"deps": {
|
||||
"components": [
|
||||
"ability_base",
|
||||
"ability_runtime",
|
||||
"appexecfwk_standard",
|
||||
"ans_standard",
|
||||
"ces_standard",
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
int type;
|
||||
bool repeat;
|
||||
uint64_t interval;
|
||||
std::shared_ptr<OHOS::Notification::WantAgent::WantAgent> wantAgent;
|
||||
std::shared_ptr<OHOS::AbilityRuntime::WantAgent::WantAgent> wantAgent;
|
||||
|
||||
/**
|
||||
* Indicates the timing policy the timer use, which can be REALTIME or UTC.
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
*
|
||||
*/
|
||||
virtual void SetInterval(const uint64_t &interval) = 0;
|
||||
virtual void SetWantAgent(std::shared_ptr<OHOS::Notification::WantAgent::WantAgent> wantAgent) = 0;
|
||||
virtual void SetWantAgent(std::shared_ptr<OHOS::AbilityRuntime::WantAgent::WantAgent> wantAgent) = 0;
|
||||
virtual void OnTrigger() = 0;
|
||||
};
|
||||
} // MiscServices
|
||||
|
||||
@@ -32,7 +32,6 @@ ohos_shared_library("systemtime") {
|
||||
|
||||
deps = [
|
||||
"//base/miscservices/time/services:time_service",
|
||||
"//base/notification/ans_standard/frameworks/wantagent:wantagent_innerkits",
|
||||
"//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native",
|
||||
"//foundation/ace/napi/:ace_napi",
|
||||
"//utils/native/base:utils",
|
||||
@@ -40,6 +39,7 @@ ohos_shared_library("systemtime") {
|
||||
|
||||
external_deps = [
|
||||
"ability_base:want",
|
||||
"ability_runtime:wantagent_innerkits",
|
||||
"bundle_framework:appexecfwk_base",
|
||||
"hiviewdfx_hilog_native:libhilog",
|
||||
"ipc:ipc_core",
|
||||
|
||||
@@ -50,7 +50,6 @@ ohos_shared_library("systemtimer") {
|
||||
|
||||
deps = [
|
||||
"//base/miscservices/time/services:time_service",
|
||||
"//base/notification/ans_standard/frameworks/wantagent:wantagent_innerkits",
|
||||
"//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native",
|
||||
"//foundation/aafwk/standard/interfaces/innerkits/base:base",
|
||||
"//foundation/ace/napi:ace_napi",
|
||||
@@ -59,6 +58,7 @@ ohos_shared_library("systemtimer") {
|
||||
|
||||
external_deps = [
|
||||
"ability_base:want",
|
||||
"ability_runtime:wantagent_innerkits",
|
||||
"bundle_framework:appexecfwk_base",
|
||||
"hiviewdfx_hilog_native:libhilog",
|
||||
"ipc:ipc_core",
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
virtual void SetType(const int &type) override;
|
||||
virtual void SetRepeat(bool repeat) override;
|
||||
virtual void SetInterval(const uint64_t &interval) override;
|
||||
virtual void SetWantAgent(std::shared_ptr<OHOS::Notification::WantAgent::WantAgent> wantAgent) override;
|
||||
virtual void SetWantAgent(std::shared_ptr<OHOS::AbilityRuntime::WantAgent::WantAgent> wantAgent) override;
|
||||
void SetCallbackInfo(const napi_env &env, const napi_ref &ref);
|
||||
|
||||
private:
|
||||
|
||||
@@ -228,7 +228,7 @@ void ITimerInfoInstance::SetInterval(const uint64_t &_interval)
|
||||
{
|
||||
interval = _interval;
|
||||
}
|
||||
void ITimerInfoInstance::SetWantAgent(std::shared_ptr<OHOS::Notification::WantAgent::WantAgent> _wantAgent)
|
||||
void ITimerInfoInstance::SetWantAgent(std::shared_ptr<OHOS::AbilityRuntime::WantAgent::WantAgent> _wantAgent)
|
||||
{
|
||||
wantAgent = _wantAgent;
|
||||
}
|
||||
@@ -238,7 +238,7 @@ napi_value GetTimerOptions(const napi_env &env, const napi_value &value,
|
||||
{
|
||||
napi_valuetype valuetype = napi_undefined;
|
||||
napi_value result = nullptr;
|
||||
OHOS::Notification::WantAgent::WantAgent *wantAgent = nullptr;
|
||||
OHOS::AbilityRuntime::WantAgent::WantAgent *wantAgent = nullptr;
|
||||
bool hasProperty = false;
|
||||
|
||||
// type: number
|
||||
@@ -283,8 +283,8 @@ napi_value GetTimerOptions(const napi_env &env, const napi_value &value,
|
||||
if (wantAgent == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
std::shared_ptr<OHOS::Notification::WantAgent::WantAgent> sWantAgent =
|
||||
std::make_shared<OHOS::Notification::WantAgent::WantAgent>(*wantAgent);
|
||||
std::shared_ptr<OHOS::AbilityRuntime::WantAgent::WantAgent> sWantAgent =
|
||||
std::make_shared<OHOS::AbilityRuntime::WantAgent::WantAgent>(*wantAgent);
|
||||
iTimerInfoInstance->SetWantAgent(sWantAgent);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -61,7 +61,6 @@ ohos_shared_library("time_service") {
|
||||
|
||||
deps = [
|
||||
"${time_utils_path}:time_utils",
|
||||
"//base/notification/ans_standard/frameworks/wantagent:wantagent_innerkits",
|
||||
"//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native",
|
||||
"//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_appdatafwk:native_appdatafwk",
|
||||
"//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_preferences:native_preferences",
|
||||
@@ -71,6 +70,7 @@ ohos_shared_library("time_service") {
|
||||
external_deps = [
|
||||
"ability_base:base",
|
||||
"ability_base:want",
|
||||
"ability_runtime:wantagent_innerkits",
|
||||
"bundle_framework:appexecfwk_base",
|
||||
"ces_standard:cesfwk_innerkits",
|
||||
"eventhandler:libeventhandler",
|
||||
|
||||
@@ -93,10 +93,9 @@ void TimerCallback::NotifyTimer(const uint64_t timerId)
|
||||
TIME_HILOGD(TIME_MODULE_SERVICE, "trigger wantagent.");
|
||||
std::shared_ptr<AppExecFwk::Context> context = std::make_shared<OHOS::AppExecFwk::AbilityContext>();
|
||||
std::shared_ptr<AAFwk::Want> want =
|
||||
Notification::WantAgent::WantAgentHelper::GetWant(it->second->wantAgent);
|
||||
|
||||
OHOS::Notification::WantAgent::TriggerInfo paramsInfo("", nullptr, want, WANTAGENT_CODE_ELEVEN);
|
||||
Notification::WantAgent::WantAgentHelper::TriggerWantAgent(
|
||||
OHOS::AbilityRuntime::WantAgent::WantAgentHelper::GetWant(it->second->wantAgent);
|
||||
OHOS::AbilityRuntime::WantAgent::TriggerInfo paramsInfo("", nullptr, want, WANTAGENT_CODE_ELEVEN);
|
||||
OHOS::AbilityRuntime::WantAgent::WantAgentHelper::TriggerWantAgent(
|
||||
it->second->wantAgent, nullptr, paramsInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ ohos_unittest("TimeServiceTest") {
|
||||
|
||||
deps = [
|
||||
"//base/miscservices/time/services:time_service",
|
||||
"//base/notification/ans_standard/frameworks/wantagent:wantagent_innerkits",
|
||||
"//foundation/ace/napi:ace_napi",
|
||||
"//foundation/distributedschedule/dmsfwk/services/dtbschedmgr:distributedschedsvr",
|
||||
"//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk",
|
||||
@@ -46,6 +45,7 @@ ohos_unittest("TimeServiceTest") {
|
||||
external_deps = [
|
||||
"ability_base:base",
|
||||
"ability_base:want",
|
||||
"ability_runtime:wantagent_innerkits",
|
||||
"bundle_framework:appexecfwk_base",
|
||||
"ces_standard:cesfwk_innerkits",
|
||||
"eventhandler:libeventhandler",
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
virtual void SetType(const int &type) override;
|
||||
virtual void SetRepeat(bool repeat) override;
|
||||
virtual void SetInterval(const uint64_t &interval) override;
|
||||
virtual void SetWantAgent(std::shared_ptr<OHOS::Notification::WantAgent::WantAgent> wantAgent) override;
|
||||
virtual void SetWantAgent(std::shared_ptr<OHOS::AbilityRuntime::WantAgent::WantAgent> wantAgent) override;
|
||||
void SetCallbackInfo(const std::function<void()> &callBack);
|
||||
|
||||
private:
|
||||
@@ -85,7 +85,7 @@ void TimerInfoTest::SetInterval(const uint64_t &_interval)
|
||||
{
|
||||
interval = _interval;
|
||||
}
|
||||
void TimerInfoTest::SetWantAgent(std::shared_ptr<OHOS::Notification::WantAgent::WantAgent> _wantAgent)
|
||||
void TimerInfoTest::SetWantAgent(std::shared_ptr<OHOS::AbilityRuntime::WantAgent::WantAgent> _wantAgent)
|
||||
{
|
||||
wantAgent = _wantAgent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user