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

Commit 2f1a90b7 authored by Adrian Roos's avatar Adrian Roos
Browse files

Dispatch overlay change to WindowManager

This works around an issue where changes to runtime resource overlays
are not dispatched to WindowManager, and it therefore never updates
the overlay-dependent resources.

Bug: 65689439
Test: adb shell cmd overlay enable com.android.internal.display.cutout.emulation; then check that status bar size changed properly
Change-Id: If78a1dde283e39a977ff3f8ead7c3576129dfede
parent 0d64cd33
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -25334,6 +25334,10 @@ public class ActivityManagerService extends IActivityManager.Stub
                }
            }
        }
        if (updateFrameworkRes && mWindowManager != null) {
            ActivityThread.currentActivityThread().getExecutor().execute(
                    mWindowManager::onOverlayChanged);
        }
    }
    /**
+6 −0
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ import android.app.StatusBarManager;
import android.app.UiModeManager;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ComponentCallbacks;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
@@ -2682,6 +2683,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
    }

    @Override
    public void onOverlayChangedLw() {
        onConfigurationChanged();
    }

    @Override
    public void onConfigurationChanged() {
        // TODO(multi-display): Define policy for secondary displays.
+5 −0
Original line number Diff line number Diff line
@@ -169,6 +169,11 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
     */
    void onKeyguardOccludedChangedLw(boolean occluded);

    /**
     * Called when the resource overlays change.
     */
    default void onOverlayChangedLw() {}

    /**
     * Interface to the Window Manager state associated with a particular
     * window.  You can hold on to an instance of this interface from the call
+7 −0
Original line number Diff line number Diff line
@@ -6575,6 +6575,13 @@ public class WindowManagerService extends IWindowManager.Stub
        }
    }

    public void onOverlayChanged() {
        synchronized (mWindowMap) {
            mPolicy.onOverlayChangedLw();
            requestTraversal();
        }
    }

    public void onDisplayChanged(int displayId) {
        synchronized (mWindowMap) {
            final DisplayContent displayContent = mRoot.getDisplayContentOrCreate(displayId);