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.telephony.statslib; 18 19 import android.util.StatsEvent; 20 21 /** AtomsPulled class */ 22 public abstract class AtomsPulled { 23 24 /** Constructor of AtomsPulled */ AtomsPulled()25 public AtomsPulled() {} 26 27 /** 28 * Write the atom information to be recorded to the builder according to the type in order. 29 * 30 * @param builder Builder class for StatsEvent Builder object. 31 */ build(StatsEvent.Builder builder)32 public abstract void build(StatsEvent.Builder builder); 33 34 /** Return atom id defined in proto. */ getStatsId()35 public abstract int getStatsId(); 36 37 /** Return copy of the AtomsPulled */ copy()38 public abstract AtomsPulled copy(); 39 40 /** 41 * Return dimension string for pulled atoms. 42 * 43 * <p>Used for Pulled Atoms only. Pulled atoms should report the accumulated data at the time of 44 * the callback. The same type of information should be reported at once. (e.g. one per 45 * NetCapability for CountHandoverFailure) 46 * 47 * @return key string of atoms dimension 48 */ getDimension()49 public abstract String getDimension(); 50 51 /** 52 * Accumulate info to this. Used for Pulled Atoms only. 53 * 54 * @param info atoms to be accumulated to 55 */ accumulate(AtomsPulled info)56 public abstract void accumulate(AtomsPulled info); 57 } 58