Skip to content
Commit 100df0a6 authored by Chalard Jean's avatar Chalard Jean
Browse files

Fix: ConnectivityManager is initialized with a wrong context

ActivityThread#setHttpProxy uses a system context to get
a ConnectivityManager instance. If it's not already cached, the
system service registry will cache this instance initialized
with the system context, and subsequent calls to get this service
will return the bad instance.
This patch uses the application context instead, unless it's
not available for some unlikely reason.

A possible symptom of this issue is to have Bluetooth tethering
failing with a security exception, because it's requested by
the "android" package without system uid.

Bug: 73572062
Test: manual
Change-Id: I745707e4ffe564f6d201ec259fa6b5ee32fbeda6
parent 47a8ecce
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