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

Commit a204d76b authored by Robert Carr's avatar Robert Carr
Browse files

WindowContainer Overlays: Emit initial configuration change

Emit a configuration change event when attaching so that the remote end
has a change to process changes inbetween its initialization (where it
likely fetched a configuration from some third party) and attachment
times.

Bug: 213603716
Test: Existing tests pass
Change-Id: I053e4ed0210cf70e07d30fc6b10cf04ed30921d8
parent fd015869
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -3604,6 +3604,16 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
            mOverlayHost = new OverlayHost(mWmService);
        }
        mOverlayHost.addOverlay(overlay, mSurfaceControl);

        // Emit an initial onConfigurationChanged to ensure the overlay
        // can receive any changes between their creation time and
        // attach time.
        try {
            overlay.getRemoteInterface().onConfigurationChanged(getConfiguration());
        } catch (Exception e) {
            Slog.e(TAG, "Error sending initial configuration change to WindowContainer overlay");
            removeOverlay(overlay);
        }
    }

    void removeOverlay(SurfaceControlViewHost.SurfacePackage overlay) {