diff --git a/tools/dump/include/notification_shell_command.h b/tools/dump/include/notification_shell_command.h index bede4da7ee61efdac00fbf299d542b7302d0a93d..26fc5199e25195ffb6f9dacbaedf1ce9eb993a78 100644 --- a/tools/dump/include/notification_shell_command.h +++ b/tools/dump/include/notification_shell_command.h @@ -34,12 +34,11 @@ private: ErrCode RunAsDumpCommand(); ErrCode RunHelp(); - ErrCode RunActive(); - ErrCode RunRecent(); + ErrCode RunActive(std::vector &infos); + ErrCode RunRecent(std::vector &infos); #ifdef DISTRIBUTED_NOTIFICATION_SUPPORTED - ErrCode RunDistributed(); + ErrCode RunDistributed(std::vector &infos); #endif - ErrCode RunSetRecentCount(); private: std::shared_ptr ans_; diff --git a/tools/dump/src/notification_shell_command.cpp b/tools/dump/src/notification_shell_command.cpp index 2d44785e738cfe1b70b1917ed4da86c899dded5c..97de8dd95d8b5da05f66b0ac7be1481c1e99cda2 100644 --- a/tools/dump/src/notification_shell_command.cpp +++ b/tools/dump/src/notification_shell_command.cpp @@ -99,10 +99,9 @@ ErrCode NotificationShellCommand::RunHelp() return ERR_OK; } -ErrCode NotificationShellCommand::RunActive() +ErrCode NotificationShellCommand::RunActive(std::vector &infos) { ErrCode ret = ERR_OK; - std::vector infos; if (ans_ != nullptr) { ret = ans_->ShellDump("active", infos); resultReceiver_.append("Total:" + std::to_string(infos.size()) + "\n"); @@ -112,10 +111,9 @@ ErrCode NotificationShellCommand::RunActive() return ret; } -ErrCode NotificationShellCommand::RunRecent() +ErrCode NotificationShellCommand::RunRecent(std::vector &infos) { ErrCode ret = ERR_OK; - std::vector infos; if (ans_ != nullptr) { ret = ans_->ShellDump("recent", infos); resultReceiver_.append("Total:" + std::to_string(infos.size()) + "\n"); @@ -126,10 +124,9 @@ ErrCode NotificationShellCommand::RunRecent() } #ifdef DISTRIBUTED_NOTIFICATION_SUPPORTED -ErrCode NotificationShellCommand::RunDistributed() +ErrCode NotificationShellCommand::RunDistributed(std::vector &infos) { ErrCode ret = ERR_OK; - std::vector infos; if (ans_ != nullptr) { ret = ans_->ShellDump("distributed", infos); resultReceiver_.append("Total:" + std::to_string(infos.size()) + "\n"); @@ -157,14 +154,14 @@ ErrCode NotificationShellCommand::RunAsDumpCommand() ret = RunHelp(); break; case 'A': - ret = RunActive(); + ret = RunActive(infos); break; case 'R': - ret = RunRecent(); + ret = RunRecent(infos); break; #ifdef DISTRIBUTED_NOTIFICATION_SUPPORTED case 'D': - ret = RunDistributed(); + ret = RunDistributed(infos); break; #endif case 0: