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

Commit 52f72c0a authored by Michele Berionne's avatar Michele Berionne Committed by Automerger Merge Worker
Browse files

Add new metrics to VoiceCallSession atom. am: 876b085f am: 9127d462

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1544678

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If9d22a4f1aa68f071c54193168ad7223ef3b30a2
parents 1af5e4de 9127d462
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
@@ -3684,6 +3684,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
@@ -1106,6 +1106,7 @@ public class ImsPhoneConnection extends Connection implements
            mImsVideoCallProviderWrapper.onVideoStateChanged(newVideoState);
        }
        setVideoState(newVideoState);
        mOwner.getPhone().getVoiceCallSessionStats().onVideoStateChange(this, newVideoState);
    }


+8 −0
Original line number Diff line number Diff line
@@ -399,6 +399,14 @@ public class MetricsCollector implements StatsManager.StatsPullAtomCallback {
                .writeBoolean(session.isRoaming)
                // workaround: dimension required for keeping multiple pulled atoms
                .writeInt(sRandom.nextInt())
                // New fields introduced in Android S
                .writeInt(session.signalStrengthAtEnd)
                .writeInt(session.bandAtEnd)
                .writeInt(session.setupDurationMillis)
                .writeInt(session.mainCodecQuality)
                .writeBoolean(session.videoEnabled)
                .writeInt(session.ratAtConnected)
                .writeBoolean(session.isMultiparty)
                .build();
    }

+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