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

Commit f704b059 authored by Chalard Jean's avatar Chalard Jean Committed by Automerger Merge Worker
Browse files

Merge "Fix: ConnectivityManager methods crashing with SecurityException" into...

Merge "Fix: ConnectivityManager methods crashing with SecurityException" into sc-dev am: 4e7b1128 am: b029e441

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15401698

Change-Id: I85dcb34a88200484bd66689f7a67e93161b86871
parents 14c899c8 b029e441
Loading
Loading
Loading
Loading
+24 −4
Original line number Original line Diff line number Diff line
@@ -371,11 +371,12 @@ public final class ActivityThread extends ClientTransactionHandler
    @UnsupportedAppUsage(trackingBug = 176961850, maxTargetSdk = Build.VERSION_CODES.R,
    @UnsupportedAppUsage(trackingBug = 176961850, maxTargetSdk = Build.VERSION_CODES.R,
            publicAlternatives = "Use {@code Context#getResources()#getConfiguration()} instead.")
            publicAlternatives = "Use {@code Context#getResources()#getConfiguration()} instead.")
    Configuration mConfiguration;
    Configuration mConfiguration;
    @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
@@ -1189,8 +1190,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() {
@@ -6657,6 +6668,15 @@ public final class ActivityThread extends ClientTransactionHandler
            sendMessage(H.SET_CONTENT_CAPTURE_OPTIONS_CALLBACK, data.appInfo.packageName);
            sendMessage(H.SET_CONTENT_CAPTURE_OPTIONS_CALLBACK, data.appInfo.packageName);


            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