1 /*
2  * Copyright (C) 2023 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 
17 package com.android.internal.telephony.metrics;
18 
19 import static android.telephony.satellite.NtnSignalStrength.NTN_SIGNAL_STRENGTH_NONE;
20 
21 import android.telephony.satellite.NtnSignalStrength;
22 import android.telephony.satellite.SatelliteManager;
23 
24 import com.android.internal.telephony.PhoneFactory;
25 import com.android.internal.telephony.nano.PersistAtomsProto.CarrierRoamingSatelliteControllerStats;
26 import com.android.internal.telephony.nano.PersistAtomsProto.CarrierRoamingSatelliteSession;
27 import com.android.internal.telephony.nano.PersistAtomsProto.SatelliteAccessController;
28 import com.android.internal.telephony.nano.PersistAtomsProto.SatelliteConfigUpdater;
29 import com.android.internal.telephony.nano.PersistAtomsProto.SatelliteController;
30 import com.android.internal.telephony.nano.PersistAtomsProto.SatelliteEntitlement;
31 import com.android.internal.telephony.nano.PersistAtomsProto.SatelliteIncomingDatagram;
32 import com.android.internal.telephony.nano.PersistAtomsProto.SatelliteOutgoingDatagram;
33 import com.android.internal.telephony.nano.PersistAtomsProto.SatelliteProvision;
34 import com.android.internal.telephony.nano.PersistAtomsProto.SatelliteSession;
35 import com.android.internal.telephony.nano.PersistAtomsProto.SatelliteSosMessageRecommender;
36 import com.android.internal.telephony.satellite.SatelliteConstants;
37 import com.android.telephony.Rlog;
38 
39 import java.util.Arrays;
40 
41 /** Tracks Satellite metrics for each phone */
42 public class SatelliteStats {
43     private static final String TAG = SatelliteStats.class.getSimpleName();
44 
45     private final PersistAtomsStorage mAtomsStorage =
46             PhoneFactory.getMetricsCollector().getAtomsStorage();
47 
48     private static SatelliteStats sInstance = null;
49 
50     /** Gets the instance of SatelliteStats */
getInstance()51     public static SatelliteStats getInstance() {
52         if (sInstance == null) {
53             Rlog.d(TAG, "SatelliteStats created.");
54             synchronized (SatelliteStats.class) {
55                 sInstance = new SatelliteStats();
56             }
57         }
58         return sInstance;
59     }
60 
61     /**
62      * A data class to contain whole component of {@link SatelliteController) atom.
63      * Refer to {@link #onSatelliteControllerMetrics(SatelliteControllerParams)}.
64      */
65     public class SatelliteControllerParams {
66         private final int mCountOfSatelliteServiceEnablementsSuccess;
67         private final int mCountOfSatelliteServiceEnablementsFail;
68         private final int mCountOfOutgoingDatagramSuccess;
69         private final int mCountOfOutgoingDatagramFail;
70         private final int mCountOfIncomingDatagramSuccess;
71         private final int mCountOfIncomingDatagramFail;
72         private final int mCountOfDatagramTypeSosSmsSuccess;
73         private final int mCountOfDatagramTypeSosSmsFail;
74         private final int mCountOfDatagramTypeLocationSharingSuccess;
75         private final int mCountOfDatagramTypeLocationSharingFail;
76         private final int mCountOfProvisionSuccess;
77         private final int mCountOfProvisionFail;
78         private final int mCountOfDeprovisionSuccess;
79         private final int mCountOfDeprovisionFail;
80         private final int mTotalServiceUptimeSec;
81         private final int mTotalBatteryConsumptionPercent;
82         private final int mTotalBatteryChargedTimeSec;
83         private final int mCountOfDemoModeSatelliteServiceEnablementsSuccess;
84         private final int mCountOfDemoModeSatelliteServiceEnablementsFail;
85         private final int mCountOfDemoModeOutgoingDatagramSuccess;
86         private final int mCountOfDemoModeOutgoingDatagramFail;
87         private final int mCountOfDemoModeIncomingDatagramSuccess;
88         private final int mCountOfDemoModeIncomingDatagramFail;
89         private final int mCountOfDatagramTypeKeepAliveSuccess;
90         private final int mCountOfDatagramTypeKeepAliveFail;
91         private final int mCountOfAllowedSatelliteAccess;
92         private final int mCountOfDisallowedSatelliteAccess;
93         private final int mCountOfSatelliteAccessCheckFail;
94 
SatelliteControllerParams(Builder builder)95         private SatelliteControllerParams(Builder builder) {
96             this.mCountOfSatelliteServiceEnablementsSuccess =
97                     builder.mCountOfSatelliteServiceEnablementsSuccess;
98             this.mCountOfSatelliteServiceEnablementsFail =
99                     builder.mCountOfSatelliteServiceEnablementsFail;
100             this.mCountOfOutgoingDatagramSuccess = builder.mCountOfOutgoingDatagramSuccess;
101             this.mCountOfOutgoingDatagramFail = builder.mCountOfOutgoingDatagramFail;
102             this.mCountOfIncomingDatagramSuccess = builder.mCountOfIncomingDatagramSuccess;
103             this.mCountOfIncomingDatagramFail = builder.mCountOfIncomingDatagramFail;
104             this.mCountOfDatagramTypeSosSmsSuccess = builder.mCountOfDatagramTypeSosSmsSuccess;
105             this.mCountOfDatagramTypeSosSmsFail = builder.mCountOfDatagramTypeSosSmsFail;
106             this.mCountOfDatagramTypeLocationSharingSuccess =
107                     builder.mCountOfDatagramTypeLocationSharingSuccess;
108             this.mCountOfDatagramTypeLocationSharingFail =
109                     builder.mCountOfDatagramTypeLocationSharingFail;
110             this.mCountOfProvisionSuccess = builder.mCountOfProvisionSuccess;
111             this.mCountOfProvisionFail = builder.mCountOfProvisionFail;
112             this.mCountOfDeprovisionSuccess = builder.mCountOfDeprovisionSuccess;
113             this.mCountOfDeprovisionFail = builder.mCountOfDeprovisionFail;
114             this.mTotalServiceUptimeSec = builder.mTotalServiceUptimeSec;
115             this.mTotalBatteryConsumptionPercent = builder.mTotalBatteryConsumptionPercent;
116             this.mTotalBatteryChargedTimeSec = builder.mTotalBatteryChargedTimeSec;
117             this.mCountOfDemoModeSatelliteServiceEnablementsSuccess =
118                     builder.mCountOfDemoModeSatelliteServiceEnablementsSuccess;
119             this.mCountOfDemoModeSatelliteServiceEnablementsFail =
120                     builder.mCountOfDemoModeSatelliteServiceEnablementsFail;
121             this.mCountOfDemoModeOutgoingDatagramSuccess =
122                     builder.mCountOfDemoModeOutgoingDatagramSuccess;
123             this.mCountOfDemoModeOutgoingDatagramFail =
124                     builder.mCountOfDemoModeOutgoingDatagramFail;
125             this.mCountOfDemoModeIncomingDatagramSuccess =
126                     builder.mCountOfDemoModeIncomingDatagramSuccess;
127             this.mCountOfDemoModeIncomingDatagramFail =
128                     builder.mCountOfDemoModeIncomingDatagramFail;
129             this.mCountOfDatagramTypeKeepAliveSuccess =
130                     builder.mCountOfDatagramTypeKeepAliveSuccess;
131             this.mCountOfDatagramTypeKeepAliveFail =
132                     builder.mCountOfDatagramTypeKeepAliveFail;
133             this.mCountOfAllowedSatelliteAccess =
134                     builder.mCountOfAllowedSatelliteAccess;
135             this.mCountOfDisallowedSatelliteAccess =
136                     builder.mCountOfDisallowedSatelliteAccess;
137             this.mCountOfSatelliteAccessCheckFail =
138                     builder.mCountOfSatelliteAccessCheckFail;
139         }
140 
getCountOfSatelliteServiceEnablementsSuccess()141         public int getCountOfSatelliteServiceEnablementsSuccess() {
142             return mCountOfSatelliteServiceEnablementsSuccess;
143         }
144 
getCountOfSatelliteServiceEnablementsFail()145         public int getCountOfSatelliteServiceEnablementsFail() {
146             return mCountOfSatelliteServiceEnablementsFail;
147         }
148 
getCountOfOutgoingDatagramSuccess()149         public int getCountOfOutgoingDatagramSuccess() {
150             return mCountOfOutgoingDatagramSuccess;
151         }
152 
getCountOfOutgoingDatagramFail()153         public int getCountOfOutgoingDatagramFail() {
154             return mCountOfOutgoingDatagramFail;
155         }
156 
getCountOfIncomingDatagramSuccess()157         public int getCountOfIncomingDatagramSuccess() {
158             return mCountOfIncomingDatagramSuccess;
159         }
160 
getCountOfIncomingDatagramFail()161         public int getCountOfIncomingDatagramFail() {
162             return mCountOfIncomingDatagramFail;
163         }
164 
getCountOfDatagramTypeSosSmsSuccess()165         public int getCountOfDatagramTypeSosSmsSuccess() {
166             return mCountOfDatagramTypeSosSmsSuccess;
167         }
168 
getCountOfDatagramTypeSosSmsFail()169         public int getCountOfDatagramTypeSosSmsFail() {
170             return mCountOfDatagramTypeSosSmsFail;
171         }
172 
getCountOfDatagramTypeLocationSharingSuccess()173         public int getCountOfDatagramTypeLocationSharingSuccess() {
174             return mCountOfDatagramTypeLocationSharingSuccess;
175         }
176 
getCountOfDatagramTypeLocationSharingFail()177         public int getCountOfDatagramTypeLocationSharingFail() {
178             return mCountOfDatagramTypeLocationSharingFail;
179         }
180 
getCountOfProvisionSuccess()181         public int getCountOfProvisionSuccess() {
182             return mCountOfProvisionSuccess;
183         }
184 
getCountOfProvisionFail()185         public int getCountOfProvisionFail() {
186             return mCountOfProvisionFail;
187         }
188 
getCountOfDeprovisionSuccess()189         public int getCountOfDeprovisionSuccess() {
190             return mCountOfDeprovisionSuccess;
191         }
192 
getCountOfDeprovisionFail()193         public int getCountOfDeprovisionFail() {
194             return mCountOfDeprovisionFail;
195         }
196 
getTotalServiceUptimeSec()197         public int getTotalServiceUptimeSec() {
198             return mTotalServiceUptimeSec;
199         }
200 
getTotalBatteryConsumptionPercent()201         public int getTotalBatteryConsumptionPercent() {
202             return mTotalBatteryConsumptionPercent;
203         }
204 
getTotalBatteryChargedTimeSec()205         public int getTotalBatteryChargedTimeSec() {
206             return mTotalBatteryChargedTimeSec;
207         }
208 
getCountOfDemoModeSatelliteServiceEnablementsSuccess()209         public int getCountOfDemoModeSatelliteServiceEnablementsSuccess() {
210             return mCountOfDemoModeSatelliteServiceEnablementsSuccess;
211         }
212 
getCountOfDemoModeSatelliteServiceEnablementsFail()213         public int getCountOfDemoModeSatelliteServiceEnablementsFail() {
214             return mCountOfDemoModeSatelliteServiceEnablementsFail;
215         }
216 
getCountOfDemoModeOutgoingDatagramSuccess()217         public int getCountOfDemoModeOutgoingDatagramSuccess() {
218             return mCountOfDemoModeOutgoingDatagramSuccess;
219         }
220 
getCountOfDemoModeOutgoingDatagramFail()221         public int getCountOfDemoModeOutgoingDatagramFail() {
222             return mCountOfDemoModeOutgoingDatagramFail;
223         }
224 
getCountOfDemoModeIncomingDatagramSuccess()225         public int getCountOfDemoModeIncomingDatagramSuccess() {
226             return mCountOfDemoModeIncomingDatagramSuccess;
227         }
228 
getCountOfDemoModeIncomingDatagramFail()229         public int getCountOfDemoModeIncomingDatagramFail() {
230             return mCountOfDemoModeIncomingDatagramFail;
231         }
232 
getCountOfDatagramTypeKeepAliveSuccess()233         public int getCountOfDatagramTypeKeepAliveSuccess() {
234             return mCountOfDatagramTypeKeepAliveSuccess;
235         }
236 
getCountOfDatagramTypeKeepAliveFail()237         public int getCountOfDatagramTypeKeepAliveFail() {
238             return mCountOfDatagramTypeKeepAliveFail;
239         }
240 
getCountOfAllowedSatelliteAccess()241         public int getCountOfAllowedSatelliteAccess() {
242             return mCountOfAllowedSatelliteAccess;
243         }
244 
getCountOfDisallowedSatelliteAccess()245         public int getCountOfDisallowedSatelliteAccess() {
246             return mCountOfDisallowedSatelliteAccess;
247         }
248 
getCountOfSatelliteAccessCheckFail()249         public int getCountOfSatelliteAccessCheckFail() {
250             return mCountOfSatelliteAccessCheckFail;
251         }
252 
253         /**
254          * A builder class to create {@link SatelliteControllerParams} data structure class
255          */
256         public static class Builder {
257             private int mCountOfSatelliteServiceEnablementsSuccess = 0;
258             private int mCountOfSatelliteServiceEnablementsFail = 0;
259             private int mCountOfOutgoingDatagramSuccess = 0;
260             private int mCountOfOutgoingDatagramFail = 0;
261             private int mCountOfIncomingDatagramSuccess = 0;
262             private int mCountOfIncomingDatagramFail = 0;
263             private int mCountOfDatagramTypeSosSmsSuccess = 0;
264             private int mCountOfDatagramTypeSosSmsFail = 0;
265             private int mCountOfDatagramTypeLocationSharingSuccess = 0;
266             private int mCountOfDatagramTypeLocationSharingFail = 0;
267             private int mCountOfProvisionSuccess;
268             private int mCountOfProvisionFail;
269             private int mCountOfDeprovisionSuccess;
270             private int mCountOfDeprovisionFail;
271             private int mTotalServiceUptimeSec = 0;
272             private int mTotalBatteryConsumptionPercent = 0;
273             private int mTotalBatteryChargedTimeSec = 0;
274             private int mCountOfDemoModeSatelliteServiceEnablementsSuccess = 0;
275             private int mCountOfDemoModeSatelliteServiceEnablementsFail = 0;
276             private int mCountOfDemoModeOutgoingDatagramSuccess = 0;
277             private int mCountOfDemoModeOutgoingDatagramFail = 0;
278             private int mCountOfDemoModeIncomingDatagramSuccess = 0;
279             private int mCountOfDemoModeIncomingDatagramFail = 0;
280             private int mCountOfDatagramTypeKeepAliveSuccess = 0;
281             private int mCountOfDatagramTypeKeepAliveFail = 0;
282             private int mCountOfAllowedSatelliteAccess = 0;
283             private int mCountOfDisallowedSatelliteAccess = 0;
284             private int mCountOfSatelliteAccessCheckFail = 0;
285 
286             /**
287              * Sets countOfSatelliteServiceEnablementsSuccess value of {@link SatelliteController}
288              * atom then returns Builder class
289              */
setCountOfSatelliteServiceEnablementsSuccess( int countOfSatelliteServiceEnablementsSuccess)290             public Builder setCountOfSatelliteServiceEnablementsSuccess(
291                     int countOfSatelliteServiceEnablementsSuccess) {
292                 this.mCountOfSatelliteServiceEnablementsSuccess =
293                         countOfSatelliteServiceEnablementsSuccess;
294                 return this;
295             }
296 
297             /**
298              * Sets countOfSatelliteServiceEnablementsFail value of {@link SatelliteController} atom
299              * then returns Builder class
300              */
setCountOfSatelliteServiceEnablementsFail( int countOfSatelliteServiceEnablementsFail)301             public Builder setCountOfSatelliteServiceEnablementsFail(
302                     int countOfSatelliteServiceEnablementsFail) {
303                 this.mCountOfSatelliteServiceEnablementsFail =
304                         countOfSatelliteServiceEnablementsFail;
305                 return this;
306             }
307 
308             /**
309              * Sets countOfOutgoingDatagramSuccess value of {@link SatelliteController} atom then
310              * returns Builder class
311              */
setCountOfOutgoingDatagramSuccess(int countOfOutgoingDatagramSuccess)312             public Builder setCountOfOutgoingDatagramSuccess(int countOfOutgoingDatagramSuccess) {
313                 this.mCountOfOutgoingDatagramSuccess = countOfOutgoingDatagramSuccess;
314                 return this;
315             }
316 
317             /**
318              * Sets countOfOutgoingDatagramFail value of {@link SatelliteController} atom then
319              * returns Builder class
320              */
setCountOfOutgoingDatagramFail(int countOfOutgoingDatagramFail)321             public Builder setCountOfOutgoingDatagramFail(int countOfOutgoingDatagramFail) {
322                 this.mCountOfOutgoingDatagramFail = countOfOutgoingDatagramFail;
323                 return this;
324             }
325 
326             /**
327              * Sets countOfIncomingDatagramSuccess value of {@link SatelliteController} atom then
328              * returns Builder class
329              */
setCountOfIncomingDatagramSuccess(int countOfIncomingDatagramSuccess)330             public Builder setCountOfIncomingDatagramSuccess(int countOfIncomingDatagramSuccess) {
331                 this.mCountOfIncomingDatagramSuccess = countOfIncomingDatagramSuccess;
332                 return this;
333             }
334 
335             /**
336              * Sets countOfIncomingDatagramFail value of {@link SatelliteController} atom then
337              * returns Builder class
338              */
setCountOfIncomingDatagramFail(int countOfIncomingDatagramFail)339             public Builder setCountOfIncomingDatagramFail(int countOfIncomingDatagramFail) {
340                 this.mCountOfIncomingDatagramFail = countOfIncomingDatagramFail;
341                 return this;
342             }
343 
344             /**
345              * Sets countOfDatagramTypeSosSmsSuccess value of {@link SatelliteController} atom then
346              * returns Builder class
347              */
setCountOfDatagramTypeSosSmsSuccess( int countOfDatagramTypeSosSmsSuccess)348             public Builder setCountOfDatagramTypeSosSmsSuccess(
349                     int countOfDatagramTypeSosSmsSuccess) {
350                 this.mCountOfDatagramTypeSosSmsSuccess = countOfDatagramTypeSosSmsSuccess;
351                 return this;
352             }
353 
354             /**
355              * Sets countOfDatagramTypeSosSmsFail value of {@link SatelliteController} atom then
356              * returns Builder class
357              */
setCountOfDatagramTypeSosSmsFail(int countOfDatagramTypeSosSmsFail)358             public Builder setCountOfDatagramTypeSosSmsFail(int countOfDatagramTypeSosSmsFail) {
359                 this.mCountOfDatagramTypeSosSmsFail = countOfDatagramTypeSosSmsFail;
360                 return this;
361             }
362 
363             /**
364              * Sets countOfDatagramTypeLocationSharingSuccess value of {@link SatelliteController}
365              * atom then returns Builder class
366              */
setCountOfDatagramTypeLocationSharingSuccess( int countOfDatagramTypeLocationSharingSuccess)367             public Builder setCountOfDatagramTypeLocationSharingSuccess(
368                     int countOfDatagramTypeLocationSharingSuccess) {
369                 this.mCountOfDatagramTypeLocationSharingSuccess =
370                         countOfDatagramTypeLocationSharingSuccess;
371                 return this;
372             }
373 
374             /**
375              * Sets countOfDatagramTypeLocationSharingFail value of {@link SatelliteController}
376              * atom then returns Builder class
377              */
setCountOfDatagramTypeLocationSharingFail( int countOfDatagramTypeLocationSharingFail)378             public Builder setCountOfDatagramTypeLocationSharingFail(
379                     int countOfDatagramTypeLocationSharingFail) {
380                 this.mCountOfDatagramTypeLocationSharingFail =
381                         countOfDatagramTypeLocationSharingFail;
382                 return this;
383             }
384 
385             /**
386              * Sets countOfProvisionSuccess value of {@link SatelliteController}
387              * atom then returns Builder class
388              */
setCountOfProvisionSuccess(int countOfProvisionSuccess)389             public Builder setCountOfProvisionSuccess(int countOfProvisionSuccess) {
390                 this.mCountOfProvisionSuccess = countOfProvisionSuccess;
391                 return this;
392             }
393 
394             /**
395              * Sets countOfProvisionFail value of {@link SatelliteController}
396              * atom then returns Builder class
397              */
setCountOfProvisionFail(int countOfProvisionFail)398             public Builder setCountOfProvisionFail(int countOfProvisionFail) {
399                 this.mCountOfProvisionFail = countOfProvisionFail;
400                 return this;
401             }
402 
403             /**
404              * Sets countOfDeprovisionSuccess value of {@link SatelliteController}
405              * atom then returns Builder class
406              */
setCountOfDeprovisionSuccess(int countOfDeprovisionSuccess)407             public Builder setCountOfDeprovisionSuccess(int countOfDeprovisionSuccess) {
408                 this.mCountOfDeprovisionSuccess = countOfDeprovisionSuccess;
409                 return this;
410             }
411 
412             /**
413              * Sets countOfDeprovisionSuccess value of {@link SatelliteController}
414              * atom then returns Builder class
415              */
setCountOfDeprovisionFail(int countOfDeprovisionFail)416             public Builder setCountOfDeprovisionFail(int countOfDeprovisionFail) {
417                 this.mCountOfDeprovisionFail = countOfDeprovisionFail;
418                 return this;
419             }
420 
421             /**
422              * Sets totalServiceUptimeSec value of {@link SatelliteController} atom then
423              * returns Builder class
424              */
setTotalServiceUptimeSec(int totalServiceUptimeSec)425             public Builder setTotalServiceUptimeSec(int totalServiceUptimeSec) {
426                 this.mTotalServiceUptimeSec = totalServiceUptimeSec;
427                 return this;
428             }
429 
430             /**
431              * Sets totalBatteryConsumptionPercent value of {@link SatelliteController} atom then
432              * returns Builder class
433              */
setTotalBatteryConsumptionPercent(int totalBatteryConsumptionPercent)434             public Builder setTotalBatteryConsumptionPercent(int totalBatteryConsumptionPercent) {
435                 this.mTotalBatteryConsumptionPercent = totalBatteryConsumptionPercent;
436                 return this;
437             }
438 
439             /**
440              * Sets totalBatteryChargedTimeSec value of {@link SatelliteController} atom then
441              * returns Builder class
442              */
setTotalBatteryChargedTimeSec(int totalBatteryChargedTimeSec)443             public Builder setTotalBatteryChargedTimeSec(int totalBatteryChargedTimeSec) {
444                 this.mTotalBatteryChargedTimeSec = totalBatteryChargedTimeSec;
445                 return this;
446             }
447 
448             /**
449              * Sets countOfDemoModeSatelliteServiceEnablementsSuccess value of
450              * {@link SatelliteController} atom then returns Builder class
451              */
setCountOfDemoModeSatelliteServiceEnablementsSuccess( int countOfDemoModeSatelliteServiceEnablementsSuccess)452             public Builder setCountOfDemoModeSatelliteServiceEnablementsSuccess(
453                     int countOfDemoModeSatelliteServiceEnablementsSuccess) {
454                 this.mCountOfDemoModeSatelliteServiceEnablementsSuccess =
455                         countOfDemoModeSatelliteServiceEnablementsSuccess;
456                 return this;
457             }
458 
459             /**
460              * Sets countOfDemoModeSatelliteServiceEnablementsFail value of
461              * {@link SatelliteController} atom then returns Builder class
462              */
setCountOfDemoModeSatelliteServiceEnablementsFail( int countOfDemoModeSatelliteServiceEnablementsFail)463             public Builder setCountOfDemoModeSatelliteServiceEnablementsFail(
464                     int countOfDemoModeSatelliteServiceEnablementsFail) {
465                 this.mCountOfDemoModeSatelliteServiceEnablementsFail =
466                         countOfDemoModeSatelliteServiceEnablementsFail;
467                 return this;
468             }
469 
470             /**
471              * Sets countOfDemoModeOutgoingDatagramSuccess value of {@link SatelliteController} atom
472              * then returns Builder class
473              */
setCountOfDemoModeOutgoingDatagramSuccess( int countOfDemoModeOutgoingDatagramSuccess)474             public Builder setCountOfDemoModeOutgoingDatagramSuccess(
475                     int countOfDemoModeOutgoingDatagramSuccess) {
476                 this.mCountOfDemoModeOutgoingDatagramSuccess =
477                         countOfDemoModeOutgoingDatagramSuccess;
478                 return this;
479             }
480 
481             /**
482              * Sets countOfDemoModeOutgoingDatagramFail value of {@link SatelliteController} atom
483              * then returns Builder class
484              */
setCountOfDemoModeOutgoingDatagramFail( int countOfDemoModeOutgoingDatagramFail)485             public Builder setCountOfDemoModeOutgoingDatagramFail(
486                     int countOfDemoModeOutgoingDatagramFail) {
487                 this.mCountOfDemoModeOutgoingDatagramFail = countOfDemoModeOutgoingDatagramFail;
488                 return this;
489             }
490 
491             /**
492              * Sets countOfDemoModeIncomingDatagramSuccess value of {@link SatelliteController} atom
493              * then returns Builder class
494              */
setCountOfDemoModeIncomingDatagramSuccess( int countOfDemoModeIncomingDatagramSuccess)495             public Builder setCountOfDemoModeIncomingDatagramSuccess(
496                     int countOfDemoModeIncomingDatagramSuccess) {
497                 this.mCountOfDemoModeIncomingDatagramSuccess =
498                         countOfDemoModeIncomingDatagramSuccess;
499                 return this;
500             }
501 
502             /**
503              * Sets countOfDemoModeIncomingDatagramFail value of {@link SatelliteController} atom
504              * then returns Builder class
505              */
setCountOfDemoModeIncomingDatagramFail( int countOfDemoModeIncomingDatagramFail)506             public Builder setCountOfDemoModeIncomingDatagramFail(
507                     int countOfDemoModeIncomingDatagramFail) {
508                 this.mCountOfDemoModeIncomingDatagramFail = countOfDemoModeIncomingDatagramFail;
509                 return this;
510             }
511 
512             /**
513              * Sets countOfDatagramTypeKeepAliveSuccess value of {@link SatelliteController} atom
514              * then returns Builder class
515              */
setCountOfDatagramTypeKeepAliveSuccess( int countOfDatagramTypeKeepAliveSuccess)516             public Builder setCountOfDatagramTypeKeepAliveSuccess(
517                     int countOfDatagramTypeKeepAliveSuccess) {
518                 this.mCountOfDatagramTypeKeepAliveSuccess = countOfDatagramTypeKeepAliveSuccess;
519                 return this;
520             }
521 
522             /**
523              * Sets countOfDatagramTypeKeepAliveFail value of {@link SatelliteController} atom
524              * then returns Builder class
525              */
setCountOfDatagramTypeKeepAliveFail( int countOfDatagramTypeKeepAliveFail)526             public Builder setCountOfDatagramTypeKeepAliveFail(
527                     int countOfDatagramTypeKeepAliveFail) {
528                 this.mCountOfDatagramTypeKeepAliveFail = countOfDatagramTypeKeepAliveFail;
529                 return this;
530             }
531 
532             /**
533              * Sets countOfAllowedSatelliteAccess value of {@link SatelliteController} atom
534              * then returns Builder class
535              */
setCountOfAllowedSatelliteAccess( int countOfAllowedSatelliteAccess)536             public Builder setCountOfAllowedSatelliteAccess(
537                     int countOfAllowedSatelliteAccess) {
538                 this.mCountOfAllowedSatelliteAccess =
539                         countOfAllowedSatelliteAccess;
540                 return this;
541             }
542 
543             /**
544              * Sets countOfDisallowedSatelliteAccess value of {@link SatelliteController} atom
545              * then returns Builder class
546              */
setCountOfDisallowedSatelliteAccess( int countOfDisallowedSatelliteAccess)547             public Builder setCountOfDisallowedSatelliteAccess(
548                     int countOfDisallowedSatelliteAccess) {
549                 this.mCountOfDisallowedSatelliteAccess = countOfDisallowedSatelliteAccess;
550                 return this;
551             }
552 
553             /**
554              * Sets countOfSatelliteAccessCheckFail value of {@link SatelliteController} atom
555              * then returns Builder class
556              */
setCountOfSatelliteAccessCheckFail( int countOfSatelliteAccessCheckFail)557             public Builder setCountOfSatelliteAccessCheckFail(
558                     int countOfSatelliteAccessCheckFail) {
559                 this.mCountOfSatelliteAccessCheckFail = countOfSatelliteAccessCheckFail;
560                 return this;
561             }
562 
563             /**
564              * Returns ControllerParams, which contains whole component of
565              * {@link SatelliteController} atom
566              */
build()567             public SatelliteControllerParams build() {
568                 return new SatelliteStats()
569                         .new SatelliteControllerParams(this);
570             }
571         }
572 
573         @Override
toString()574         public String toString() {
575             return "ControllerParams("
576                     + ", countOfSatelliteServiceEnablementsSuccess="
577                     + mCountOfSatelliteServiceEnablementsSuccess
578                     + ", countOfSatelliteServiceEnablementsFail="
579                     + mCountOfSatelliteServiceEnablementsFail
580                     + ", countOfOutgoingDatagramSuccess=" + mCountOfOutgoingDatagramSuccess
581                     + ", countOfOutgoingDatagramFail=" + mCountOfOutgoingDatagramFail
582                     + ", countOfIncomingDatagramSuccess=" + mCountOfIncomingDatagramSuccess
583                     + ", countOfIncomingDatagramFail=" + mCountOfIncomingDatagramFail
584                     + ", countOfDatagramTypeSosSms=" + mCountOfDatagramTypeSosSmsSuccess
585                     + ", countOfDatagramTypeSosSms=" + mCountOfDatagramTypeSosSmsFail
586                     + ", countOfDatagramTypeLocationSharing="
587                     + mCountOfDatagramTypeLocationSharingSuccess
588                     + ", countOfDatagramTypeLocationSharing="
589                     + mCountOfDatagramTypeLocationSharingFail
590                     + ", serviceUptimeSec=" + mTotalServiceUptimeSec
591                     + ", batteryConsumptionPercent=" + mTotalBatteryConsumptionPercent
592                     + ", batteryChargedTimeSec=" + mTotalBatteryChargedTimeSec
593                     + ", countOfDemoModeSatelliteServiceEnablementsSuccess="
594                     + mCountOfDemoModeSatelliteServiceEnablementsSuccess
595                     + ", countOfDemoModeSatelliteServiceEnablementsFail="
596                     + mCountOfDemoModeSatelliteServiceEnablementsFail
597                     + ", countOfDemoModeOutgoingDatagramSuccess="
598                     + mCountOfDemoModeOutgoingDatagramSuccess
599                     + ", countOfDemoModeOutgoingDatagramFail="
600                     + mCountOfDemoModeOutgoingDatagramFail
601                     + ", countOfDemoModeIncomingDatagramSuccess="
602                     + mCountOfDemoModeIncomingDatagramSuccess
603                     + ", countOfDemoModeIncomingDatagramFail="
604                     + mCountOfDemoModeIncomingDatagramFail
605                     + ", countOfDatagramTypeKeepAliveSuccess="
606                     + mCountOfDatagramTypeKeepAliveSuccess
607                     + ", countOfDatagramTypeKeepAliveFail="
608                     + mCountOfDatagramTypeKeepAliveFail
609                     + ", countOfAllowedSatelliteAccess=" + mCountOfAllowedSatelliteAccess
610                     + ", countOfDisallowedSatelliteAccess=" + mCountOfDisallowedSatelliteAccess
611                     + ", countOfSatelliteAccessCheckFail=" + mCountOfSatelliteAccessCheckFail
612                     + ")";
613         }
614     }
615 
616     /**
617      * A data class to contain whole component of {@link SatelliteSession) atom.
618      * Refer to {@link #onSatelliteSessionMetrics(SatelliteSessionParams)}.
619      */
620     public class SatelliteSessionParams {
621         private final int mSatelliteServiceInitializationResult;
622         private final int mSatelliteTechnology;
623         private final int mTerminationResult;
624         private final long mInitializationProcessingTimeMillis;
625         private final long mTerminationProcessingTimeMillis;
626         private final int mSessionDurationSec;
627         private final int mCountOfOutgoingDatagramSuccess;
628         private final int mCountOfOutgoingDatagramFailed;
629         private final int mCountOfIncomingDatagramSuccess;
630         private final int mCountOfIncomingDatagramFailed;
631         private final boolean mIsDemoMode;
632         private final @NtnSignalStrength.NtnSignalStrengthLevel int mMaxNtnSignalStrengthLevel;
633 
SatelliteSessionParams(Builder builder)634         private SatelliteSessionParams(Builder builder) {
635             this.mSatelliteServiceInitializationResult =
636                     builder.mSatelliteServiceInitializationResult;
637             this.mSatelliteTechnology = builder.mSatelliteTechnology;
638             this.mTerminationResult = builder.mTerminationResult;
639             this.mInitializationProcessingTimeMillis = builder.mInitializationProcessingTimeMillis;
640             this.mTerminationProcessingTimeMillis =
641                     builder.mTerminationProcessingTimeMillis;
642             this.mSessionDurationSec = builder.mSessionDurationSec;
643             this.mCountOfOutgoingDatagramSuccess = builder.mCountOfOutgoingDatagramSuccess;
644             this.mCountOfOutgoingDatagramFailed = builder.mCountOfOutgoingDatagramFailed;
645             this.mCountOfIncomingDatagramSuccess = builder.mCountOfIncomingDatagramSuccess;
646             this.mCountOfIncomingDatagramFailed = builder.mCountOfIncomingDatagramFailed;
647             this.mIsDemoMode = builder.mIsDemoMode;
648             this.mMaxNtnSignalStrengthLevel = builder.mMaxNtnSignalStrengthLevel;
649         }
650 
getSatelliteServiceInitializationResult()651         public int getSatelliteServiceInitializationResult() {
652             return mSatelliteServiceInitializationResult;
653         }
654 
getSatelliteTechnology()655         public int getSatelliteTechnology() {
656             return mSatelliteTechnology;
657         }
658 
getTerminationResult()659         public int getTerminationResult() {
660             return mTerminationResult;
661         }
662 
getInitializationProcessingTime()663         public long getInitializationProcessingTime() {
664             return mInitializationProcessingTimeMillis;
665         }
666 
getTerminationProcessingTime()667         public long getTerminationProcessingTime() {
668             return mTerminationProcessingTimeMillis;
669         }
670 
getSessionDuration()671         public int getSessionDuration() {
672             return mSessionDurationSec;
673         }
674 
getCountOfOutgoingDatagramSuccess()675         public int getCountOfOutgoingDatagramSuccess() {
676             return mCountOfOutgoingDatagramSuccess;
677         }
678 
getCountOfOutgoingDatagramFailed()679         public int getCountOfOutgoingDatagramFailed() {
680             return mCountOfOutgoingDatagramFailed;
681         }
682 
getCountOfIncomingDatagramSuccess()683         public int getCountOfIncomingDatagramSuccess() {
684             return mCountOfIncomingDatagramSuccess;
685         }
686 
getCountOfIncomingDatagramFailed()687         public int getCountOfIncomingDatagramFailed() {
688             return mCountOfIncomingDatagramFailed;
689         }
690 
getIsDemoMode()691         public boolean getIsDemoMode() {
692             return mIsDemoMode;
693         }
694 
getMaxNtnSignalStrengthLevel()695         public @NtnSignalStrength.NtnSignalStrengthLevel int getMaxNtnSignalStrengthLevel() {
696             return mMaxNtnSignalStrengthLevel;
697         }
698 
699         /**
700          * A builder class to create {@link SatelliteSessionParams} data structure class
701          */
702         public static class Builder {
703             private int mSatelliteServiceInitializationResult = -1;
704             private int mSatelliteTechnology = -1;
705             private int mTerminationResult = -1;
706             private long mInitializationProcessingTimeMillis = -1;
707             private long mTerminationProcessingTimeMillis = -1;
708             private int mSessionDurationSec = -1;
709             private int mCountOfOutgoingDatagramSuccess = -1;
710             private int mCountOfOutgoingDatagramFailed = -1;
711             private int mCountOfIncomingDatagramSuccess = -1;
712             private int mCountOfIncomingDatagramFailed = -1;
713             private boolean mIsDemoMode = false;
714             private @NtnSignalStrength.NtnSignalStrengthLevel int mMaxNtnSignalStrengthLevel =
715                     NTN_SIGNAL_STRENGTH_NONE;
716 
717             /**
718              * Sets satelliteServiceInitializationResult value of {@link SatelliteSession}
719              * atom then returns Builder class
720              */
setSatelliteServiceInitializationResult( int satelliteServiceInitializationResult)721             public Builder setSatelliteServiceInitializationResult(
722                     int satelliteServiceInitializationResult) {
723                 this.mSatelliteServiceInitializationResult = satelliteServiceInitializationResult;
724                 return this;
725             }
726 
727             /**
728              * Sets satelliteTechnology value of {@link SatelliteSession} atoms then
729              * returns Builder class
730              */
setSatelliteTechnology(int satelliteTechnology)731             public Builder setSatelliteTechnology(int satelliteTechnology) {
732                 this.mSatelliteTechnology = satelliteTechnology;
733                 return this;
734             }
735 
736             /** Sets the satellite de-initialization result. */
setTerminationResult( @atelliteManager.SatelliteResult int result)737             public Builder setTerminationResult(
738                     @SatelliteManager.SatelliteResult int result) {
739                 this.mTerminationResult = result;
740                 return this;
741             }
742 
743             /** Sets the satellite initialization processing time. */
setInitializationProcessingTime(long processingTime)744             public Builder setInitializationProcessingTime(long processingTime) {
745                 this.mInitializationProcessingTimeMillis = processingTime;
746                 return this;
747             }
748 
749             /** Sets the satellite de-initialization processing time. */
setTerminationProcessingTime(long processingTime)750             public Builder setTerminationProcessingTime(long processingTime) {
751                 this.mTerminationProcessingTimeMillis = processingTime;
752                 return this;
753             }
754 
755             /** Sets the total enabled time for the satellite session. */
setSessionDuration(int sessionDurationSec)756             public Builder setSessionDuration(int sessionDurationSec) {
757                 this.mSessionDurationSec = sessionDurationSec;
758                 return this;
759             }
760 
761             /** Sets the total number of successful outgoing datagram transmission. */
setCountOfOutgoingDatagramSuccess(int countOfoutgoingDatagramSuccess)762             public Builder setCountOfOutgoingDatagramSuccess(int countOfoutgoingDatagramSuccess) {
763                 this.mCountOfOutgoingDatagramSuccess = countOfoutgoingDatagramSuccess;
764                 return this;
765             }
766 
767             /** Sets the total number of failed outgoing datagram transmission. */
setCountOfOutgoingDatagramFailed(int countOfoutgoingDatagramFailed)768             public Builder setCountOfOutgoingDatagramFailed(int countOfoutgoingDatagramFailed) {
769                 this.mCountOfOutgoingDatagramFailed = countOfoutgoingDatagramFailed;
770                 return this;
771             }
772 
773             /** Sets the total number of successful incoming datagram transmission. */
setCountOfIncomingDatagramSuccess(int countOfincomingDatagramSuccess)774             public Builder setCountOfIncomingDatagramSuccess(int countOfincomingDatagramSuccess) {
775                 this.mCountOfIncomingDatagramSuccess = countOfincomingDatagramSuccess;
776                 return this;
777             }
778 
779             /** Sets the total number of failed incoming datagram transmission. */
setCountOfIncomingDatagramFailed(int countOfincomingDatagramFailed)780             public Builder setCountOfIncomingDatagramFailed(int countOfincomingDatagramFailed) {
781                 this.mCountOfIncomingDatagramFailed = countOfincomingDatagramFailed;
782                 return this;
783             }
784 
785             /** Sets whether enabled satellite session is for demo mode or not. */
setIsDemoMode(boolean isDemoMode)786             public Builder setIsDemoMode(boolean isDemoMode) {
787                 this.mIsDemoMode = isDemoMode;
788                 return this;
789             }
790 
791             /** Sets the max ntn signal strength for the satellite session */
setMaxNtnSignalStrengthLevel( @tnSignalStrength.NtnSignalStrengthLevel int maxNtnSignalStrengthLevel)792             public Builder setMaxNtnSignalStrengthLevel(
793                     @NtnSignalStrength.NtnSignalStrengthLevel int maxNtnSignalStrengthLevel) {
794                 this.mMaxNtnSignalStrengthLevel = maxNtnSignalStrengthLevel;
795                 return this;
796             }
797 
798             /**
799              * Returns SessionParams, which contains whole component of
800              * {@link SatelliteSession} atom
801              */
build()802             public SatelliteSessionParams build() {
803                 return new SatelliteStats()
804                         .new SatelliteSessionParams(this);
805             }
806         }
807 
808         @Override
toString()809         public String toString() {
810             return "SessionParams("
811                     + ", satelliteServiceInitializationResult="
812                     + mSatelliteServiceInitializationResult
813                     + ", TerminationResult=" + mTerminationResult
814                     + ", InitializationProcessingTimeMillis=" + mInitializationProcessingTimeMillis
815                     + ", TerminationProcessingTimeMillis=" + mTerminationProcessingTimeMillis
816                     + ", SessionDurationSec=" + mSessionDurationSec
817                     + ", CountOfOutgoingDatagramSuccess=" + mCountOfOutgoingDatagramSuccess
818                     + ", CountOfOutgoingDatagramFailed=" + mCountOfOutgoingDatagramFailed
819                     + ", CountOfIncomingDatagramSuccess=" + mCountOfIncomingDatagramSuccess
820                     + ", CountOfIncomingDatagramFailed=" + mCountOfIncomingDatagramFailed
821                     + ", IsDemoMode=" + mIsDemoMode
822                     + ", MaxNtnSignalStrengthLevel=" + mMaxNtnSignalStrengthLevel
823                     + ")";
824         }
825     }
826 
827     /**
828      * A data class to contain whole component of {@link SatelliteIncomingDatagram} atom.
829      * Refer to {@link #onSatelliteIncomingDatagramMetrics(SatelliteIncomingDatagramParams)}.
830      */
831     public class SatelliteIncomingDatagramParams {
832         private final int mResultCode;
833         private final int mDatagramSizeBytes;
834         private final long mDatagramTransferTimeMillis;
835         private final boolean mIsDemoMode;
836 
SatelliteIncomingDatagramParams(Builder builder)837         private SatelliteIncomingDatagramParams(Builder builder) {
838             this.mResultCode = builder.mResultCode;
839             this.mDatagramSizeBytes = builder.mDatagramSizeBytes;
840             this.mDatagramTransferTimeMillis = builder.mDatagramTransferTimeMillis;
841             this.mIsDemoMode = builder.mIsDemoMode;
842         }
843 
getResultCode()844         public int getResultCode() {
845             return mResultCode;
846         }
847 
getDatagramSizeBytes()848         public int getDatagramSizeBytes() {
849             return mDatagramSizeBytes;
850         }
851 
getDatagramTransferTimeMillis()852         public long getDatagramTransferTimeMillis() {
853             return mDatagramTransferTimeMillis;
854         }
855 
getIsDemoMode()856         public boolean getIsDemoMode() {
857             return mIsDemoMode;
858         }
859 
860         /**
861          * A builder class to create {@link SatelliteIncomingDatagramParams} data structure class
862          */
863         public static class Builder {
864             private int mResultCode = -1;
865             private int mDatagramSizeBytes = -1;
866             private long mDatagramTransferTimeMillis = -1;
867             private boolean mIsDemoMode = false;
868 
869             /**
870              * Sets resultCode value of {@link SatelliteIncomingDatagram} atom
871              * then returns Builder class
872              */
setResultCode(int resultCode)873             public Builder setResultCode(int resultCode) {
874                 this.mResultCode = resultCode;
875                 return this;
876             }
877 
878             /**
879              * Sets datagramSizeBytes value of {@link SatelliteIncomingDatagram} atom
880              * then returns Builder class
881              */
setDatagramSizeBytes(int datagramSizeBytes)882             public Builder setDatagramSizeBytes(int datagramSizeBytes) {
883                 this.mDatagramSizeBytes = datagramSizeBytes;
884                 return this;
885             }
886 
887             /**
888              * Sets datagramTransferTimeMillis value of {@link SatelliteIncomingDatagram} atom
889              * then returns Builder class
890              */
setDatagramTransferTimeMillis(long datagramTransferTimeMillis)891             public Builder setDatagramTransferTimeMillis(long datagramTransferTimeMillis) {
892                 this.mDatagramTransferTimeMillis = datagramTransferTimeMillis;
893                 return this;
894             }
895 
896             /**
897              * Sets whether transferred datagram is in demo mode or not
898              * then returns Builder class
899              */
setIsDemoMode(boolean isDemoMode)900             public Builder setIsDemoMode(boolean isDemoMode) {
901                 this.mIsDemoMode = isDemoMode;
902                 return this;
903             }
904 
905             /**
906              * Returns IncomingDatagramParams, which contains whole component of
907              * {@link SatelliteIncomingDatagram} atom
908              */
build()909             public SatelliteIncomingDatagramParams build() {
910                 return new SatelliteStats()
911                         .new SatelliteIncomingDatagramParams(Builder.this);
912             }
913         }
914 
915         @Override
toString()916         public String toString() {
917             return "IncomingDatagramParams("
918                     + ", resultCode=" + mResultCode
919                     + ", datagramSizeBytes=" + mDatagramSizeBytes
920                     + ", datagramTransferTimeMillis=" + mDatagramTransferTimeMillis
921                     + ", isDemoMode=" + mIsDemoMode
922                     + ")";
923         }
924     }
925 
926     /**
927      * A data class to contain whole component of {@link SatelliteOutgoingDatagram} atom.
928      * Refer to {@link #onSatelliteOutgoingDatagramMetrics(SatelliteOutgoingDatagramParams)}.
929      */
930     public class SatelliteOutgoingDatagramParams {
931         private final int mDatagramType;
932         private final int mResultCode;
933         private final int mDatagramSizeBytes;
934         private final long mDatagramTransferTimeMillis;
935         private final boolean mIsDemoMode;
936 
SatelliteOutgoingDatagramParams(Builder builder)937         private SatelliteOutgoingDatagramParams(Builder builder) {
938             this.mDatagramType = builder.mDatagramType;
939             this.mResultCode = builder.mResultCode;
940             this.mDatagramSizeBytes = builder.mDatagramSizeBytes;
941             this.mDatagramTransferTimeMillis = builder.mDatagramTransferTimeMillis;
942             this.mIsDemoMode = builder.mIsDemoMode;
943         }
944 
getDatagramType()945         public int getDatagramType() {
946             return mDatagramType;
947         }
948 
getResultCode()949         public int getResultCode() {
950             return mResultCode;
951         }
952 
getDatagramSizeBytes()953         public int getDatagramSizeBytes() {
954             return mDatagramSizeBytes;
955         }
956 
getDatagramTransferTimeMillis()957         public long getDatagramTransferTimeMillis() {
958             return mDatagramTransferTimeMillis;
959         }
960 
getIsDemoMode()961         public boolean getIsDemoMode() {
962             return mIsDemoMode;
963         }
964 
965         /**
966          * A builder class to create {@link SatelliteOutgoingDatagramParams} data structure class
967          */
968         public static class Builder {
969             private int mDatagramType = -1;
970             private int mResultCode = -1;
971             private int mDatagramSizeBytes = -1;
972             private long mDatagramTransferTimeMillis = -1;
973             private boolean mIsDemoMode = false;
974 
975             /**
976              * Sets datagramType value of {@link SatelliteOutgoingDatagram} atom
977              * then returns Builder class
978              */
setDatagramType(int datagramType)979             public Builder setDatagramType(int datagramType) {
980                 this.mDatagramType = datagramType;
981                 return this;
982             }
983 
984             /**
985              * Sets resultCode value of {@link SatelliteOutgoingDatagram} atom
986              * then returns Builder class
987              */
setResultCode(int resultCode)988             public Builder setResultCode(int resultCode) {
989                 this.mResultCode = resultCode;
990                 return this;
991             }
992 
993             /**
994              * Sets datagramSizeBytes value of {@link SatelliteOutgoingDatagram} atom
995              * then returns Builder class
996              */
setDatagramSizeBytes(int datagramSizeBytes)997             public Builder setDatagramSizeBytes(int datagramSizeBytes) {
998                 this.mDatagramSizeBytes = datagramSizeBytes;
999                 return this;
1000             }
1001 
1002             /**
1003              * Sets datagramTransferTimeMillis value of {@link SatelliteOutgoingDatagram} atom
1004              * then returns Builder class
1005              */
setDatagramTransferTimeMillis(long datagramTransferTimeMillis)1006             public Builder setDatagramTransferTimeMillis(long datagramTransferTimeMillis) {
1007                 this.mDatagramTransferTimeMillis = datagramTransferTimeMillis;
1008                 return this;
1009             }
1010 
1011             /**
1012              * Sets whether transferred datagram is in demo mode or not
1013              * then returns Builder class
1014              */
setIsDemoMode(boolean isDemoMode)1015             public Builder setIsDemoMode(boolean isDemoMode) {
1016                 this.mIsDemoMode = isDemoMode;
1017                 return this;
1018             }
1019 
1020             /**
1021              * Returns OutgoingDatagramParams, which contains whole component of
1022              * {@link SatelliteOutgoingDatagram} atom
1023              */
build()1024             public SatelliteOutgoingDatagramParams build() {
1025                 return new SatelliteStats()
1026                         .new SatelliteOutgoingDatagramParams(Builder.this);
1027             }
1028         }
1029 
1030         @Override
toString()1031         public String toString() {
1032             return "OutgoingDatagramParams("
1033                     + "datagramType=" + mDatagramType
1034                     + ", resultCode=" + mResultCode
1035                     + ", datagramSizeBytes=" + mDatagramSizeBytes
1036                     + ", datagramTransferTimeMillis=" + mDatagramTransferTimeMillis
1037                     + ", isDemoMode=" + mIsDemoMode
1038                     + ")";
1039         }
1040     }
1041 
1042     /**
1043      * A data class to contain whole component of {@link SatelliteProvision} atom.
1044      * Refer to {@link #onSatelliteProvisionMetrics(SatelliteProvisionParams)}.
1045      */
1046     public class SatelliteProvisionParams {
1047         private final int mResultCode;
1048         private final int mProvisioningTimeSec;
1049         private final boolean mIsProvisionRequest;
1050         private final boolean mIsCanceled;
1051 
SatelliteProvisionParams(Builder builder)1052         private SatelliteProvisionParams(Builder builder) {
1053             this.mResultCode = builder.mResultCode;
1054             this.mProvisioningTimeSec = builder.mProvisioningTimeSec;
1055             this.mIsProvisionRequest = builder.mIsProvisionRequest;
1056             this.mIsCanceled = builder.mIsCanceled;
1057         }
1058 
getResultCode()1059         public int getResultCode() {
1060             return mResultCode;
1061         }
1062 
getProvisioningTimeSec()1063         public int getProvisioningTimeSec() {
1064             return mProvisioningTimeSec;
1065         }
1066 
getIsProvisionRequest()1067         public boolean getIsProvisionRequest() {
1068             return mIsProvisionRequest;
1069         }
1070 
getIsCanceled()1071         public boolean getIsCanceled() {
1072             return mIsCanceled;
1073         }
1074 
1075         /**
1076          * A builder class to create {@link SatelliteProvisionParams} data structure class
1077          */
1078         public static class Builder {
1079             private int mResultCode = -1;
1080             private int mProvisioningTimeSec = -1;
1081             private boolean mIsProvisionRequest = false;
1082             private boolean mIsCanceled = false;
1083 
1084             /**
1085              * Sets resultCode value of {@link SatelliteProvision} atom
1086              * then returns Builder class
1087              */
setResultCode(int resultCode)1088             public Builder setResultCode(int resultCode) {
1089                 this.mResultCode = resultCode;
1090                 return this;
1091             }
1092 
1093             /**
1094              * Sets provisioningTimeSec value of {@link SatelliteProvision} atom
1095              * then returns Builder class
1096              */
setProvisioningTimeSec(int provisioningTimeSec)1097             public Builder setProvisioningTimeSec(int provisioningTimeSec) {
1098                 this.mProvisioningTimeSec = provisioningTimeSec;
1099                 return this;
1100             }
1101 
1102             /**
1103              * Sets isProvisionRequest value of {@link SatelliteProvision} atom
1104              * then returns Builder class
1105              */
setIsProvisionRequest(boolean isProvisionRequest)1106             public Builder setIsProvisionRequest(boolean isProvisionRequest) {
1107                 this.mIsProvisionRequest = isProvisionRequest;
1108                 return this;
1109             }
1110 
1111             /**
1112              * Sets isCanceled value of {@link SatelliteProvision} atom
1113              * then returns Builder class
1114              */
setIsCanceled(boolean isCanceled)1115             public Builder setIsCanceled(boolean isCanceled) {
1116                 this.mIsCanceled = isCanceled;
1117                 return this;
1118             }
1119 
1120             /**
1121              * Returns ProvisionParams, which contains whole component of
1122              * {@link SatelliteProvision} atom
1123              */
build()1124             public SatelliteProvisionParams build() {
1125                 return new SatelliteStats()
1126                         .new SatelliteProvisionParams(Builder.this);
1127             }
1128         }
1129 
1130         @Override
toString()1131         public String toString() {
1132             return "ProvisionParams("
1133                     + "resultCode=" + mResultCode
1134                     + ", provisioningTimeSec=" + mProvisioningTimeSec
1135                     + ", isProvisionRequest=" + mIsProvisionRequest
1136                     + ", isCanceled" + mIsCanceled + ")";
1137         }
1138     }
1139 
1140     /**
1141      * A data class to contain whole component of {@link SatelliteSosMessageRecommender} atom.
1142      * Refer to {@link #onSatelliteSosMessageRecommender(SatelliteSosMessageRecommenderParams)}.
1143      */
1144     public class SatelliteSosMessageRecommenderParams {
1145         private final boolean mIsDisplaySosMessageSent;
1146         private final int mCountOfTimerStarted;
1147         private final boolean mIsImsRegistered;
1148         private final int mCellularServiceState;
1149         private final boolean mIsMultiSim;
1150         private final int mRecommendingHandoverType;
1151         private final boolean mIsSatelliteAllowedInCurrentLocation;
1152 
SatelliteSosMessageRecommenderParams(Builder builder)1153         private SatelliteSosMessageRecommenderParams(Builder builder) {
1154             this.mIsDisplaySosMessageSent = builder.mIsDisplaySosMessageSent;
1155             this.mCountOfTimerStarted = builder.mCountOfTimerStarted;
1156             this.mIsImsRegistered = builder.mIsImsRegistered;
1157             this.mCellularServiceState = builder.mCellularServiceState;
1158             this.mIsMultiSim = builder.mIsMultiSim;
1159             this.mRecommendingHandoverType = builder.mRecommendingHandoverType;
1160             this.mIsSatelliteAllowedInCurrentLocation =
1161                     builder.mIsSatelliteAllowedInCurrentLocation;
1162         }
1163 
isDisplaySosMessageSent()1164         public boolean isDisplaySosMessageSent() {
1165             return mIsDisplaySosMessageSent;
1166         }
1167 
getCountOfTimerStarted()1168         public int getCountOfTimerStarted() {
1169             return mCountOfTimerStarted;
1170         }
1171 
isImsRegistered()1172         public boolean isImsRegistered() {
1173             return mIsImsRegistered;
1174         }
1175 
getCellularServiceState()1176         public int getCellularServiceState() {
1177             return mCellularServiceState;
1178         }
1179 
isMultiSim()1180         public boolean isMultiSim() {
1181             return mIsMultiSim;
1182         }
1183 
getRecommendingHandoverType()1184         public int getRecommendingHandoverType() {
1185             return mRecommendingHandoverType;
1186         }
1187 
isSatelliteAllowedInCurrentLocation()1188         public boolean isSatelliteAllowedInCurrentLocation() {
1189             return mIsSatelliteAllowedInCurrentLocation;
1190         }
1191 
1192         /**
1193          * A builder class to create {@link SatelliteProvisionParams} data structure class
1194          */
1195         public static class Builder {
1196             private boolean mIsDisplaySosMessageSent = false;
1197             private int mCountOfTimerStarted = -1;
1198             private boolean mIsImsRegistered = false;
1199             private int mCellularServiceState = -1;
1200             private boolean mIsMultiSim = false;
1201             private int mRecommendingHandoverType = -1;
1202             private boolean mIsSatelliteAllowedInCurrentLocation = false;
1203 
1204 
1205             /**
1206              * Sets resultCode value of {@link SatelliteSosMessageRecommender} atom
1207              * then returns Builder class
1208              */
setDisplaySosMessageSent( boolean isDisplaySosMessageSent)1209             public Builder setDisplaySosMessageSent(
1210                     boolean isDisplaySosMessageSent) {
1211                 this.mIsDisplaySosMessageSent = isDisplaySosMessageSent;
1212                 return this;
1213             }
1214 
1215             /**
1216              * Sets countOfTimerIsStarted value of {@link SatelliteSosMessageRecommender} atom
1217              * then returns Builder class
1218              */
setCountOfTimerStarted(int countOfTimerStarted)1219             public Builder setCountOfTimerStarted(int countOfTimerStarted) {
1220                 this.mCountOfTimerStarted = countOfTimerStarted;
1221                 return this;
1222             }
1223 
1224             /**
1225              * Sets isImsRegistered value of {@link SatelliteSosMessageRecommender} atom
1226              * then returns Builder class
1227              */
setImsRegistered(boolean isImsRegistered)1228             public Builder setImsRegistered(boolean isImsRegistered) {
1229                 this.mIsImsRegistered = isImsRegistered;
1230                 return this;
1231             }
1232 
1233             /**
1234              * Sets cellularServiceState value of {@link SatelliteSosMessageRecommender} atom
1235              * then returns Builder class
1236              */
setCellularServiceState(int cellularServiceState)1237             public Builder setCellularServiceState(int cellularServiceState) {
1238                 this.mCellularServiceState = cellularServiceState;
1239                 return this;
1240             }
1241 
1242             /**
1243              * Sets isMultiSim value of {@link SatelliteSosMessageRecommender} atom
1244              * then returns Builder class
1245              */
setIsMultiSim(boolean isMultiSim)1246             public Builder setIsMultiSim(boolean isMultiSim) {
1247                 this.mIsMultiSim = isMultiSim;
1248                 return this;
1249             }
1250 
1251             /**
1252              * Sets recommendingHandoverType value of {@link SatelliteSosMessageRecommender} atom
1253              * then returns Builder class
1254              */
setRecommendingHandoverType(int recommendingHandoverType)1255             public Builder setRecommendingHandoverType(int recommendingHandoverType) {
1256                 this.mRecommendingHandoverType = recommendingHandoverType;
1257                 return this;
1258             }
1259 
1260             /**
1261              * Sets isSatelliteAllowedInCurrentLocation value of
1262              * {@link SatelliteSosMessageRecommender} atom then returns Builder class.
1263              */
setIsSatelliteAllowedInCurrentLocation( boolean satelliteAllowedInCurrentLocation)1264             public Builder setIsSatelliteAllowedInCurrentLocation(
1265                     boolean satelliteAllowedInCurrentLocation) {
1266                 mIsSatelliteAllowedInCurrentLocation = satelliteAllowedInCurrentLocation;
1267                 return this;
1268             }
1269 
1270             /**
1271              * Returns SosMessageRecommenderParams, which contains whole component of
1272              * {@link SatelliteSosMessageRecommenderParams} atom
1273              */
build()1274             public SatelliteSosMessageRecommenderParams build() {
1275                 return new SatelliteStats()
1276                         .new SatelliteSosMessageRecommenderParams(Builder.this);
1277             }
1278         }
1279 
1280         @Override
toString()1281         public String toString() {
1282             return "SosMessageRecommenderParams("
1283                     + "isDisplaySosMessageSent=" + mIsDisplaySosMessageSent
1284                     + ", countOfTimerStarted=" + mCountOfTimerStarted
1285                     + ", isImsRegistered=" + mIsImsRegistered
1286                     + ", cellularServiceState=" + mCellularServiceState
1287                     + ", isMultiSim=" + mIsMultiSim
1288                     + ", recommendingHandoverType=" + mRecommendingHandoverType
1289                     + ", isSatelliteAllowedInCurrentLocation="
1290                     + mIsSatelliteAllowedInCurrentLocation + ")";
1291         }
1292     }
1293 
1294     /**
1295      * A data class to contain whole component of {@link CarrierRoamingSatelliteSession} atom.
1296      * Refer to {@link #onCarrierRoamingSatelliteSessionMetrics(
1297      * CarrierRoamingSatelliteSessionParams)}.
1298      */
1299     public class CarrierRoamingSatelliteSessionParams {
1300         private final int mCarrierId;
1301         private final boolean mIsNtnRoamingInHomeCountry;
1302         private final int mTotalSatelliteModeTimeSec;
1303         private final int mNumberOfSatelliteConnections;
1304         private final int mAvgDurationOfSatelliteConnectionSec;
1305         private final int mSatelliteConnectionGapMinSec;
1306         private final int mSatelliteConnectionGapAvgSec;
1307         private final int mSatelliteConnectionGapMaxSec;
1308         private final int mRsrpAvg;
1309         private final int mRsrpMedian;
1310         private final int mRssnrAvg;
1311         private final int mRssnrMedian;
1312         private final int mCountOfIncomingSms;
1313         private final int mCountOfOutgoingSms;
1314         private final int mCountOfIncomingMms;
1315         private final int mCountOfOutgoingMms;
1316 
CarrierRoamingSatelliteSessionParams(Builder builder)1317         private CarrierRoamingSatelliteSessionParams(Builder builder) {
1318             this.mCarrierId = builder.mCarrierId;
1319             this.mIsNtnRoamingInHomeCountry = builder.mIsNtnRoamingInHomeCountry;
1320             this.mTotalSatelliteModeTimeSec = builder.mTotalSatelliteModeTimeSec;
1321             this.mNumberOfSatelliteConnections = builder.mNumberOfSatelliteConnections;
1322             this.mAvgDurationOfSatelliteConnectionSec =
1323                     builder.mAvgDurationOfSatelliteConnectionSec;
1324             this.mSatelliteConnectionGapMinSec = builder.mSatelliteConnectionGapMinSec;
1325             this.mSatelliteConnectionGapAvgSec = builder.mSatelliteConnectionGapAvgSec;
1326             this.mSatelliteConnectionGapMaxSec = builder.mSatelliteConnectionGapMaxSec;
1327             this.mRsrpAvg = builder.mRsrpAvg;
1328             this.mRsrpMedian = builder.mRsrpMedian;
1329             this.mRssnrAvg = builder.mRssnrAvg;
1330             this.mRssnrMedian = builder.mRssnrMedian;
1331             this.mCountOfIncomingSms = builder.mCountOfIncomingSms;
1332             this.mCountOfOutgoingSms = builder.mCountOfOutgoingSms;
1333             this.mCountOfIncomingMms = builder.mCountOfIncomingMms;
1334             this.mCountOfOutgoingMms = builder.mCountOfOutgoingMms;
1335         }
1336 
getCarrierId()1337         public int getCarrierId() {
1338             return mCarrierId;
1339         }
1340 
getIsNtnRoamingInHomeCountry()1341         public boolean getIsNtnRoamingInHomeCountry() {
1342             return mIsNtnRoamingInHomeCountry;
1343         }
1344 
getTotalSatelliteModeTimeSec()1345         public int getTotalSatelliteModeTimeSec() {
1346             return mTotalSatelliteModeTimeSec;
1347         }
1348 
getNumberOfSatelliteConnections()1349         public int getNumberOfSatelliteConnections() {
1350             return mNumberOfSatelliteConnections;
1351         }
1352 
getAvgDurationOfSatelliteConnectionSec()1353         public int getAvgDurationOfSatelliteConnectionSec() {
1354             return mAvgDurationOfSatelliteConnectionSec;
1355         }
1356 
getSatelliteConnectionGapMinSec()1357         public int getSatelliteConnectionGapMinSec() {
1358             return mSatelliteConnectionGapMinSec;
1359         }
1360 
getSatelliteConnectionGapAvgSec()1361         public int getSatelliteConnectionGapAvgSec() {
1362             return mSatelliteConnectionGapAvgSec;
1363         }
1364 
getSatelliteConnectionGapMaxSec()1365         public int getSatelliteConnectionGapMaxSec() {
1366             return mSatelliteConnectionGapMaxSec;
1367         }
1368 
getRsrpAvg()1369         public int getRsrpAvg() {
1370             return mRsrpAvg;
1371         }
1372 
getRsrpMedian()1373         public int getRsrpMedian() {
1374             return mRsrpMedian;
1375         }
1376 
getRssnrAvg()1377         public int getRssnrAvg() {
1378             return mRssnrAvg;
1379         }
1380 
getRssnrMedian()1381         public int getRssnrMedian() {
1382             return mRssnrMedian;
1383         }
1384 
getCountOfIncomingSms()1385         public int getCountOfIncomingSms() {
1386             return mCountOfIncomingSms;
1387         }
1388 
getCountOfOutgoingSms()1389         public int getCountOfOutgoingSms() {
1390             return mCountOfOutgoingSms;
1391         }
1392 
getCountOfIncomingMms()1393         public int getCountOfIncomingMms() {
1394             return mCountOfIncomingMms;
1395         }
1396 
getCountOfOutgoingMms()1397         public int getCountOfOutgoingMms() {
1398             return mCountOfOutgoingMms;
1399         }
1400 
1401         /**
1402          * A builder class to create {@link CarrierRoamingSatelliteSessionParams} data structure
1403          * class
1404          */
1405         public static class Builder {
1406             private int mCarrierId = -1;
1407             private boolean mIsNtnRoamingInHomeCountry = false;
1408             private int mTotalSatelliteModeTimeSec = 0;
1409             private int mNumberOfSatelliteConnections = 0;
1410             private int mAvgDurationOfSatelliteConnectionSec = 0;
1411             private int mSatelliteConnectionGapMinSec = 0;
1412             private int mSatelliteConnectionGapAvgSec = 0;
1413             private int mSatelliteConnectionGapMaxSec = 0;
1414             private int mRsrpAvg = 0;
1415             private int mRsrpMedian = 0;
1416             private int mRssnrAvg = 0;
1417             private int mRssnrMedian = 0;
1418             private int mCountOfIncomingSms = 0;
1419             private int mCountOfOutgoingSms = 0;
1420             private int mCountOfIncomingMms = 0;
1421             private int mCountOfOutgoingMms = 0;
1422 
1423             /**
1424              * Sets carrierId value of {@link CarrierRoamingSatelliteSession} atom
1425              * then returns Builder class
1426              */
setCarrierId(int carrierId)1427             public Builder setCarrierId(int carrierId) {
1428                 this.mCarrierId = carrierId;
1429                 return this;
1430             }
1431 
1432             /**
1433              * Sets isNtnRoamingInHomeCountry value of {@link CarrierRoamingSatelliteSession} atom
1434              * then returns Builder class
1435              */
setIsNtnRoamingInHomeCountry(boolean isNtnRoamingInHomeCountry)1436             public Builder setIsNtnRoamingInHomeCountry(boolean isNtnRoamingInHomeCountry) {
1437                 this.mIsNtnRoamingInHomeCountry = isNtnRoamingInHomeCountry;
1438                 return this;
1439             }
1440 
1441             /**
1442              * Sets totalSatelliteModeTimeSec value of {@link CarrierRoamingSatelliteSession} atom
1443              * then returns Builder class
1444              */
setTotalSatelliteModeTimeSec(int totalSatelliteModeTimeSec)1445             public Builder setTotalSatelliteModeTimeSec(int totalSatelliteModeTimeSec) {
1446                 this.mTotalSatelliteModeTimeSec = totalSatelliteModeTimeSec;
1447                 return this;
1448             }
1449 
1450 
1451             /**
1452              * Sets numberOfSatelliteConnections value of {@link CarrierRoamingSatelliteSession}
1453              * atom then returns Builder class
1454              */
setNumberOfSatelliteConnections(int numberOfSatelliteConnections)1455             public Builder setNumberOfSatelliteConnections(int numberOfSatelliteConnections) {
1456                 this.mNumberOfSatelliteConnections = numberOfSatelliteConnections;
1457                 return this;
1458             }
1459 
1460             /**
1461              * Sets avgDurationOfSatelliteConnectionSec value of
1462              * {@link CarrierRoamingSatelliteSession} atom then returns Builder class
1463              */
setAvgDurationOfSatelliteConnectionSec( int avgDurationOfSatelliteConnectionSec)1464             public Builder setAvgDurationOfSatelliteConnectionSec(
1465                     int avgDurationOfSatelliteConnectionSec) {
1466                 this.mAvgDurationOfSatelliteConnectionSec = avgDurationOfSatelliteConnectionSec;
1467                 return this;
1468             }
1469 
1470             /**
1471              * Sets satelliteConnectionGapMinSec value of {@link CarrierRoamingSatelliteSession}
1472              * atom then returns Builder class
1473              */
setSatelliteConnectionGapMinSec(int satelliteConnectionGapMinSec)1474             public Builder setSatelliteConnectionGapMinSec(int satelliteConnectionGapMinSec) {
1475                 this.mSatelliteConnectionGapMinSec = satelliteConnectionGapMinSec;
1476                 return this;
1477             }
1478 
1479             /**
1480              * Sets satelliteConnectionGapAvgSec value of {@link CarrierRoamingSatelliteSession}
1481              * atom then returns Builder class
1482              */
setSatelliteConnectionGapAvgSec(int satelliteConnectionGapAvgSec)1483             public Builder setSatelliteConnectionGapAvgSec(int satelliteConnectionGapAvgSec) {
1484                 this.mSatelliteConnectionGapAvgSec = satelliteConnectionGapAvgSec;
1485                 return this;
1486             }
1487 
1488             /**
1489              * Sets satelliteConnectionGapMaxSec value of {@link CarrierRoamingSatelliteSession}
1490              * atom then returns Builder class
1491              */
setSatelliteConnectionGapMaxSec(int satelliteConnectionGapMaxSec)1492             public Builder setSatelliteConnectionGapMaxSec(int satelliteConnectionGapMaxSec) {
1493                 this.mSatelliteConnectionGapMaxSec = satelliteConnectionGapMaxSec;
1494                 return this;
1495             }
1496 
1497             /**
1498              * Sets rsrpAvg value of {@link CarrierRoamingSatelliteSession}
1499              * atom then returns Builder class
1500              */
setRsrpAvg(int rsrpAvg)1501             public Builder setRsrpAvg(int rsrpAvg) {
1502                 this.mRsrpAvg = rsrpAvg;
1503                 return this;
1504             }
1505 
1506             /**
1507              * Sets rsrpMedian value of {@link CarrierRoamingSatelliteSession}
1508              * atom then returns Builder class
1509              */
setRsrpMedian(int rsrpMedian)1510             public Builder setRsrpMedian(int rsrpMedian) {
1511                 this.mRsrpMedian = rsrpMedian;
1512                 return this;
1513             }
1514 
1515             /**
1516              * Sets rssnrAvg value of {@link CarrierRoamingSatelliteSession}
1517              * atom then returns Builder class
1518              */
setRssnrAvg(int rssnrAvg)1519             public Builder setRssnrAvg(int rssnrAvg) {
1520                 this.mRssnrAvg = rssnrAvg;
1521                 return this;
1522             }
1523 
1524             /**
1525              * Sets rssnrMedian value of {@link CarrierRoamingSatelliteSession}
1526              * atom then returns Builder class
1527              */
setRssnrMedian(int rssnrMedian)1528             public Builder setRssnrMedian(int rssnrMedian) {
1529                 this.mRssnrMedian = rssnrMedian;
1530                 return this;
1531             }
1532 
1533 
1534             /**
1535              * Sets countOfIncomingSms value of {@link CarrierRoamingSatelliteSession}
1536              * atom then returns Builder class
1537              */
setCountOfIncomingSms(int countOfIncomingSms)1538             public Builder setCountOfIncomingSms(int countOfIncomingSms) {
1539                 this.mCountOfIncomingSms = countOfIncomingSms;
1540                 return this;
1541             }
1542 
1543             /**
1544              * Sets countOfOutgoingSms value of {@link CarrierRoamingSatelliteSession}
1545              * atom then returns Builder class
1546              */
setCountOfOutgoingSms(int countOfOutgoingSms)1547             public Builder setCountOfOutgoingSms(int countOfOutgoingSms) {
1548                 this.mCountOfOutgoingSms = countOfOutgoingSms;
1549                 return this;
1550             }
1551 
1552             /**
1553              * Sets countOfIncomingMms value of {@link CarrierRoamingSatelliteSession}
1554              * atom then returns Builder class
1555              */
setCountOfIncomingMms(int countOfIncomingMms)1556             public Builder setCountOfIncomingMms(int countOfIncomingMms) {
1557                 this.mCountOfIncomingMms = countOfIncomingMms;
1558                 return this;
1559             }
1560 
1561             /**
1562              * Sets countOfOutgoingMms value of {@link CarrierRoamingSatelliteSession}
1563              * atom then returns Builder class
1564              */
setCountOfOutgoingMms(int countOfOutgoingMms)1565             public Builder setCountOfOutgoingMms(int countOfOutgoingMms) {
1566                 this.mCountOfOutgoingMms = countOfOutgoingMms;
1567                 return this;
1568             }
1569 
1570             /**
1571              * Returns CarrierRoamingSatelliteSessionParams, which contains whole component of
1572              * {@link CarrierRoamingSatelliteSession} atom
1573              */
build()1574             public CarrierRoamingSatelliteSessionParams build() {
1575                 return new SatelliteStats()
1576                         .new CarrierRoamingSatelliteSessionParams(Builder.this);
1577             }
1578         }
1579 
1580         @Override
toString()1581         public String toString() {
1582             return "CarrierRoamingSatelliteSessionParams("
1583                     + "carrierId=" + mCarrierId
1584                     + ", isNtnRoamingInHomeCountry=" + mIsNtnRoamingInHomeCountry
1585                     + ", totalSatelliteModeTimeSec=" + mTotalSatelliteModeTimeSec
1586                     + ", numberOfSatelliteConnections=" + mNumberOfSatelliteConnections
1587                     + ", avgDurationOfSatelliteConnectionSec="
1588                     + mAvgDurationOfSatelliteConnectionSec
1589                     + ", satelliteConnectionGapMinSec=" + mSatelliteConnectionGapMinSec
1590                     + ", satelliteConnectionGapAvgSec=" + mSatelliteConnectionGapAvgSec
1591                     + ", satelliteConnectionGapMaxSec=" + mSatelliteConnectionGapMaxSec
1592                     + ", rsrpAvg=" + mRsrpAvg
1593                     + ", rsrpMedian=" + mRsrpMedian
1594                     + ", rssnrAvg=" + mRssnrAvg
1595                     + ", rssnrMedian=" + mRssnrMedian
1596                     + ", countOfIncomingSms=" + mCountOfIncomingSms
1597                     + ", countOfOutgoingSms=" + mCountOfOutgoingSms
1598                     + ", countOfIncomingMms=" + mCountOfIncomingMms
1599                     + ", countOfOutgoingMms=" + mCountOfOutgoingMms
1600                     + ")";
1601         }
1602     }
1603 
1604     /**
1605      * A data class to contain whole component of {@link CarrierRoamingSatelliteControllerStats}
1606      * atom. Refer to {@link #onCarrierRoamingSatelliteControllerStatsMetrics(
1607      * CarrierRoamingSatelliteControllerStatsParams)}.
1608      */
1609     public class CarrierRoamingSatelliteControllerStatsParams {
1610         private final int mConfigDataSource;
1611         private final int mCountOfEntitlementStatusQueryRequest;
1612         private final int mCountOfSatelliteConfigUpdateRequest;
1613         private final int mCountOfSatelliteNotificationDisplayed;
1614         private final int mSatelliteSessionGapMinSec;
1615         private final int mSatelliteSessionGapAvgSec;
1616         private final int mSatelliteSessionGapMaxSec;
1617 
CarrierRoamingSatelliteControllerStatsParams(Builder builder)1618         private CarrierRoamingSatelliteControllerStatsParams(Builder builder) {
1619             this.mConfigDataSource = builder.mConfigDataSource;
1620             this.mCountOfEntitlementStatusQueryRequest =
1621                     builder.mCountOfEntitlementStatusQueryRequest;
1622             this.mCountOfSatelliteConfigUpdateRequest =
1623                     builder.mCountOfSatelliteConfigUpdateRequest;
1624             this.mCountOfSatelliteNotificationDisplayed =
1625                     builder.mCountOfSatelliteNotificationDisplayed;
1626             this.mSatelliteSessionGapMinSec = builder.mSatelliteSessionGapMinSec;
1627             this.mSatelliteSessionGapAvgSec = builder.mSatelliteSessionGapAvgSec;
1628             this.mSatelliteSessionGapMaxSec = builder.mSatelliteSessionGapMaxSec;
1629         }
1630 
getConfigDataSource()1631         public int getConfigDataSource() {
1632             return mConfigDataSource;
1633         }
1634 
1635 
getCountOfEntitlementStatusQueryRequest()1636         public int getCountOfEntitlementStatusQueryRequest() {
1637             return mCountOfEntitlementStatusQueryRequest;
1638         }
1639 
getCountOfSatelliteConfigUpdateRequest()1640         public int getCountOfSatelliteConfigUpdateRequest() {
1641             return mCountOfSatelliteConfigUpdateRequest;
1642         }
1643 
getCountOfSatelliteNotificationDisplayed()1644         public int getCountOfSatelliteNotificationDisplayed() {
1645             return mCountOfSatelliteNotificationDisplayed;
1646         }
1647 
getSatelliteSessionGapMinSec()1648         public int getSatelliteSessionGapMinSec() {
1649             return mSatelliteSessionGapMinSec;
1650         }
1651 
getSatelliteSessionGapAvgSec()1652         public int getSatelliteSessionGapAvgSec() {
1653             return mSatelliteSessionGapAvgSec;
1654         }
1655 
getSatelliteSessionGapMaxSec()1656         public int getSatelliteSessionGapMaxSec() {
1657             return mSatelliteSessionGapMaxSec;
1658         }
1659 
1660         /**
1661          * A builder class to create {@link CarrierRoamingSatelliteControllerStatsParams}
1662          * data structure class
1663          */
1664         public static class Builder {
1665             private int mConfigDataSource = SatelliteConstants.CONFIG_DATA_SOURCE_UNKNOWN;
1666             private int mCountOfEntitlementStatusQueryRequest = 0;
1667             private int mCountOfSatelliteConfigUpdateRequest = 0;
1668             private int mCountOfSatelliteNotificationDisplayed = 0;
1669             private int mSatelliteSessionGapMinSec = 0;
1670             private int mSatelliteSessionGapAvgSec = 0;
1671             private int mSatelliteSessionGapMaxSec = 0;
1672 
1673             /**
1674              * Sets configDataSource value of {@link CarrierRoamingSatelliteControllerStats} atom
1675              * then returns Builder class
1676              */
setConfigDataSource(int configDataSource)1677             public Builder setConfigDataSource(int configDataSource) {
1678                 this.mConfigDataSource = configDataSource;
1679                 return this;
1680             }
1681 
1682             /**
1683              * Sets countOfEntitlementStatusQueryRequest value of
1684              * {@link CarrierRoamingSatelliteControllerStats} atom then returns Builder class
1685              */
setCountOfEntitlementStatusQueryRequest( int countOfEntitlementStatusQueryRequest)1686             public Builder setCountOfEntitlementStatusQueryRequest(
1687                     int countOfEntitlementStatusQueryRequest) {
1688                 this.mCountOfEntitlementStatusQueryRequest = countOfEntitlementStatusQueryRequest;
1689                 return this;
1690             }
1691 
1692             /**
1693              * Sets countOfSatelliteConfigUpdateRequest value of
1694              * {@link CarrierRoamingSatelliteControllerStats} atom then returns Builder class
1695              */
setCountOfSatelliteConfigUpdateRequest( int countOfSatelliteConfigUpdateRequest)1696             public Builder setCountOfSatelliteConfigUpdateRequest(
1697                     int countOfSatelliteConfigUpdateRequest) {
1698                 this.mCountOfSatelliteConfigUpdateRequest = countOfSatelliteConfigUpdateRequest;
1699                 return this;
1700             }
1701 
1702             /**
1703              * Sets countOfSatelliteNotificationDisplayed value of
1704              * {@link CarrierRoamingSatelliteControllerStats} atom then returns Builder class
1705              */
setCountOfSatelliteNotificationDisplayed( int countOfSatelliteNotificationDisplayed)1706             public Builder setCountOfSatelliteNotificationDisplayed(
1707                     int countOfSatelliteNotificationDisplayed) {
1708                 this.mCountOfSatelliteNotificationDisplayed = countOfSatelliteNotificationDisplayed;
1709                 return this;
1710             }
1711 
1712             /**
1713              * Sets satelliteSessionGapMinSec value of
1714              * {@link CarrierRoamingSatelliteControllerStats} atom then returns Builder class
1715              */
setSatelliteSessionGapMinSec(int satelliteSessionGapMinSec)1716             public Builder setSatelliteSessionGapMinSec(int satelliteSessionGapMinSec) {
1717                 this.mSatelliteSessionGapMinSec = satelliteSessionGapMinSec;
1718                 return this;
1719             }
1720 
1721             /**
1722              * Sets satelliteSessionGapAvgSec value of
1723              * {@link CarrierRoamingSatelliteControllerStats} atom then returns Builder class
1724              */
setSatelliteSessionGapAvgSec(int satelliteSessionGapAvgSec)1725             public Builder setSatelliteSessionGapAvgSec(int satelliteSessionGapAvgSec) {
1726                 this.mSatelliteSessionGapAvgSec = satelliteSessionGapAvgSec;
1727                 return this;
1728             }
1729 
1730             /**
1731              * Sets satelliteSessionGapMaxSec value of
1732              * {@link CarrierRoamingSatelliteControllerStats} atom then returns Builder class
1733              */
setSatelliteSessionGapMaxSec(int satelliteSessionGapMaxSec)1734             public Builder setSatelliteSessionGapMaxSec(int satelliteSessionGapMaxSec) {
1735                 this.mSatelliteSessionGapMaxSec = satelliteSessionGapMaxSec;
1736                 return this;
1737             }
1738 
1739             /**
1740              * Returns CarrierRoamingSatelliteControllerStatsParams, which contains whole component
1741              * of {@link CarrierRoamingSatelliteControllerStats} atom
1742              */
build()1743             public CarrierRoamingSatelliteControllerStatsParams build() {
1744                 return new SatelliteStats()
1745                         .new CarrierRoamingSatelliteControllerStatsParams(Builder.this);
1746             }
1747         }
1748 
1749         @Override
toString()1750         public String toString() {
1751             return "CarrierRoamingSatelliteControllerStatsParams("
1752                     + "configDataSource=" + mConfigDataSource
1753                     + ", countOfEntitlementStatusQueryRequest="
1754                     + mCountOfEntitlementStatusQueryRequest
1755                     + ", countOfSatelliteConfigUpdateRequest="
1756                     + mCountOfSatelliteConfigUpdateRequest
1757                     + ", countOfSatelliteNotificationDisplayed="
1758                     + mCountOfSatelliteNotificationDisplayed
1759                     + ", satelliteSessionGapMinSec=" + mSatelliteSessionGapMinSec
1760                     + ", satelliteSessionGapAvgSec=" + mSatelliteSessionGapAvgSec
1761                     + ", satelliteSessionGapMaxSec=" + mSatelliteSessionGapMaxSec
1762                     + ")";
1763         }
1764     }
1765 
1766     /**
1767      * A data class to contain whole component of {@link SatelliteEntitlement} atom.
1768      * Refer to {@link #onSatelliteEntitlementMetrics(SatelliteEntitlementParams)}.
1769      */
1770     public class SatelliteEntitlementParams {
1771         private final int mCarrierId;
1772         private final int mResult;
1773         private final int mEntitlementStatus;
1774         private final boolean mIsRetry;
1775         private final int mCount;
1776 
SatelliteEntitlementParams(Builder builder)1777         private SatelliteEntitlementParams(Builder builder) {
1778             this.mCarrierId = builder.mCarrierId;
1779             this.mResult = builder.mResult;
1780             this.mEntitlementStatus = builder.mEntitlementStatus;
1781             this.mIsRetry = builder.mIsRetry;
1782             this.mCount = builder.mCount;
1783         }
1784 
getCarrierId()1785         public int getCarrierId() {
1786             return mCarrierId;
1787         }
1788 
getResult()1789         public int getResult() {
1790             return mResult;
1791         }
1792 
getEntitlementStatus()1793         public int getEntitlementStatus() {
1794             return mEntitlementStatus;
1795         }
1796 
getIsRetry()1797         public boolean getIsRetry() {
1798             return mIsRetry;
1799         }
1800 
getCount()1801         public int getCount() {
1802             return mCount;
1803         }
1804 
1805         /**
1806          * A builder class to create {@link SatelliteEntitlementParams} data structure class
1807          */
1808         public static class Builder {
1809             private int mCarrierId = -1;
1810             private int mResult = -1;
1811             private int mEntitlementStatus = -1;
1812             private boolean mIsRetry = false;
1813             private int mCount = -1;
1814 
1815             /**
1816              * Sets carrierId value of {@link SatelliteEntitlement} atom
1817              * then returns Builder class
1818              */
setCarrierId(int carrierId)1819             public Builder setCarrierId(int carrierId) {
1820                 this.mCarrierId = carrierId;
1821                 return this;
1822             }
1823 
1824             /**
1825              * Sets result value of {@link SatelliteEntitlement} atom
1826              * then returns Builder class
1827              */
setResult(int result)1828             public Builder setResult(int result) {
1829                 this.mResult = result;
1830                 return this;
1831             }
1832 
1833             /**
1834              * Sets entitlementStatus value of {@link SatelliteEntitlement} atom
1835              * then returns Builder class
1836              */
setEntitlementStatus(int entitlementStatus)1837             public Builder setEntitlementStatus(int entitlementStatus) {
1838                 this.mEntitlementStatus = entitlementStatus;
1839                 return this;
1840             }
1841 
1842             /**
1843              * Sets isRetry value of {@link SatelliteEntitlement} atom
1844              * then returns Builder class
1845              */
setIsRetry(boolean isRetry)1846             public Builder setIsRetry(boolean isRetry) {
1847                 this.mIsRetry = isRetry;
1848                 return this;
1849             }
1850 
1851             /**
1852              * Sets count value of {@link SatelliteEntitlement} atom
1853              * then returns Builder class
1854              */
setCount(int count)1855             public Builder setCount(int count) {
1856                 this.mCount = count;
1857                 return this;
1858             }
1859 
1860             /**
1861              * Returns SatelliteEntitlementParams, which contains whole component of
1862              * {@link SatelliteEntitlement} atom
1863              */
build()1864             public SatelliteEntitlementParams build() {
1865                 return new SatelliteStats()
1866                         .new SatelliteEntitlementParams(Builder.this);
1867             }
1868         }
1869 
1870         @Override
toString()1871         public String toString() {
1872             return "SatelliteEntitlementParams("
1873                     + "carrierId=" + mCarrierId
1874                     + ", result=" + mResult
1875                     + ", entitlementStatus=" + mEntitlementStatus
1876                     + ", isRetry=" + mIsRetry
1877                     + ", count=" + mCount + ")";
1878         }
1879     }
1880 
1881     /**
1882      * A data class to contain whole component of {@link SatelliteConfigUpdater} atom.
1883      * Refer to {@link #onSatelliteConfigUpdaterMetrics(SatelliteConfigUpdaterParams)}.
1884      */
1885     public class SatelliteConfigUpdaterParams {
1886         private final int mConfigVersion;
1887         private final int mOemConfigResult;
1888         private final int mCarrierConfigResult;
1889         private final int mCount;
1890 
SatelliteConfigUpdaterParams(Builder builder)1891         private SatelliteConfigUpdaterParams(Builder builder) {
1892             this.mConfigVersion = builder.mConfigVersion;
1893             this.mOemConfigResult = builder.mOemConfigResult;
1894             this.mCarrierConfigResult = builder.mCarrierConfigResult;
1895             this.mCount = builder.mCount;
1896         }
1897 
getConfigVersion()1898         public int getConfigVersion() {
1899             return mConfigVersion;
1900         }
1901 
getOemConfigResult()1902         public int getOemConfigResult() {
1903             return mOemConfigResult;
1904         }
1905 
getCarrierConfigResult()1906         public int getCarrierConfigResult() {
1907             return mCarrierConfigResult;
1908         }
1909 
getCount()1910         public int getCount() {
1911             return mCount;
1912         }
1913 
1914         /**
1915          * A builder class to create {@link SatelliteConfigUpdaterParams} data structure class
1916          */
1917         public static class Builder {
1918             private int mConfigVersion = -1;
1919             private int mOemConfigResult = -1;
1920             private int mCarrierConfigResult = -1;
1921             private int mCount = -1;
1922 
1923             /**
1924              * Sets configVersion value of {@link SatelliteConfigUpdater} atom
1925              * then returns Builder class
1926              */
setConfigVersion(int configVersion)1927             public Builder setConfigVersion(int configVersion) {
1928                 this.mConfigVersion = configVersion;
1929                 return this;
1930             }
1931 
1932             /**
1933              * Sets oemConfigResult value of {@link SatelliteConfigUpdater} atom
1934              * then returns Builder class
1935              */
setOemConfigResult(int oemConfigResult)1936             public Builder setOemConfigResult(int oemConfigResult) {
1937                 this.mOemConfigResult = oemConfigResult;
1938                 return this;
1939             }
1940 
1941             /**
1942              * Sets carrierConfigResult value of {@link SatelliteConfigUpdater} atom
1943              * then returns Builder class
1944              */
setCarrierConfigResult(int carrierConfigResult)1945             public Builder setCarrierConfigResult(int carrierConfigResult) {
1946                 this.mCarrierConfigResult = carrierConfigResult;
1947                 return this;
1948             }
1949 
1950             /**
1951              * Sets count value of {@link SatelliteConfigUpdater} atom
1952              * then returns Builder class
1953              */
setCount(int count)1954             public Builder setCount(int count) {
1955                 this.mCount = count;
1956                 return this;
1957             }
1958 
1959             /**
1960              * Returns SatelliteConfigUpdaterParams, which contains whole component of
1961              * {@link SatelliteConfigUpdater} atom
1962              */
build()1963             public SatelliteConfigUpdaterParams build() {
1964                 return new SatelliteStats()
1965                         .new SatelliteConfigUpdaterParams(Builder.this);
1966             }
1967         }
1968 
1969         @Override
toString()1970         public String toString() {
1971             return "SatelliteConfigUpdaterParams("
1972                     + "configVersion=" + mConfigVersion
1973                     + ", oemConfigResult=" + mOemConfigResult
1974                     + ", carrierConfigResult=" + mCarrierConfigResult
1975                     + ", count=" + mCount + ")";
1976         }
1977     }
1978 
1979     /**
1980      * A data class to contain whole component of {@link SatelliteAccessControllerParams} atom.
1981      * Refer to {@link #onSatelliteAccessControllerMetrics(SatelliteAccessControllerParams)}.
1982      */
1983     public class SatelliteAccessControllerParams {
1984         private final @SatelliteConstants.AccessControlType int mAccessControlType;
1985         private final long mLocationQueryTimeMillis;
1986         private final long mOnDeviceLookupTimeMillis;
1987         private final long mTotalCheckingTimeMillis;
1988         private final boolean mIsAllowed;
1989         private final boolean mIsEmergency;
1990         private final @SatelliteManager.SatelliteResult int mResultCode;
1991         private final String[] mCountryCodes;
1992         private final @SatelliteConstants.ConfigDataSource int mConfigDataSource;
1993 
SatelliteAccessControllerParams(Builder builder)1994         private SatelliteAccessControllerParams(Builder builder) {
1995             this.mAccessControlType = builder.mAccessControlType;
1996             this.mLocationQueryTimeMillis = builder.mLocationQueryTimeMillis;
1997             this.mOnDeviceLookupTimeMillis = builder.mOnDeviceLookupTimeMillis;
1998             this.mTotalCheckingTimeMillis = builder.mTotalCheckingTimeMillis;
1999             this.mIsAllowed = builder.mIsAllowed;
2000             this.mIsEmergency = builder.mIsEmergency;
2001             this.mResultCode = builder.mResultCode;
2002             this.mCountryCodes = builder.mCountryCodes;
2003             this.mConfigDataSource = builder.mConfigDataSource;
2004         }
2005 
getAccessControlType()2006         public @SatelliteConstants.AccessControlType int getAccessControlType() {
2007             return mAccessControlType;
2008         }
2009 
getLocationQueryTime()2010         public long getLocationQueryTime() {
2011             return mLocationQueryTimeMillis;
2012         }
2013 
getOnDeviceLookupTime()2014         public long getOnDeviceLookupTime() {
2015             return mOnDeviceLookupTimeMillis;
2016         }
2017 
getTotalCheckingTime()2018         public long getTotalCheckingTime() {
2019             return mTotalCheckingTimeMillis;
2020         }
2021 
getIsAllowed()2022         public boolean getIsAllowed() {
2023             return mIsAllowed;
2024         }
2025 
getIsEmergency()2026         public boolean getIsEmergency() {
2027             return mIsEmergency;
2028         }
2029 
getResultCode()2030         public @SatelliteManager.SatelliteResult int getResultCode() {
2031             return mResultCode;
2032         }
2033 
getCountryCodes()2034         public String[] getCountryCodes() {
2035             return mCountryCodes;
2036         }
2037 
getConfigDataSource()2038         public @SatelliteConstants.ConfigDataSource int getConfigDataSource() {
2039             return mConfigDataSource;
2040         }
2041 
2042         /**
2043          * A builder class to create {@link SatelliteAccessControllerParams} data structure class
2044          */
2045         public static class Builder {
2046             private @SatelliteConstants.AccessControlType int mAccessControlType;
2047             private long mLocationQueryTimeMillis;
2048             private long mOnDeviceLookupTimeMillis;
2049             private long mTotalCheckingTimeMillis;
2050             private boolean mIsAllowed;
2051             private boolean mIsEmergency;
2052             private @SatelliteManager.SatelliteResult int mResultCode;
2053             private String[] mCountryCodes;
2054             private @SatelliteConstants.ConfigDataSource int mConfigDataSource;
2055 
2056             /**
2057              * Sets AccessControlType value of {@link #SatelliteAccessController}
2058              * atom then returns Builder class
2059              */
setAccessControlType( @atelliteConstants.AccessControlType int accessControlType)2060             public Builder setAccessControlType(
2061                     @SatelliteConstants.AccessControlType int accessControlType) {
2062                 this.mAccessControlType = accessControlType;
2063                 return this;
2064             }
2065 
2066             /** Sets the location query time for current satellite enablement. */
setLocationQueryTime(long locationQueryTimeMillis)2067             public Builder setLocationQueryTime(long locationQueryTimeMillis) {
2068                 this.mLocationQueryTimeMillis = locationQueryTimeMillis;
2069                 return this;
2070             }
2071 
2072             /** Sets the on device lookup time for current satellite enablement. */
setOnDeviceLookupTime(long onDeviceLookupTimeMillis)2073             public Builder setOnDeviceLookupTime(long onDeviceLookupTimeMillis) {
2074                 this.mOnDeviceLookupTimeMillis = onDeviceLookupTimeMillis;
2075                 return this;
2076             }
2077 
2078             /** Sets the total checking time for current satellite enablement. */
setTotalCheckingTime(long totalCheckingTimeMillis)2079             public Builder setTotalCheckingTime(long totalCheckingTimeMillis) {
2080                 this.mTotalCheckingTimeMillis = totalCheckingTimeMillis;
2081                 return this;
2082             }
2083 
2084             /** Sets whether the satellite communication is allowed from current location. */
setIsAllowed(boolean isAllowed)2085             public Builder setIsAllowed(boolean isAllowed) {
2086                 this.mIsAllowed = isAllowed;
2087                 return this;
2088             }
2089 
2090             /** Sets whether the current satellite enablement is for emergency or not. */
setIsEmergency(boolean isEmergency)2091             public Builder setIsEmergency(boolean isEmergency) {
2092                 this.mIsEmergency = isEmergency;
2093                 return this;
2094             }
2095 
2096             /** Sets the result code for checking whether satellite service is allowed from current
2097              location. */
setResult(int result)2098             public Builder setResult(int result) {
2099                 this.mResultCode = result;
2100                 return this;
2101             }
2102 
2103             /** Sets the country code for current location while attempting satellite enablement. */
setCountryCodes(String[] countryCodes)2104             public Builder setCountryCodes(String[] countryCodes) {
2105                 this.mCountryCodes = Arrays.stream(countryCodes).toArray(String[]::new);
2106                 return this;
2107             }
2108 
2109             /** Sets the config data source for checking whether satellite service is allowed from
2110              current location. */
setConfigDatasource(int configDatasource)2111             public Builder setConfigDatasource(int configDatasource) {
2112                 this.mConfigDataSource = configDatasource;
2113                 return this;
2114             }
2115 
2116             /**
2117              * Returns AccessControllerParams, which contains whole component of
2118              * {@link #SatelliteAccessController} atom
2119              */
build()2120             public SatelliteAccessControllerParams build() {
2121                 return new SatelliteStats()
2122                         .new SatelliteAccessControllerParams(this);
2123             }
2124         }
2125 
2126         @Override
toString()2127         public String toString() {
2128             return "AccessControllerParams("
2129                     + ", AccessControlType=" + mAccessControlType
2130                     + ", LocationQueryTime=" + mLocationQueryTimeMillis
2131                     + ", OnDeviceLookupTime=" + mOnDeviceLookupTimeMillis
2132                     + ", TotalCheckingTime=" + mTotalCheckingTimeMillis
2133                     + ", IsAllowed=" + mIsAllowed
2134                     + ", IsEmergency=" + mIsEmergency
2135                     + ", ResultCode=" + mResultCode
2136                     + ", CountryCodes=" + Arrays.toString(mCountryCodes)
2137                     + ", ConfigDataSource=" + mConfigDataSource
2138                     + ")";
2139         }
2140     }
2141 
2142     /**  Create a new atom or update an existing atom for SatelliteController metrics */
onSatelliteControllerMetrics(SatelliteControllerParams param)2143     public synchronized void onSatelliteControllerMetrics(SatelliteControllerParams param) {
2144         SatelliteController proto = new SatelliteController();
2145         proto.countOfSatelliteServiceEnablementsSuccess =
2146                 param.getCountOfSatelliteServiceEnablementsSuccess();
2147         proto.countOfSatelliteServiceEnablementsFail =
2148                 param.getCountOfSatelliteServiceEnablementsFail();
2149         proto.countOfOutgoingDatagramSuccess = param.getCountOfOutgoingDatagramSuccess();
2150         proto.countOfOutgoingDatagramFail = param.getCountOfOutgoingDatagramFail();
2151         proto.countOfIncomingDatagramSuccess = param.getCountOfIncomingDatagramSuccess();
2152         proto.countOfIncomingDatagramFail = param.getCountOfIncomingDatagramFail();
2153         proto.countOfDatagramTypeSosSmsSuccess = param.getCountOfDatagramTypeSosSmsSuccess();
2154         proto.countOfDatagramTypeSosSmsFail = param.getCountOfDatagramTypeSosSmsFail();
2155         proto.countOfDatagramTypeLocationSharingSuccess =
2156                 param.getCountOfDatagramTypeLocationSharingSuccess();
2157         proto.countOfDatagramTypeLocationSharingFail =
2158                 param.getCountOfDatagramTypeLocationSharingFail();
2159         proto.countOfProvisionSuccess = param.getCountOfProvisionSuccess();
2160         proto.countOfProvisionFail = param.getCountOfProvisionFail();
2161         proto.countOfDeprovisionSuccess = param.getCountOfDeprovisionSuccess();
2162         proto.countOfDeprovisionFail = param.getCountOfDeprovisionFail();
2163         proto.totalServiceUptimeSec = param.getTotalServiceUptimeSec();
2164         proto.totalBatteryConsumptionPercent = param.getTotalBatteryConsumptionPercent();
2165         proto.totalBatteryChargedTimeSec = param.getTotalBatteryChargedTimeSec();
2166         proto.countOfDemoModeSatelliteServiceEnablementsSuccess =
2167                 param.getCountOfDemoModeSatelliteServiceEnablementsSuccess();
2168         proto.countOfDemoModeSatelliteServiceEnablementsFail =
2169                 param.getCountOfDemoModeSatelliteServiceEnablementsFail();
2170         proto.countOfDemoModeOutgoingDatagramSuccess =
2171                 param.getCountOfDemoModeOutgoingDatagramSuccess();
2172         proto.countOfDemoModeOutgoingDatagramFail = param.getCountOfDemoModeOutgoingDatagramFail();
2173         proto.countOfDemoModeIncomingDatagramSuccess =
2174                 param.getCountOfDemoModeIncomingDatagramSuccess();
2175         proto.countOfDemoModeIncomingDatagramFail = param.getCountOfDemoModeIncomingDatagramFail();
2176         proto.countOfDatagramTypeKeepAliveSuccess = param.getCountOfDatagramTypeKeepAliveSuccess();
2177         proto.countOfDatagramTypeKeepAliveFail = param.getCountOfDatagramTypeKeepAliveFail();
2178         mAtomsStorage.addSatelliteControllerStats(proto);
2179     }
2180 
2181     /**  Create a new atom or update an existing atom for SatelliteSession metrics */
onSatelliteSessionMetrics(SatelliteSessionParams param)2182     public synchronized void onSatelliteSessionMetrics(SatelliteSessionParams param) {
2183         SatelliteSession proto = new SatelliteSession();
2184         proto.satelliteServiceInitializationResult =
2185                 param.getSatelliteServiceInitializationResult();
2186         proto.satelliteTechnology = param.getSatelliteTechnology();
2187         proto.count = 1;
2188         proto.satelliteServiceTerminationResult = param.getTerminationResult();
2189         proto.initializationProcessingTimeMillis = param.getInitializationProcessingTime();
2190         proto.terminationProcessingTimeMillis = param.getTerminationProcessingTime();
2191         proto.sessionDurationSeconds = param.getSessionDuration();
2192         proto.countOfOutgoingDatagramSuccess = param.getCountOfIncomingDatagramSuccess();
2193         proto.countOfOutgoingDatagramFailed = param.getCountOfOutgoingDatagramFailed();
2194         proto.countOfIncomingDatagramSuccess = param.getCountOfIncomingDatagramSuccess();
2195         proto.countOfIncomingDatagramFailed = param.getCountOfOutgoingDatagramFailed();
2196         proto.isDemoMode = param.getIsDemoMode();
2197         proto.maxNtnSignalStrengthLevel = param.getMaxNtnSignalStrengthLevel();
2198         mAtomsStorage.addSatelliteSessionStats(proto);
2199     }
2200 
2201     /**  Create a new atom for SatelliteIncomingDatagram metrics */
onSatelliteIncomingDatagramMetrics( SatelliteIncomingDatagramParams param)2202     public synchronized void onSatelliteIncomingDatagramMetrics(
2203             SatelliteIncomingDatagramParams param) {
2204         SatelliteIncomingDatagram proto = new SatelliteIncomingDatagram();
2205         proto.resultCode = param.getResultCode();
2206         proto.datagramSizeBytes = param.getDatagramSizeBytes();
2207         proto.datagramTransferTimeMillis = param.getDatagramTransferTimeMillis();
2208         proto.isDemoMode = param.getIsDemoMode();
2209         mAtomsStorage.addSatelliteIncomingDatagramStats(proto);
2210     }
2211 
2212     /**  Create a new atom for SatelliteOutgoingDatagram metrics */
onSatelliteOutgoingDatagramMetrics( SatelliteOutgoingDatagramParams param)2213     public synchronized void onSatelliteOutgoingDatagramMetrics(
2214             SatelliteOutgoingDatagramParams param) {
2215         SatelliteOutgoingDatagram proto = new SatelliteOutgoingDatagram();
2216         proto.datagramType = param.getDatagramType();
2217         proto.resultCode = param.getResultCode();
2218         proto.datagramSizeBytes = param.getDatagramSizeBytes();
2219         proto.datagramTransferTimeMillis = param.getDatagramTransferTimeMillis();
2220         proto.isDemoMode = param.getIsDemoMode();
2221         mAtomsStorage.addSatelliteOutgoingDatagramStats(proto);
2222     }
2223 
2224     /**  Create a new atom for SatelliteProvision metrics */
onSatelliteProvisionMetrics(SatelliteProvisionParams param)2225     public synchronized void onSatelliteProvisionMetrics(SatelliteProvisionParams param) {
2226         SatelliteProvision proto = new SatelliteProvision();
2227         proto.resultCode = param.getResultCode();
2228         proto.provisioningTimeSec = param.getProvisioningTimeSec();
2229         proto.isProvisionRequest = param.getIsProvisionRequest();
2230         proto.isCanceled = param.getIsCanceled();
2231         mAtomsStorage.addSatelliteProvisionStats(proto);
2232     }
2233 
2234     /**  Create a new atom or update an existing atom for SatelliteSosMessageRecommender metrics */
onSatelliteSosMessageRecommender( SatelliteSosMessageRecommenderParams param)2235     public synchronized void onSatelliteSosMessageRecommender(
2236             SatelliteSosMessageRecommenderParams param) {
2237         SatelliteSosMessageRecommender proto = new SatelliteSosMessageRecommender();
2238         proto.isDisplaySosMessageSent = param.isDisplaySosMessageSent();
2239         proto.countOfTimerStarted = param.getCountOfTimerStarted();
2240         proto.isImsRegistered = param.isImsRegistered();
2241         proto.cellularServiceState = param.getCellularServiceState();
2242         proto.isMultiSim = param.isMultiSim();
2243         proto.recommendingHandoverType = param.getRecommendingHandoverType();
2244         proto.isSatelliteAllowedInCurrentLocation = param.isSatelliteAllowedInCurrentLocation();
2245         proto.count = 1;
2246         mAtomsStorage.addSatelliteSosMessageRecommenderStats(proto);
2247     }
2248 
2249     /**  Create a new atom for CarrierRoamingSatelliteSession metrics */
onCarrierRoamingSatelliteSessionMetrics( CarrierRoamingSatelliteSessionParams param)2250     public synchronized  void onCarrierRoamingSatelliteSessionMetrics(
2251             CarrierRoamingSatelliteSessionParams param) {
2252         CarrierRoamingSatelliteSession proto = new CarrierRoamingSatelliteSession();
2253         proto.carrierId = param.getCarrierId();
2254         proto.isNtnRoamingInHomeCountry = param.getIsNtnRoamingInHomeCountry();
2255         proto.totalSatelliteModeTimeSec = param.getTotalSatelliteModeTimeSec();
2256         proto.numberOfSatelliteConnections = param.getNumberOfSatelliteConnections();
2257         proto.avgDurationOfSatelliteConnectionSec = param.getAvgDurationOfSatelliteConnectionSec();
2258         proto.satelliteConnectionGapMinSec = param.mSatelliteConnectionGapMinSec;
2259         proto.satelliteConnectionGapAvgSec = param.mSatelliteConnectionGapAvgSec;
2260         proto.satelliteConnectionGapMaxSec = param.mSatelliteConnectionGapMaxSec;
2261         proto.rsrpAvg = param.mRsrpAvg;
2262         proto.rsrpMedian = param.mRsrpMedian;
2263         proto.rssnrAvg = param.mRssnrAvg;
2264         proto.rssnrMedian = param.mRssnrMedian;
2265         proto.countOfIncomingSms = param.mCountOfIncomingSms;
2266         proto.countOfOutgoingSms = param.mCountOfOutgoingSms;
2267         proto.countOfIncomingMms = param.mCountOfIncomingMms;
2268         proto.countOfOutgoingMms = param.mCountOfOutgoingMms;
2269         mAtomsStorage.addCarrierRoamingSatelliteSessionStats(proto);
2270     }
2271 
2272     /**  Create a new atom for CarrierRoamingSatelliteSession metrics */
onCarrierRoamingSatelliteControllerStatsMetrics( CarrierRoamingSatelliteControllerStatsParams param)2273     public synchronized  void onCarrierRoamingSatelliteControllerStatsMetrics(
2274             CarrierRoamingSatelliteControllerStatsParams param) {
2275         CarrierRoamingSatelliteControllerStats proto = new CarrierRoamingSatelliteControllerStats();
2276         proto.configDataSource = param.mConfigDataSource;
2277         proto.countOfEntitlementStatusQueryRequest = param.mCountOfEntitlementStatusQueryRequest;
2278         proto.countOfSatelliteConfigUpdateRequest = param.mCountOfSatelliteConfigUpdateRequest;
2279         proto.countOfSatelliteNotificationDisplayed = param.mCountOfSatelliteNotificationDisplayed;
2280         proto.satelliteSessionGapMinSec = param.mSatelliteSessionGapMinSec;
2281         proto.satelliteSessionGapAvgSec = param.mSatelliteSessionGapAvgSec;
2282         proto.satelliteSessionGapMaxSec = param.mSatelliteSessionGapMaxSec;
2283         mAtomsStorage.addCarrierRoamingSatelliteControllerStats(proto);
2284     }
2285 
2286     /**  Create a new atom for SatelliteEntitlement metrics */
onSatelliteEntitlementMetrics(SatelliteEntitlementParams param)2287     public synchronized  void onSatelliteEntitlementMetrics(SatelliteEntitlementParams param) {
2288         SatelliteEntitlement proto = new SatelliteEntitlement();
2289         proto.carrierId = param.getCarrierId();
2290         proto.result = param.getResult();
2291         proto.entitlementStatus = param.getEntitlementStatus();
2292         proto.isRetry = param.getIsRetry();
2293         proto.count = param.getCount();
2294         mAtomsStorage.addSatelliteEntitlementStats(proto);
2295     }
2296 
2297     /**  Create a new atom for SatelliteConfigUpdater metrics */
onSatelliteConfigUpdaterMetrics(SatelliteConfigUpdaterParams param)2298     public synchronized  void onSatelliteConfigUpdaterMetrics(SatelliteConfigUpdaterParams param) {
2299         SatelliteConfigUpdater proto = new SatelliteConfigUpdater();
2300         proto.configVersion = param.getConfigVersion();
2301         proto.oemConfigResult = param.getOemConfigResult();
2302         proto.carrierConfigResult = param.getCarrierConfigResult();
2303         proto.count = param.getCount();
2304         mAtomsStorage.addSatelliteConfigUpdaterStats(proto);
2305     }
2306 
2307     /**  Create a new atom or update an existing atom for SatelliteAccessController metrics */
onSatelliteAccessControllerMetrics( SatelliteAccessControllerParams param)2308     public synchronized void onSatelliteAccessControllerMetrics(
2309             SatelliteAccessControllerParams param) {
2310         SatelliteAccessController proto = new SatelliteAccessController();
2311         proto.accessControlType = param.getAccessControlType();
2312         proto.locationQueryTimeMillis = param.getLocationQueryTime();
2313         proto.onDeviceLookupTimeMillis = param.getOnDeviceLookupTime();
2314         proto.totalCheckingTimeMillis = param.getTotalCheckingTime();
2315         proto.isAllowed = param.getIsAllowed();
2316         proto.isEmergency = param.getIsEmergency();
2317         proto.resultCode = param.getResultCode();
2318         proto.countryCodes = param.getCountryCodes();
2319         proto.configDataSource = param.getConfigDataSource();
2320         mAtomsStorage.addSatelliteAccessControllerStats(proto);
2321     }
2322 }
2323