Skip to content
Commit de9cf339 authored by Junyu Lai's avatar Junyu Lai Committed by junyulai
Browse files

[MS66] Initialize TrafficStats with context

TrafficStats has static methods created in API level 8 that need
access to NetworkStatsManager but doesn't take a context.
Previously this was achieved by using ServiceManager, but
with TrafficStats moving to the connectivity module, this
is no longer possible.

Instead, make sure TrafficStats has an appropriate context by
the time any client code can call the relevant methods.
• In app code, this achieved by passing the application
  context from ActivityThread#handleBindApplication, before any
  app code can run.
• In the system server, this is achieved by passing the context
  right after creating service.

Test: atest TrafficStatsTest CtsWebkitTestCases
Bug: 204830222

Change-Id: I251bb8a4431ad12ff61929879ef1363cf06b9244
parent 139e007d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment