commit | c51f71fb41689cdd60de2a34fb314c5308c76415 | [log] [tgz] |
---|---|---|
author | Junyu Lai <junyulai@google.com> | Mon Aug 19 17:13:12 2024 +0800 |
committer | Junyu Lai <junyulai@google.com> | Mon Aug 19 17:39:15 2024 +0800 |
tree | 3fc909c81cbce2323c53378e44ec285e313eb25f | |
parent | d2a221823722c04830d9785596d9cff2bdd27fdd [diff] |
Add testutil to mock android.app.usage.NetworkStats It's not possible to directly create a mocked `NetworkStats` instance because of limitations with `NetworkStats#getNextBucket`. As a workaround for testing, create a mock by controlling the return values from the mocked service that provides the `NetworkStats` data. Test: atest FrameworksServicesTests:com.android.server.stats.pull.netstats.NetworkStatsUtilsTest Bug: 335680025 Change-Id: I4be8420de50040781557587fba4a50b9c0587f61