Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0252ded2 authored by Michele Berionne's avatar Michele Berionne
Browse files

Add new metrics to VoiceCallSession atom.

Bug: 151843373
Test: manual
Change-Id: Ic5a9f33c606a4c834142f2a4baf61a8d0bf7cf47
parent 29d89c97
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -106,6 +106,13 @@ message VoiceCallSession {
    optional bool rtt_enabled = 22;
    optional bool is_emergency = 23;
    optional bool is_roaming = 24;
    optional int32 signal_strength_at_end = 25;
    optional int32 band_at_end = 26;
    optional int32 setup_duration_millis = 27;
    optional int32 main_codec_quality = 28;
    optional bool video_enabled = 29;
    optional int32 rat_at_connected = 30;
    optional bool is_multiparty = 31;

    // Internal use only
    optional int64 setup_begin_millis = 10001;
+1 −0
Original line number Diff line number Diff line
@@ -3623,6 +3623,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            ImsPhoneConnection conn = findConnection(imsCall);
            if (conn != null) {
                conn.updateMultipartyState(isMultiParty);
                mPhone.getVoiceCallSessionStats().onMultipartyChange(conn, isMultiParty);
            }
        }

+1 −0
Original line number Diff line number Diff line
@@ -1087,6 +1087,7 @@ public class ImsPhoneConnection extends Connection implements
            mImsVideoCallProviderWrapper.onVideoStateChanged(newVideoState);
        }
        setVideoState(newVideoState);
        mOwner.getPhone().getVoiceCallSessionStats().onVideoStateChange(this, newVideoState);
    }


+9 −1
Original line number Diff line number Diff line
@@ -384,7 +384,15 @@ public class MetricsCollector implements StatsManager.StatsPullAtomCallback {
                session.isEmergency,
                session.isRoaming,
                // workaround: dimension required for keeping multiple pulled atoms
                sRandom.nextInt());
                sRandom.nextInt(),
                // New fields introduced in Android S
                session.signalStrengthAtEnd,
                session.bandAtEnd,
                session.setupDurationMillis,
                session.mainCodecQuality,
                session.videoEnabled,
                session.ratAtConnected,
                session.isMultiparty);
    }

    private static StatsEvent buildStatsEvent(IncomingSms sms) {
+6 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import com.android.telephony.Rlog;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.stream.IntStream;
@@ -118,6 +119,8 @@ public class PersistAtomsStorage {
        mAtoms.voiceCallSession =
                insertAtRandomPlace(mAtoms.voiceCallSession, call, MAX_NUM_CALL_SESSIONS);
        saveAtomsToFile();

        Rlog.d(TAG, "Add new voice call session: " + call.toString());
    }

    /** Adds RAT usages to the storage when a call session ends. */
@@ -400,10 +403,12 @@ public class PersistAtomsStorage {
            atoms.cellularDataServiceSwitchPullTimestampMillis =
                    sanitizeTimestamp(atoms.cellularDataServiceSwitchPullTimestampMillis);
            return atoms;
        } catch (NoSuchFileException e) {
            Rlog.d(TAG, "PersistAtoms file not found");
        } catch (IOException | NullPointerException e) {
            Rlog.e(TAG, "cannot load/parse PersistAtoms", e);
            return makeNewPersistAtoms();
        }
        return makeNewPersistAtoms();
    }

    /**
Loading