1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.internal.telephony.metrics;
18
19import com.android.internal.telephony.TelephonyProto.ImsCapabilities;
20import com.android.internal.telephony.TelephonyProto.ImsConnectionState;
21import com.android.internal.telephony.TelephonyProto.RilDataCall;
22import com.android.internal.telephony.TelephonyProto.SmsSession;
23import com.android.internal.telephony.TelephonyProto.TelephonyServiceState;
24import com.android.internal.telephony.TelephonyProto.TelephonySettings;
25
26public class SmsSessionEventBuilder {
27    SmsSession.Event mEvent = new SmsSession.Event();
28
29    public SmsSession.Event build() {
30        return mEvent;
31    }
32
33    public SmsSessionEventBuilder(int type) {
34        mEvent.setType(type);
35    }
36
37    public SmsSessionEventBuilder setDelay(int delay) {
38        mEvent.setDelay(delay);
39        return this;
40    }
41
42    public SmsSessionEventBuilder setTech(int tech) {
43        mEvent.setTech(tech);
44        return this;
45    }
46
47    public SmsSessionEventBuilder setErrorCode(int code) {
48        mEvent.setErrorCode(code);
49        return this;
50    }
51
52    public SmsSessionEventBuilder setRilErrno(int errno) {
53        mEvent.setError(errno);
54        return this;
55    }
56
57    public SmsSessionEventBuilder setSettings(TelephonySettings settings) {
58        mEvent.settings = settings;
59        return this;
60    }
61
62    public SmsSessionEventBuilder setServiceState(TelephonyServiceState state) {
63        mEvent.serviceState = state;
64        return this;
65    }
66
67    public SmsSessionEventBuilder setImsConnectionState(ImsConnectionState state) {
68        mEvent.imsConnectionState = state;
69        return this;
70    }
71
72    public SmsSessionEventBuilder setImsCapabilities(ImsCapabilities capabilities) {
73        mEvent.imsCapabilities = capabilities;
74        return this;
75    }
76
77    public SmsSessionEventBuilder setDataCalls(RilDataCall[] dataCalls) {
78        mEvent.dataCalls = dataCalls;
79        return this;
80    }
81
82    public SmsSessionEventBuilder setRilRequestId(int id) {
83        mEvent.setRilRequestId(id);
84        return this;
85    }
86
87    public SmsSessionEventBuilder setFormat(int format) {
88        mEvent.setFormat(format);
89        return this;
90    }
91}
92