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/BufferLayer.h b/services/surfaceflinger/BufferLayer.h
index 97ffe6f..0e69f60 100644
--- a/services/surfaceflinger/BufferLayer.h
+++ b/services/surfaceflinger/BufferLayer.h
@@ -148,6 +148,11 @@
     virtual status_t updateActiveBuffer() = 0;
     virtual status_t updateFrameNumber(nsecs_t latchTime) = 0;
 
+    // We generate InputWindowHandles for all buffered layers regardless of whether they
+    // have an InputChannel. This is to enable the InputDispatcher to do PID based occlusion
+    // detection.
+    bool needsInputInfo() const override { return true; }
+
 protected:
     struct BufferInfo {
         nsecs_t mDesiredPresentTime;