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

Commit 26ac208c authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Add the defaultNetwork parameter to the NetworkStats.Entry.

This allows us to remove a NetworkStats.Entry constructor that is
used only by this code. DEFAULT_NETWORK_YES is used because VT
traffic uses the network specified by the carrier.

While I'm at it, also change "1" to NetworkStats.METERED_YES, so
the code is clearer about what it's doing.

Bug: 35142602
Test: builds, boots
Change-Id: I88a288ed03437c0945b221871919ea0f78a16ebe
parent 6cb4e5ab
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -3054,7 +3054,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        // Uid -1 indicates this is for the overall device data usage.
        // Uid -1 indicates this is for the overall device data usage.
        vtDataUsageSnapshot.combineValues(new NetworkStats.Entry(
        vtDataUsageSnapshot.combineValues(new NetworkStats.Entry(
                NetworkStatsService.VT_INTERFACE, -1, NetworkStats.SET_FOREGROUND,
                NetworkStatsService.VT_INTERFACE, -1, NetworkStats.SET_FOREGROUND,
                NetworkStats.TAG_NONE, 1, isRoaming, delta / 2, 0, delta / 2, 0, 0));
                NetworkStats.TAG_NONE, NetworkStats.METERED_YES, isRoaming,
                NetworkStats.DEFAULT_NETWORK_YES, delta / 2, 0, delta / 2, 0, 0));
        mVtDataUsageSnapshot = vtDataUsageSnapshot;
        mVtDataUsageSnapshot = vtDataUsageSnapshot;


        // Create the snapshot of video call data usage per dialer. combineValues will create
        // Create the snapshot of video call data usage per dialer. combineValues will create
@@ -3076,8 +3077,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        // the only thing we can do here is splitting the usage into half rx and half tx.
        // the only thing we can do here is splitting the usage into half rx and half tx.
        vtDataUsageUidSnapshot.combineValues(new NetworkStats.Entry(
        vtDataUsageUidSnapshot.combineValues(new NetworkStats.Entry(
                NetworkStatsService.VT_INTERFACE, mDefaultDialerUid.get(),
                NetworkStatsService.VT_INTERFACE, mDefaultDialerUid.get(),
                NetworkStats.SET_FOREGROUND, NetworkStats.TAG_NONE, 1, isRoaming, delta / 2,
                NetworkStats.SET_FOREGROUND, NetworkStats.TAG_NONE, NetworkStats.METERED_YES,
                0, delta / 2, 0, 0));
                isRoaming, NetworkStats.DEFAULT_NETWORK_YES, delta / 2, 0, delta / 2, 0, 0));
        mVtDataUsageUidSnapshot = vtDataUsageUidSnapshot;
        mVtDataUsageUidSnapshot = vtDataUsageUidSnapshot;
    }
    }