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

Commit 507ada5c authored by wilsonshih's avatar wilsonshih
Browse files

Prevent unnecessary connector been created in fallback connection.

Separate the && condition to prevent create unnecessary connector in
fallback connection.

Fix: 123104622
Test: connect on secondary display and change wallpapers, check log and
use dumpsys to ensure there is no unnecessary ImageWallpaper been
created.

Change-Id: I6ffd833b9e544db5ccb3f68aba28f6bfc4ac15fd
parent 44b2b5ac
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -988,14 +988,15 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
            Slog.w(TAG, "Fallback wallpaper connection has not been created yet!!");
            return;
        }
        if (supportsMultiDisplay(systemConnection)
                && fallbackConnection.mDisplayConnector.size() != 0) {
        if (supportsMultiDisplay(systemConnection)) {
            if (fallbackConnection.mDisplayConnector.size() != 0) {
                fallbackConnection.forEachDisplayConnector(connector -> {
                    if (connector.mEngine != null) {
                        connector.disconnectLocked();
                    }
                });
                fallbackConnection.mDisplayConnector.clear();
            }
        } else {
            fallbackConnection.appendConnectorWithCondition(display ->
                    fallbackConnection.isUsableDisplay(display)