[gui] Add {add,remove}RegionSamplingListener

Adds addRegionSamplingListener and removeRegionSamplingListener to
ISurfaceComposer. This interface will allow a client to register to
receive an updated median luma value for a region bounded by a stop
layer (i.e., layers behind the stop layer) and the provided Rect any
time the display updates.

Multiple areas may be sampled, but they must use separate listeners, and
the layer traversal will stop at the stop layer with the lesser Z value.

Bug: 119639245
Test: New test in I152a9d72640e34e4f83959715cdea409929b9150
Change-Id: Ie420098781ddba02d6eb0d7039d0bf855c204231
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 5f8de83..31c2153 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1253,6 +1253,17 @@
     return NO_ERROR;
 }
 
+status_t SurfaceFlinger::addRegionSamplingListener(
+        const Rect& /*samplingArea*/, const sp<IBinder>& /*stopLayerHandle*/,
+        const sp<IRegionSamplingListener>& /*listener*/) {
+    return NO_ERROR;
+}
+
+status_t SurfaceFlinger::removeRegionSamplingListener(
+        const sp<IRegionSamplingListener>& /*listener*/) {
+    return NO_ERROR;
+}
+
 // ----------------------------------------------------------------------------
 
 sp<IDisplayEventConnection> SurfaceFlinger::createDisplayEventConnection(
@@ -5016,7 +5027,9 @@
             return OK;
         }
         case CAPTURE_LAYERS:
-        case CAPTURE_SCREEN: {
+        case CAPTURE_SCREEN:
+        case ADD_REGION_SAMPLING_LISTENER:
+        case REMOVE_REGION_SAMPLING_LISTENER: {
             // codes that require permission check
             IPCThreadState* ipc = IPCThreadState::self();
             const int pid = ipc->getCallingPid();