1/*
2 * Copyright (C) 2022 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#ifndef SMS_HISYSEVENT_H
17#define SMS_HISYSEVENT_H
18
19#include <string>
20
21#include "telephony_hisysevent.h"
22
23namespace OHOS {
24namespace Telephony {
25enum class SmsMmsMessageType {
26    SMS_SHORT_MESSAGE,
27    MMS_SHORT_MESSAGE,
28    CELL_BROAD_CAST,
29    WAP_PUSH,
30};
31
32class SmsHiSysEvent : public TelephonyHiSysEvent {
33public:
34    static void WriteSmsSendBehaviorEvent(const int32_t slotId, const SmsMmsMessageType type);
35    static void WriteSmsReceiveBehaviorEvent(const int32_t slotId, const SmsMmsMessageType type);
36    static void WriteSmsSendFaultEvent(
37        const int32_t slotId, const SmsMmsMessageType type, const SmsMmsErrorCode errorCode, const std::string &desc);
38    static void WriteSmsReceiveFaultEvent(
39        const int32_t slotId, const SmsMmsMessageType type, const SmsMmsErrorCode errorCode, const std::string &desc);
40    void SetSmsBroadcastStartTime();
41    void JudgingSmsBroadcastTimeOut(const int32_t slotId, const SmsMmsMessageType type);
42    void SetCbBroadcastStartTime();
43    void JudgingCbBroadcastTimeOut(const int32_t slotId, const SmsMmsMessageType type);
44    void SetWapPushBroadcastStartTime();
45    void JudgingWapPushBroadcastTimeOut(const int32_t slotId, const SmsMmsMessageType type);
46
47private:
48    int64_t smsBroadcastStartTime_ = 0L;
49    int64_t cbBroadcastStartTime_ = 0L;
50    int64_t wapPushBroadcastStartTime_ = 0L;
51};
52} // namespace Telephony
53} // namespace OHOS
54
55#endif // SMS_HISYSEVENT_H
56