• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "sms_dump_helper.h"
17 
18 #include "telephony_log_wrapper.h"
19 #include "sms_service.h"
20 
21 namespace OHOS {
22 namespace Telephony {
Dump(const std::vector<std::string> & args,std::string & result) const23 bool SmsDumpHelper::Dump(const std::vector<std::string> &args, std::string &result) const
24 {
25     result.clear();
26     ShowHelp(result);
27     ShowSmsInfo(result);
28     return true;
29 }
30 
SmsDumpHelper()31 SmsDumpHelper::SmsDumpHelper()
32 {
33     TELEPHONY_LOGI("SmsDumpHelper() entry.");
34 }
35 
ShowHelp(std::string & result) const36 void SmsDumpHelper::ShowHelp(std::string &result) const
37 {
38     result.append("Usage:dump <command> [options]\n")
39         .append("Description:\n")
40         .append("-sms_mms_info          ")
41         .append("dump all sms_mms information in the system\n")
42         .append("-output_slot        ")
43         .append("default_slot_Id\n")
44         .append("-output_service_state")
45         .append("Output service state information\n");
46 }
47 
ShowSmsInfo(std::string & result) const48 void SmsDumpHelper::ShowSmsInfo(std::string &result) const
49 {
50     result.append("Ohos sms_mms service: ")
51         .append(",    Ohos sms_mms bind time:  ")
52         .append(DelayedSingleton<SmsService>::GetInstance()->GetBindTime())
53         .append("\n");
54 }
55 } // namespace Telephony
56 } // namespace OHOS
57