summaryrefslogtreecommitdiff
path: root/src/com/google/android/iwlan/proto/MetricsAtom.java
blob: 33b0fcda51d4a526c5b3e25400ab1ef98e137ab8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.iwlan.proto;

import com.google.android.iwlan.IwlanStatsLog;

public class MetricsAtom {
    private int mMessageId;
    private int mApnType;
    private boolean mIsHandover;
    private String mEpdgServerAddress;
    private int mSourceRat;
    private boolean mIsCellularRoaming;
    private boolean mIsNetworkConnected;
    private int mTransportType;
    private int mSetupRequestResult;
    private int mIwlanError;
    private int mDataCallFailCause;
    private int mProcessingDurationMillis;
    private int mEpdgServerSelectionDurationMillis;
    private int mIkeTunnelEstablishmentDurationMillis;
    private int mTunnelState;
    private int mHandoverFailureMode;
    private int mRetryDurationMillis;
    private int mWifiSignalValue;

    public void setMessageId(int messageId) {
        this.mMessageId = messageId;
    }

    public void setApnType(int apnType) {
        this.mApnType = apnType;
    }

    public void setIsHandover(boolean isHandover) {
        this.mIsHandover = isHandover;
    }

    public void setEpdgServerAddress(String epdgServerAddress) {
        this.mEpdgServerAddress = epdgServerAddress;
    }

    public void setSourceRat(int sourceRat) {
        this.mSourceRat = sourceRat;
    }

    public void setIsCellularRoaming(boolean isCellularRoaming) {
        this.mIsCellularRoaming = isCellularRoaming;
    }

    public void setIsNetworkConnected(boolean isNetworkConnected) {
        this.mIsNetworkConnected = isNetworkConnected;
    }

    public void setTransportType(int transportType) {
        this.mTransportType = transportType;
    }

    public void setSetupRequestResult(int setupRequestResult) {
        this.mSetupRequestResult = setupRequestResult;
    }

    public void setIwlanError(int iwlanError) {
        this.mIwlanError = iwlanError;
    }

    public void setDataCallFailCause(int dataCallFailCause) {
        this.mDataCallFailCause = dataCallFailCause;
    }

    public void setProcessingDurationMillis(int processingDurationMillis) {
        this.mProcessingDurationMillis = processingDurationMillis;
    }

    public void setEpdgServerSelectionDurationMillis(int epdgServerSelectionDurationMillis) {
        this.mEpdgServerSelectionDurationMillis = epdgServerSelectionDurationMillis;
    }

    public void setIkeTunnelEstablishmentDurationMillis(int ikeTunnelEstablishmentDurationMillis) {
        this.mIkeTunnelEstablishmentDurationMillis = ikeTunnelEstablishmentDurationMillis;
    }

    public void setTunnelState(int tunnelState) {
        this.mTunnelState = tunnelState;
    }

    public void setHandoverFailureMode(int handoverFailureMode) {
        this.mHandoverFailureMode = handoverFailureMode;
    }

    public void setRetryDurationMillis(int retryDurationMillis) {
        this.mRetryDurationMillis = retryDurationMillis;
    }

    public void setWifiSignalValue(int wifiSignalValue) {
        this.mWifiSignalValue = wifiSignalValue;
    }

    public void sendMetricsData() {
        if (mMessageId == IwlanStatsLog.IWLAN_SETUP_DATA_CALL_RESULT_REPORTED) {
            IwlanStatsLog.write(
                    mMessageId,
                    mApnType,
                    mIsHandover,
                    mEpdgServerAddress,
                    mSourceRat,
                    mIsCellularRoaming,
                    mIsNetworkConnected,
                    mTransportType,
                    mSetupRequestResult,
                    mIwlanError,
                    mDataCallFailCause,
                    mProcessingDurationMillis,
                    mEpdgServerSelectionDurationMillis,
                    mIkeTunnelEstablishmentDurationMillis,
                    mTunnelState,
                    mHandoverFailureMode,
                    mRetryDurationMillis);
            return;
        } else if (mMessageId == IwlanStatsLog.IWLAN_PDN_DISCONNECTED_REASON_REPORTED) {
            IwlanStatsLog.write(
                    mMessageId,
                    mDataCallFailCause,
                    mIsNetworkConnected,
                    mTransportType,
                    mWifiSignalValue);
            return;
        }
    }
}