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

Commit c12ec70d authored by Alan Viverette's avatar Alan Viverette
Browse files

Avoid use-after-free race condition when rebasing theme

... by never rebasing the theme. We don't need to do this unless the
system theme is configuration-dependent, which it is not currently.

Bug: 22943781
Change-Id: I96e695441543379e4d5fdf3cc6f18d9e6cf953b4
parent 1fbc1b3b
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -4235,11 +4235,6 @@ public final class ActivityThread {


            configDiff = mConfiguration.updateFrom(config);
            configDiff = mConfiguration.updateFrom(config);
            config = applyCompatConfiguration(mCurDefaultDisplayDpi);
            config = applyCompatConfiguration(mCurDefaultDisplayDpi);

            final Theme systemTheme = getSystemContext().getTheme();
            if ((systemTheme.getChangingConfigurations() & configDiff) != 0) {
                systemTheme.rebase();
            }
        }
        }


        ArrayList<ComponentCallbacks2> callbacks = collectComponentCallbacks(false, config);
        ArrayList<ComponentCallbacks2> callbacks = collectComponentCallbacks(false, config);
+0 −6
Original line number Original line Diff line number Diff line
@@ -1024,12 +1024,6 @@ public final class SystemServer {
        w.getDefaultDisplay().getMetrics(metrics);
        w.getDefaultDisplay().getMetrics(metrics);
        context.getResources().updateConfiguration(config, metrics);
        context.getResources().updateConfiguration(config, metrics);


        // The system context's theme may be configuration-dependent.
        final Theme systemTheme = context.getTheme();
        if (systemTheme.getChangingConfigurations() != 0) {
            systemTheme.rebase();
        }

        try {
        try {
            // TODO: use boot phase
            // TODO: use boot phase
            mPowerManagerService.systemReady(mActivityManagerService.getAppOpsService());
            mPowerManagerService.systemReady(mActivityManagerService.getAppOpsService());