Use getLayerStack() instead of layerStack for input info

When there's no displayId, the layerStack should be used. The current
code was using mDrawingState.layerStack which is incorrect because only
the layerStack for the root of the tree is correct. Instead, use
getLayerStack() which traverses the hierarchy to find the root's
layerStack.

Test: Uses correct layerStack instead of 0 for input with unset displayIds
Fixes: 140312942
Change-Id: Ic8a06c562e970b0f328c539edfa51e206734934f
Merged-in: Ic8a06c562e970b0f328c539edfa51e206734934f
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index d6e86eb..fdf9da3 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -2048,7 +2048,7 @@
     InputWindowInfo info = mDrawingState.inputInfo;
 
     if (info.displayId == ADISPLAY_ID_NONE) {
-        info.displayId = mDrawingState.layerStack;
+        info.displayId = getLayerStack();
     }
 
     ui::Transform t = getTransform();