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

Commit c1d3a3e7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remplace NetworkIdentity.OEM_* with NetworkTemplate.OEM_MANAGED_*" am:...

Merge "Remplace NetworkIdentity.OEM_* with NetworkTemplate.OEM_MANAGED_*" am: 6f39fc9e am: 84f8974e am: 3edeb551

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1958663

Change-Id: I8da0da084259c4b4af44820e83c9862c71cd3ee7
parents cc0566df 3edeb551
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -22,13 +22,13 @@ import static android.content.pm.PackageInfo.REQUESTED_PERMISSION_GRANTED;
import static android.content.pm.PermissionInfo.PROTECTION_DANGEROUS;
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
import static android.net.NetworkIdentity.OEM_PAID;
import static android.net.NetworkIdentity.OEM_PRIVATE;
import static android.net.NetworkStats.METERED_YES;
import static android.net.NetworkTemplate.MATCH_ETHERNET;
import static android.net.NetworkTemplate.MATCH_MOBILE;
import static android.net.NetworkTemplate.MATCH_WIFI;
import static android.net.NetworkTemplate.OEM_MANAGED_ALL;
import static android.net.NetworkTemplate.OEM_MANAGED_PAID;
import static android.net.NetworkTemplate.OEM_MANAGED_PRIVATE;
import static android.net.NetworkTemplate.getAllCollapsedRatTypes;
import static android.os.Debug.getIonHeapsSizeKb;
import static android.os.Process.LAST_SHARED_APPLICATION_GID;
@@ -1278,7 +1278,8 @@ public class StatsPullAtomService extends SystemService {

    @NonNull private List<NetworkStatsExt> getDataUsageBytesTransferSnapshotForOemManaged() {
        final int[] matchRules = new int[] {MATCH_ETHERNET, MATCH_MOBILE, MATCH_WIFI};
        final int[] oemManagedTypes = new int[] {OEM_PAID | OEM_PRIVATE, OEM_PAID, OEM_PRIVATE};
        final int[] oemManagedTypes = new int[] {OEM_MANAGED_PAID | OEM_MANAGED_PRIVATE,
                OEM_MANAGED_PAID, OEM_MANAGED_PRIVATE};

        final List<NetworkStatsExt> ret = new ArrayList<>();

@@ -1352,12 +1353,12 @@ public class StatsPullAtomService extends SystemService {
                NetworkStatsUtils.fromPublicNetworkStats(queryNonTaggedStats);
        if (!includeTags) return nonTaggedStats;

        final android.app.usage.NetworkStats quaryTaggedStats =
        final android.app.usage.NetworkStats queryTaggedStats =
                mNetworkStatsManager.queryTaggedSummary(template,
                currentTimeInMillis - elapsedMillisSinceBoot - bucketDuration,
                currentTimeInMillis);
        final NetworkStats taggedStats =
                NetworkStatsUtils.fromPublicNetworkStats(quaryTaggedStats);
                NetworkStatsUtils.fromPublicNetworkStats(queryTaggedStats);
        return nonTaggedStats.add(taggedStats);
    }

@@ -1454,7 +1455,7 @@ public class StatsPullAtomService extends SystemService {
     */
    @NonNull private NetworkStats sliceNetworkStats(@NonNull NetworkStats stats,
            @NonNull Function<NetworkStats.Entry, NetworkStats.Entry> slicer) {
        NetworkStats ret = new NetworkStats(stats.getElapsedRealtime(), 1);
        NetworkStats ret = new NetworkStats(0, 1);
        NetworkStats.Entry entry = new NetworkStats.Entry();
        for (NetworkStats.Entry e : stats) {
            if (slicer != null) {