SurfaceFlinger: Send all BufferedLayers to InputFlinger

Currently if an InputWindow is obscured by a window with
FLAG_NO_INPUT_CHANNEL or a Surface with no window (and input) at all
then InputDispatcher will not be aware of the window and it will
fail to generate FLAG_(PARTIALLY)_OCLUDED for windows underneath. To fix
this we make sure we generate an InputWindow for every buffered
element on the screen and make them all known to InputDispatcher.

Bug: 152064592
Test: ObscuredInputTests
Change-Id: I90a813be9b650dceb0a20ffbf33aa27f95d38771
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 3fa935f..1bec438 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -947,7 +947,17 @@
     void setInputInfo(const InputWindowInfo& info);
 
     InputWindowInfo fillInputInfo();
-    bool hasInput() const;
+    /**
+     * Returns whether this layer has an explicitly set input-info.
+     */
+    bool hasInputInfo() const;
+    /**
+     * Return whether this layer needs an input info. For most layer types
+     * this is only true if they explicitly set an input-info but BufferLayer
+     * overrides this so we can generate input-info for Buffered layers that don't
+     * have them (for input occlusion detection checks).
+     */
+    virtual bool needsInputInfo() const { return hasInputInfo(); }
 
 protected:
     compositionengine::OutputLayer* findOutputLayerForDisplay(const DisplayDevice*) const;