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

Commit 6d53853c authored by Junyu Lai's avatar Junyu Lai
Browse files

[MS18] Augment data usage by default

Follow-up from ag/2815797, callers who uses the hidden API
will have their data augmented by default, and the public
API offers a way to opt-into augmentation.

However, since the data usage is going to the module.
All the hidden API usage must be eliminated. Also, from user
perspective, it is better for UI and API to have aligned
behavior.

Thus, enable augment data usage for public API callers.

Test: atest FrameworksNetTests \
      android.app.usage.cts.NetworkUsageStatsTest
Bug: 204830222
Change-Id: Ida254fac8d44c32d388f1886a866f7324a41ce75
parent 1fb998b8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ public class NetworkStatsManager {
        mContext = context;
        mService = service;
        setPollOnOpen(true);
        setAugmentWithSubscriptionPlan(true);
    }

    /** @hide */
+0 −4
Original line number Diff line number Diff line
@@ -655,8 +655,6 @@ public class NetworkStatsService extends INetworkStatsService.Stub {

    @Override
    public INetworkStatsSession openSession() {
        // NOTE: if callers want to get non-augmented data, they should go
        // through the public API
        return openSessionInternal(NetworkStatsManager.FLAG_AUGMENT_WITH_SUBSCRIPTION_PLAN, null);
    }

@@ -876,8 +874,6 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
    private long getNetworkTotalBytes(NetworkTemplate template, long start, long end) {
        assertSystemReady();

        // NOTE: if callers want to get non-augmented data, they should go
        // through the public API
        return internalGetSummaryForNetwork(template,
                NetworkStatsManager.FLAG_AUGMENT_WITH_SUBSCRIPTION_PLAN, start, end,
                NetworkStatsAccess.Level.DEVICE, Binder.getCallingUid()).getTotalBytes();