Search in sources :

Example 11 with StatsEvent

use of android.util.StatsEvent in project android_frameworks_opt_telephony by LineageOS.

the class MetricsCollector method pullSupportedRadioAccessFamily.

private static int pullSupportedRadioAccessFamily(List<StatsEvent> data) {
    long rafSupported = 0L;
    try {
        // The bitmask is defined in android.telephony.TelephonyManager.NetworkTypeBitMask
        for (Phone phone : PhoneFactory.getPhones()) {
            rafSupported |= phone.getRadioAccessFamily();
        }
    } catch (IllegalStateException e) {
        // Phones have not been made yet
        return StatsManager.PULL_SKIP;
    }
    StatsEvent e = StatsEvent.newBuilder().setAtomId(SUPPORTED_RADIO_ACCESS_FAMILY).writeLong(rafSupported).build();
    data.add(e);
    return StatsManager.PULL_SUCCESS;
}
Also used : Phone(com.android.internal.telephony.Phone) StatsEvent(android.util.StatsEvent)

Aggregations

StatsEvent (android.util.StatsEvent)11 Test (org.junit.Test)9 SmallTest (android.test.suitebuilder.annotation.SmallTest)6 TelephonyTest (com.android.internal.telephony.TelephonyTest)6 ArrayList (java.util.ArrayList)6 ByteBuffer (java.nio.ByteBuffer)3 Phone (com.android.internal.telephony.Phone)1 RawVoiceCallRatUsage (com.android.internal.telephony.nano.PersistAtomsProto.RawVoiceCallRatUsage)1 VoiceCallSession (com.android.internal.telephony.nano.PersistAtomsProto.VoiceCallSession)1