diff --git a/services/dfx/include/time_cmd_dispatcher.h b/services/dfx/include/time_cmd_dispatcher.h index c653623..ad88a81 100644 --- a/services/dfx/include/time_cmd_dispatcher.h +++ b/services/dfx/include/time_cmd_dispatcher.h @@ -19,12 +19,10 @@ #include #include #include - #include "time_cmd_parse.h" namespace OHOS { namespace MiscServices { - class TimeCmdDispatcher { public: static TimeCmdDispatcher &GetInstance(); @@ -37,4 +35,4 @@ private: }; } // namespace MiscServices } // namespace OHOS -#endif //TIME_CMD_DISPATCHER_H \ No newline at end of file +#endif // TIME_CMD_DISPATCHER_H \ No newline at end of file diff --git a/services/dfx/include/time_cmd_parse.h b/services/dfx/include/time_cmd_parse.h index db48880..04ffba2 100644 --- a/services/dfx/include/time_cmd_parse.h +++ b/services/dfx/include/time_cmd_parse.h @@ -34,4 +34,4 @@ private: std::string help; Action action; }; -#endif //TIME_CMDPARSE_H \ No newline at end of file +#endif // TIME_CMDPARSE_H \ No newline at end of file diff --git a/services/dfx/src/time_cmd_dispatcher.cpp b/services/dfx/src/time_cmd_dispatcher.cpp index 8f4a2f6..331e3cb 100644 --- a/services/dfx/src/time_cmd_dispatcher.cpp +++ b/services/dfx/src/time_cmd_dispatcher.cpp @@ -13,15 +13,14 @@ * limitations under the License. */ +#include "time_cmd_dispatcher.h" + #include #include - -#include "time_cmd_dispatcher.h" #include "time_hilog_wreapper.h" namespace OHOS { namespace MiscServices { - bool TimeCmdDispatcher::Dispatch(int fd, const std::vector &args) { if (args.empty() || args.at(0) == "-h") { diff --git a/services/time_manager/src/time_service.cpp b/services/time_manager/src/time_service.cpp index 65671d4..04f8546 100644 --- a/services/time_manager/src/time_service.cpp +++ b/services/time_manager/src/time_service.cpp @@ -423,7 +423,8 @@ void TimeService::DumpTimerInfoById(int fd, const std::vector &inpu return; } } - timerManagerHandler_->ShowTimerEntryById(fd, std::atoi(input.at(2).c_str())); + int paramNumPos=2; + timerManagerHandler_->ShowTimerEntryById(fd, std::atoi(input.at(paramNumPos).c_str())); } void TimeService::DumpTimerTriggerById(int fd, const std::vector &input) @@ -437,7 +438,8 @@ void TimeService::DumpTimerTriggerById(int fd, const std::vector &i return; } } - timerManagerHandler_->ShowTimerTriggerById(fd, std::atoi(input.at(2).c_str())); + int paramNumPos=2; + timerManagerHandler_->ShowTimerTriggerById(fd, std::atoi(input.at(paramNumPos).c_str())); } int TimeService::set_rtc_time(time_t sec)