!528 SA基类添加OnActive和OnIdle回调

Merge pull request !528 from 王洋/master
This commit is contained in:
openharmony_ci 2023-03-01 06:49:05 +00:00 committed by Gitee
commit e2d4f4aa18
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 41 additions and 0 deletions

View File

@ -149,6 +149,11 @@ int32_t SystemAbilityManagerProxy::UnloadSystemAbility(int32_t systemAbilityId)
return -1; return -1;
} }
int32_t SystemAbilityManagerProxy::CancelUnloadSystemAbility(int32_t systemAbilityId)
{
return -1;
}
int32_t SystemAbilityManagerProxy::AddSystemAbility(int32_t systemAbilityId, const sptr<IRemoteObject>& ability, int32_t SystemAbilityManagerProxy::AddSystemAbility(int32_t systemAbilityId, const sptr<IRemoteObject>& ability,
const SAExtraProp& extraProp) const SAExtraProp& extraProp)
{ {

View File

@ -142,10 +142,24 @@ void SystemAbility::OnDump()
void SystemAbility::OnStart() void SystemAbility::OnStart()
{} {}
void SystemAbility::OnStart(const std::unordered_map<std::string, std::string>& startReason)
{}
int32_t SystemAbility::OnIdle(const std::unordered_map<std::string, std::string>& idleReason)
{
return 0;
}
void SystemAbility::OnActive(const std::unordered_map<std::string, std::string>& activeReason)
{}
// The details should be implemented by subclass // The details should be implemented by subclass
void SystemAbility::OnStop() void SystemAbility::OnStop()
{} {}
void SystemAbility::OnStop(const std::unordered_map<std::string, std::string>& stopReason)
{}
// The details should be implemented by subclass // The details should be implemented by subclass
void SystemAbility::OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId) void SystemAbility::OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId)
{ {

View File

@ -148,6 +148,11 @@ int32_t SystemAbilityManagerProxy::UnloadSystemAbility(int32_t systemAbilityId)
return -1; return -1;
} }
int32_t SystemAbilityManagerProxy::CancelUnloadSystemAbility(int32_t systemAbilityId)
{
return -1;
}
int32_t SystemAbilityManagerProxy::AddSystemAbility(int32_t systemAbilityId, const sptr<IRemoteObject>& ability, int32_t SystemAbilityManagerProxy::AddSystemAbility(int32_t systemAbilityId, const sptr<IRemoteObject>& ability,
const SAExtraProp& extraProp) const SAExtraProp& extraProp)
{ {

View File

@ -170,11 +170,28 @@ void SystemAbility::OnStart()
{ {
} }
void SystemAbility::OnStart(const std::unordered_map<std::string, std::string>& startReason)
{
}
int32_t SystemAbility::OnIdle(const std::unordered_map<std::string, std::string>& idleReason)
{
return 0;
}
void SystemAbility::OnActive(const std::unordered_map<std::string, std::string>& activeReason)
{
}
// The details should be implemented by subclass // The details should be implemented by subclass
void SystemAbility::OnStop() void SystemAbility::OnStop()
{ {
} }
void SystemAbility::OnStop(const std::unordered_map<std::string, std::string>& stopReason)
{
}
// The details should be implemented by subclass // The details should be implemented by subclass
void SystemAbility::OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId) void SystemAbility::OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId)
{ {