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

Commit 342459e0 authored by Junyu Lai's avatar Junyu Lai Committed by Automerger Merge Worker
Browse files

Merge "Support Dual ViLTE stats" am: d30b253e

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

Change-Id: Ie6cb1cccd6f68dd3955d7094df78e6a7a27526f1
parents b0f40da6 d30b253e
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -4259,7 +4259,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        // the only thing we can do here is splitting the usage into half rx and half tx.
        // Uid -1 indicates this is for the overall device data usage.
        vtDataUsageSnapshot.combineValues(new NetworkStats.Entry(
                NetworkStats.IFACE_VT, -1, NetworkStats.SET_FOREGROUND,
                getVtInterface(), -1, NetworkStats.SET_FOREGROUND,
                NetworkStats.TAG_NONE, NetworkStats.METERED_YES, isRoaming,
                NetworkStats.DEFAULT_NETWORK_YES, delta / 2, 0, delta / 2, 0, 0));
        mVtDataUsageSnapshot = vtDataUsageSnapshot;
@@ -4282,12 +4282,17 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        // Since the modem only reports the total vt data usage rather than rx/tx separately,
        // the only thing we can do here is splitting the usage into half rx and half tx.
        vtDataUsageUidSnapshot.combineValues(new NetworkStats.Entry(
                NetworkStats.IFACE_VT, mDefaultDialerUid.get(),
                getVtInterface(), mDefaultDialerUid.get(),
                NetworkStats.SET_FOREGROUND, NetworkStats.TAG_NONE, NetworkStats.METERED_YES,
                isRoaming, NetworkStats.DEFAULT_NETWORK_YES, delta / 2, 0, delta / 2, 0, 0));
        mVtDataUsageUidSnapshot = vtDataUsageUidSnapshot;
    }

    @VisibleForTesting(visibility = PRIVATE)
    public String getVtInterface() {
        return NetworkStats.IFACE_VT + mPhone.getSubId();
    }

    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    @Override
    protected void log(String msg) {
+1 −1
Original line number Diff line number Diff line
@@ -1337,7 +1337,7 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest {

        if (rxBytes != 0 || txBytes != 0) {
            expectedStats = expectedStats.addEntry(
                    new Entry(NetworkStats.IFACE_VT, UID_ALL, SET_FOREGROUND,
                    new Entry(mCTUT.getVtInterface(), UID_ALL, SET_FOREGROUND,
                            TAG_NONE, METERED_YES, ROAMING_NO, DEFAULT_NETWORK_YES, rxBytes, 0L,
                            txBytes, 0L, 0L));
        }