Fix "Allow/Deny" popup window no respond when use cursor

Currently all buffered layers will send input info to InputFlinger in
order to detect if a window is obsecured by another layer. This could
cause the cursor sprite are calculated into the input windows and
generate the unexpected FLAG_(PARTIALLY)_OCCLUDED.

To fix this, we exclude the cursor layer when fill input info to
InputFlinger.

Bug: 158717144
Test: atest InputSurfacesTest
Test: connect mouse, open camera and popup grant permission dialog
Change-Id: Ic57dfc7b68f8bf8fda5d7a77e107ca023b55b891
diff --git a/services/surfaceflinger/BufferLayer.h b/services/surfaceflinger/BufferLayer.h
index 0e69f60..26bfb49 100644
--- a/services/surfaceflinger/BufferLayer.h
+++ b/services/surfaceflinger/BufferLayer.h
@@ -148,10 +148,10 @@
     virtual status_t updateActiveBuffer() = 0;
     virtual status_t updateFrameNumber(nsecs_t latchTime) = 0;
 
-    // We generate InputWindowHandles for all buffered layers regardless of whether they
+    // We generate InputWindowHandles for all non-cursor 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; }
+    bool needsInputInfo() const override { return !mPotentialCursor; }
 
 protected:
     struct BufferInfo {