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

Commit e8069dcf authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Moved window manager wallpaper control into separate class

Change-Id: Ia3c12065678992614667dc210d4611a1250ca22b
parent c5a9c453
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -193,6 +193,7 @@ public class AppWindowAnimator {
        final int windowCount = mAppToken.allAppWindows.size();
        final int adj = animLayerAdjustment;
        thumbnailLayer = -1;
        final WallpaperController wallpaperController = mService.mWallpaperControllerLocked;
        for (int i = 0; i < windowCount; i++) {
            final WindowState w = mAppToken.allAppWindows.get(i);
            final WindowStateAnimator winAnimator = w.mWinAnimator;
@@ -204,9 +205,7 @@ public class AppWindowAnimator {
            if (w == mService.mInputMethodTarget && !mService.mInputMethodTargetWaitingAnim) {
                mService.setInputMethodAnimLayerAdjustment(adj);
            }
            if (w == mService.mWallpaperTarget && mService.mLowerWallpaperTarget == null) {
                mService.setWallpaperAnimLayerAdjustmentLocked(adj);
            }
            wallpaperController.setAnimLayerAdjustment(w, adj);
        }
    }

+2 −1
Original line number Diff line number Diff line
@@ -260,6 +260,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {

        // Add all windows on the default display.
        final int numDisplays = mService.mDisplayContents.size();
        final WallpaperController wallpaperController = mService.mWallpaperControllerLocked;
        for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) {
            WindowList windows = mService.mDisplayContents.valueAt(displayNdx).getWindowList();
            for (int winNdx = windows.size() - 1; winNdx >= 0; --winNdx) {
@@ -287,7 +288,7 @@ final class InputMonitor implements InputManagerService.WindowManagerCallbacks {
                            != 0) {
                    disableWallpaperTouchEvents = true;
                }
                final boolean hasWallpaper = (child == mService.mWallpaperTarget)
                final boolean hasWallpaper = wallpaperController.isWallpaperTarget(child)
                        && (privateFlags & WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD) == 0
                        && !disableWallpaperTouchEvents;
                final boolean onDefaultDisplay = (child.getDisplayId() == Display.DEFAULT_DISPLAY);
+9 −5
Original line number Diff line number Diff line
@@ -403,7 +403,7 @@ final class Session extends IWindowSession.Stub
        synchronized(mService.mWindowMap) {
            long ident = Binder.clearCallingIdentity();
            try {
                mService.setWindowWallpaperPositionLocked(
                mService.mWallpaperControllerLocked.setWindowWallpaperPosition(
                        mService.windowForClientLocked(this, window, true),
                        x, y, xStep, yStep);
            } finally {
@@ -413,14 +413,16 @@ final class Session extends IWindowSession.Stub
    }

    public void wallpaperOffsetsComplete(IBinder window) {
        mService.wallpaperOffsetsComplete(window);
        synchronized (mService.mWindowMap) {
            mService.mWallpaperControllerLocked.wallpaperOffsetsComplete(window);
        }
    }

    public void setWallpaperDisplayOffset(IBinder window, int x, int y) {
        synchronized(mService.mWindowMap) {
            long ident = Binder.clearCallingIdentity();
            try {
                mService.setWindowWallpaperDisplayOffsetLocked(
                mService.mWallpaperControllerLocked.setWindowWallpaperDisplayOffset(
                        mService.windowForClientLocked(this, window, true), x, y);
            } finally {
                Binder.restoreCallingIdentity(ident);
@@ -433,7 +435,7 @@ final class Session extends IWindowSession.Stub
        synchronized(mService.mWindowMap) {
            long ident = Binder.clearCallingIdentity();
            try {
                return mService.sendWindowWallpaperCommandLocked(
                return mService.mWallpaperControllerLocked.sendWindowWallpaperCommand(
                        mService.windowForClientLocked(this, window, true),
                        action, x, y, z, extras, sync);
            } finally {
@@ -443,7 +445,9 @@ final class Session extends IWindowSession.Stub
    }

    public void wallpaperCommandComplete(IBinder window, Bundle result) {
        mService.wallpaperCommandComplete(window, result);
        synchronized (mService.mWindowMap) {
            mService.mWallpaperControllerLocked.wallpaperCommandComplete(window);
        }
    }

    public void onRectangleOnScreenRequested(IBinder token, Rect rectangle) {
+862 −0

File added.

Preview size limit exceeded, changes collapsed.

+3 −1
Original line number Diff line number Diff line
@@ -258,6 +258,7 @@ public class WindowAnimator {
        boolean startingInUnForceHiding = false;
        ArrayList<WindowStateAnimator> unForceHiding = null;
        WindowState wallpaper = null;
        final WallpaperController wallpaperController = mService.mWallpaperControllerLocked;
        for (int i = windows.size() - 1; i >= 0; i--) {
            WindowState win = windows.get(i);
            WindowStateAnimator winAnimator = win.mWinAnimator;
@@ -294,7 +295,8 @@ public class WindowAnimator {
                            ", nowAnimating=" + nowAnimating);
                }

                if (wasAnimating && !winAnimator.mAnimating && mService.mWallpaperTarget == win) {
                if (wasAnimating && !winAnimator.mAnimating
                        && wallpaperController.isWallpaperTarget(win)) {
                    mBulkUpdateParams |= SET_WALLPAPER_MAY_CHANGE;
                    setPendingLayoutChanges(Display.DEFAULT_DISPLAY,
                            WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER);
Loading