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

Commit b200d05e authored by Winson's avatar Winson
Browse files

Fixing issue incorrect resources being used with docked windows.

parent ddb59c53
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -500,6 +500,8 @@ public class Recents extends SystemUI
        mStatusBarHeight = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height);
        mNavBarHeight = res.getDimensionPixelSize(com.android.internal.R.dimen.navigation_bar_height);
        mNavBarWidth = res.getDimensionPixelSize(com.android.internal.R.dimen.navigation_bar_width);
        // TODO: We can't rely on this anymore since the activity context will yield different
        //      resources while multiwindow is enabled
        mConfig = RecentsConfiguration.reinitialize(mContext, mSystemServicesProxy);
        mConfig.updateOnConfigurationChange();
        Rect searchBarBounds = new Rect();
@@ -735,7 +737,10 @@ public class Recents extends SystemUI
    /** Starts the recents activity */
    void startRecentsActivity(ActivityManager.RunningTaskInfo topTask, boolean isTopTaskHome) {
        RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
        RecentsConfiguration.reinitialize(mContext, mSystemServicesProxy);
        // Don't reinitialize the configuration completely here, since it has the wrong context,
        // only update the parts that we can get from any context
        RecentsConfiguration config = RecentsConfiguration.getInstance();
        config.reinitializeWithApplicationContext(mContext, mSystemServicesProxy);

        if (sInstanceLoadPlan == null) {
            // Create a new load plan if onPreloadRecents() was never triggered
+3 −3
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ public class RecentsConfiguration {
            sInstance.update(context);
            sPrevConfigurationHashCode = configHashCode;
        }
        sInstance.updateOnReinitialize(context, ssp);
        sInstance.reinitializeWithApplicationContext(context.getApplicationContext(), ssp);
        return sInstance;
    }

@@ -276,8 +276,8 @@ public class RecentsConfiguration {
        systemInsets.set(insets);
    }

    /** Updates the states that need to be re-read whenever we re-initialize. */
    void updateOnReinitialize(Context context, SystemServicesProxy ssp) {
    /** Updates the states that need to be re-read from the application context. */
    void reinitializeWithApplicationContext(Context context, SystemServicesProxy ssp) {
        // Check if the developer options are enabled
        developerOptionsEnabled = ssp.getGlobalSetting(context,
                Settings.Global.DEVELOPMENT_SETTINGS_ENABLED) != 0;