Merge "Fix: ConnectivityManager methods crashing with SecurityException" am: 67f0eebdfa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1758029 Change-Id: I573cdb1d1d6249fb54c8a0e8c94da1173c3f68e5
This commit is contained in:
@@ -352,11 +352,12 @@ public final class ActivityThread extends ClientTransactionHandler {
|
|||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
Configuration mConfiguration;
|
Configuration mConfiguration;
|
||||||
Configuration mCompatConfiguration;
|
Configuration mCompatConfiguration;
|
||||||
|
@GuardedBy("this")
|
||||||
|
private boolean mUpdateHttpProxyOnBind = false;
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
Application mInitialApplication;
|
Application mInitialApplication;
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
final ArrayList<Application> mAllApplications
|
final ArrayList<Application> mAllApplications = new ArrayList<>();
|
||||||
= new ArrayList<Application>();
|
|
||||||
/**
|
/**
|
||||||
* Bookkeeping of instantiated backup agents indexed first by user id, then by package name.
|
* Bookkeeping of instantiated backup agents indexed first by user id, then by package name.
|
||||||
* Indexing by user id supports parallel backups across users on system packages as they run in
|
* Indexing by user id supports parallel backups across users on system packages as they run in
|
||||||
@@ -1127,8 +1128,18 @@ public final class ActivityThread extends ClientTransactionHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateHttpProxy() {
|
public void updateHttpProxy() {
|
||||||
ActivityThread.updateHttpProxy(
|
final Application app;
|
||||||
getApplication() != null ? getApplication() : getSystemContext());
|
synchronized (ActivityThread.this) {
|
||||||
|
app = getApplication();
|
||||||
|
if (null == app) {
|
||||||
|
// The app is not bound yet. Make a note to update the HTTP proxy when the
|
||||||
|
// app is bound.
|
||||||
|
mUpdateHttpProxyOnBind = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// App is present, update the proxy inline.
|
||||||
|
ActivityThread.updateHttpProxy(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void processInBackground() {
|
public void processInBackground() {
|
||||||
@@ -6697,6 +6708,15 @@ public final class ActivityThread extends ClientTransactionHandler {
|
|||||||
app.setContentCaptureOptions(data.contentCaptureOptions);
|
app.setContentCaptureOptions(data.contentCaptureOptions);
|
||||||
|
|
||||||
mInitialApplication = app;
|
mInitialApplication = app;
|
||||||
|
final boolean updateHttpProxy;
|
||||||
|
synchronized (this) {
|
||||||
|
updateHttpProxy = mUpdateHttpProxyOnBind;
|
||||||
|
// This synchronized block ensures that any subsequent call to updateHttpProxy()
|
||||||
|
// will see a non-null mInitialApplication.
|
||||||
|
}
|
||||||
|
if (updateHttpProxy) {
|
||||||
|
ActivityThread.updateHttpProxy(app);
|
||||||
|
}
|
||||||
|
|
||||||
// don't bring up providers in restricted mode; they may depend on the
|
// don't bring up providers in restricted mode; they may depend on the
|
||||||
// app's custom Application class
|
// app's custom Application class
|
||||||
|
|||||||
Reference in New Issue
Block a user