From 51d00d88ed8336b198d5fc7d48d35d06e935a30e Mon Sep 17 00:00:00 2001 From: Griff Hazen Date: Tue, 22 Nov 2016 15:39:24 -0800 Subject: [PATCH] Workaround for javac compilation issue of lambda code frameworks/base/services/core/java/com/android/server/wm/WindowState.java:601: error: variable w1 might not have been initialized BUG: 32554459 Change-Id: I939ad4917f0b53d6f3f090ed2643b5e0354c37a3 --- .../com/android/server/wm/WindowState.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index d959d8c715ca4..e0022821f4cd3 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -539,17 +539,22 @@ class WindowState extends WindowContainer implements WindowManagerP * Compares two window sub-layers and returns -1 if the first is lesser than the second in terms * of z-order and 1 otherwise. */ - private static final Comparator sWindowSubLayerComparator = (w1, w2) -> { - final int layer1 = w1.mSubLayer; - final int layer2 = w2.mSubLayer; - if (layer1 < layer2 || (layer1 == layer2 && layer2 < 0 )) { - // We insert the child window into the list ordered by the sub-layer. - // For same sub-layers, the negative one should go below others; the positive one should - // go above others. - return -1; - } - return 1; - }; + private static final Comparator sWindowSubLayerComparator = + new Comparator() { + @Override + public int compare(WindowState w1, WindowState w2) { + final int layer1 = w1.mSubLayer; + final int layer2 = w2.mSubLayer; + if (layer1 < layer2 || (layer1 == layer2 && layer2 < 0 )) { + // We insert the child window into the list ordered by + // the sub-layer. For same sub-layers, the negative one + // should go below others; the positive one should go + // above others. + return -1; + } + return 1; + }; + }; WindowState(WindowManagerService service, Session s, IWindow c, WindowToken token, WindowState parentWindow, int appOp, int seq, WindowManager.LayoutParams a,