Camera muting via sensor test pattern

Currently enabled/disabled via
  adb shell cmd media.camera set-camera-mute <1/0>

TODO:
- Connect to the wider sensor muting feature

This is suitable for testing apps to see how they react, and how Pixel phones
implement test patterns.

Test: GoogleCameraApp and AOSP Camera2 on sunfish appear to act as if they were in a dark room,
      no crashes, after calling 'adb shell cmd media.camera set-camera-mute 1'
Bug: 170156750
Change-Id: I85e1d2d6ee7d9bf1aee99c4bc8d5f98d36754228
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index 43b03e6..bc6ad35 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -278,6 +278,12 @@
         // Override rotate-and-crop AUTO behavior
         virtual status_t setRotateAndCropOverride(uint8_t rotateAndCrop) = 0;
 
+        // Whether the client supports camera muting (black only output)
+        virtual bool supportsCameraMute() = 0;
+
+        // Set/reset camera mute
+        virtual status_t setCameraMute(bool enabled) = 0;
+
     protected:
         BasicClient(const sp<CameraService>& cameraService,
                 const sp<IBinder>& remoteCallback,
@@ -1044,6 +1050,9 @@
     // Get the mask for image dump to disk
     status_t handleGetImageDumpMask(int out);
 
+    // Set the camera mute state
+    status_t handleSetCameraMute(const Vector<String16>& args);
+
     // Prints the shell command help
     status_t printHelp(int out);
 
@@ -1088,6 +1097,9 @@
 
     // Current image dump mask
     uint8_t mImageDumpMask = 0;
+
+    // Current camera mute mode
+    bool mOverrideCameraMuteMode = false;
 };
 
 } // namespace android