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

Commit 58106813 authored by Craig Mautner's avatar Craig Mautner
Browse files

Remove some TODOs.

Change-Id: I52f5a8a76593dde177c2e931f656b13134a3bd2b
parent 9a29a5d6
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -225,7 +225,6 @@ class AppWindowToken extends WindowToken {

    boolean isVisible() {
        final int N = allAppWindows.size();
        // TODO: Consider using allDrawn instead of a single window.
        for (int i=0; i<N; i++) {
            WindowState win = allAppWindows.get(i);
            if (!win.mAppFreezing
+13 −24
Original line number Diff line number Diff line
@@ -324,6 +324,7 @@ public class WindowManagerService extends IWindowManager.Stub
    /**
     * Mapping from an IWindow IBinder to the server's Window object.
     * This is also used as the lock for all of our state.
     * NOTE: Never call into methods that lock ActivityManagerService while holding this object.
     */
    final HashMap<IBinder, WindowState> mWindowMap = new HashMap<IBinder, WindowState>();

@@ -1113,7 +1114,6 @@ public class WindowManagerService extends IWindowManager.Stub
        }
    }

    /** TODO(cmautner): Is this the same as {@link WindowState#canReceiveKeys()} */
    static boolean canBeImeTarget(WindowState w) {
        final int fl = w.mAttrs.flags
                & (FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM);
@@ -1969,12 +1969,7 @@ public class WindowManagerService extends IWindowManager.Stub
                    winAnimator.computeShownFrameLocked();
                    // No need to lay out the windows - we can just set the wallpaper position
                    // directly.
                    // TODO(cmautner): Don't move this from here, just lock the WindowAnimator.
                    if (winAnimator.mSurfaceX != wallpaper.mShownFrame.left
                            || winAnimator.mSurfaceY != wallpaper.mShownFrame.top) {
                        winAnimator.setWallpaperOffset((int) wallpaper.mShownFrame.left,
                                (int) wallpaper.mShownFrame.top);
                    }
                    winAnimator.setWallpaperOffset(wallpaper.mShownFrame);
                    // We only want to be synchronous with one wallpaper.
                    sync = false;
                }
@@ -2478,11 +2473,6 @@ public class WindowManagerService extends IWindowManager.Stub
        }
    }

    // TODO(cmautner): Move to WindowStateAnimator.
    void setTransparentRegionHint(final WindowStateAnimator winAnimator, final Region region) {
        mH.sendMessage(mH.obtainMessage(H.SET_TRANSPARENT_REGION,
                new Pair<WindowStateAnimator, Region>(winAnimator, region)));
    }

    void setTransparentRegionWindow(Session session, IWindow client, Region region) {
        long origId = Binder.clearCallingIdentity();
@@ -2490,7 +2480,9 @@ public class WindowManagerService extends IWindowManager.Stub
            synchronized (mWindowMap) {
                WindowState w = windowForClientLocked(session, client, false);
                if ((w != null) && w.mHasSurface) {
                    setTransparentRegionHint(w.mWinAnimator, region);
                    final Pair<WindowStateAnimator, Region> pair =
                            new Pair<WindowStateAnimator, Region>(w.mWinAnimator, region);
                    mH.sendMessage(mH.obtainMessage(H.SET_TRANSPARENT_REGION, pair));
                }
            }
        } finally {
@@ -2652,7 +2644,6 @@ public class WindowManagerService extends IWindowManager.Stub
        long origId = Binder.clearCallingIdentity();

        synchronized(mWindowMap) {
            // TODO(cmautner): synchronize on mAnimator or win.mWinAnimator.
            WindowState win = windowForClientLocked(session, client, false);
            if (win == null) {
                return 0;
@@ -7031,8 +7022,8 @@ public class WindowManagerService extends IWindowManager.Stub
                    break;
                }

                // Animation messages. Move to Window{State}Animator
                case SET_TRANSPARENT_REGION: {
                    @SuppressWarnings("unchecked")
                    Pair<WindowStateAnimator, Region> pair =
                                (Pair<WindowStateAnimator, Region>) msg.obj;
                    final WindowStateAnimator winAnimator = pair.first;
@@ -7147,8 +7138,7 @@ public class WindowManagerService extends IWindowManager.Stub
    }

    public void getInitialDisplaySize(int displayId, Point size) {
        // TODO(cmautner): Access to DisplayContent should be locked on mWindowMap. Doing that
        //  could lead to deadlock since this is called from ActivityManager.
        synchronized (mWindowMap) {
            final DisplayContent displayContent = getDisplayContentLocked(displayId);
            if (displayContent != null) {
                synchronized(displayContent.mDisplaySizeLock) {
@@ -7157,6 +7147,7 @@ public class WindowManagerService extends IWindowManager.Stub
                }
            }
        }
    }

    @Override
    public void setForcedDisplaySize(int displayId, int width, int height) {
@@ -8951,8 +8942,6 @@ public class WindowManagerService extends IWindowManager.Stub
        boolean doRequest = false;

        final int bulkUpdateParams = mAnimator.mBulkUpdateParams;
        // TODO(cmautner): As the number of bits grows, use masks of bit groups to
        //  eliminate unnecessary tests.
        if ((bulkUpdateParams & LayoutFields.SET_UPDATE_ROTATION) != 0) {
            mInnerFields.mUpdateRotation = true;
            doRequest = true;
+3 −3
Original line number Diff line number Diff line
@@ -945,8 +945,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        }
    }

    /** Returns true if this window desires key events.
     * TODO(cmautner): Is this the same as {@link WindowManagerService#canBeImeTarget}
    /**
     * @return true if this window desires key events.
     */
    public final boolean canReceiveKeys() {
        return isVisibleOrAdding()
+29 −24
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Region;
import android.os.Debug;
import android.util.Slog;
@@ -1337,7 +1338,10 @@ class WindowStateAnimator {
        }
    }

    void setWallpaperOffset(int left, int top) {
    void setWallpaperOffset(RectF shownFrame) {
        final int left = (int) shownFrame.left;
        final int top = (int) shownFrame.top;
        if (mSurfaceX != left || mSurfaceY != top) {
            mSurfaceX = left;
            mSurfaceY = top;
            if (mAnimating) {
@@ -1364,6 +1368,7 @@ class WindowStateAnimator {
                        "<<< CLOSE TRANSACTION setWallpaperOffset");
            }
        }
    }

    // This must be called while inside a transaction.
    boolean performShowLocked() {