Validate client permission for HeadlessSystemUser.

If device is running in  HSUM mode, if User 0 tries to access the
camera, validate that the client has the permission
android.permission.CAMERA_HEADLESS_SYSTEM_USER.

Bug:296959023
Test: Test that headless system user is not able to access
the camera without the new permission.

Change-Id: Ibc2ef43837d2e8739872697245e466d69f56f335
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index 48954ca..beafe00 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -104,6 +104,9 @@
     // Event log ID
     static const int SN_EVENT_LOG_ID = 0x534e4554;
 
+    // Keep this in sync with frameworks/base/core/java/android/os/UserHandle.java
+    static const userid_t USER_SYSTEM = 0;
+
     // Register camera service
     static void instantiate();
 
@@ -656,6 +659,9 @@
     bool hasPermissionsForSystemCamera(const std::string& cameraId, int callingPid, int callingUid)
             const;
 
+    bool hasPermissionsForCameraHeadlessSystemUser(const std::string& cameraId, int callingPid,
+            int callingUid) const;
+
    /**
      * Typesafe version of device status, containing both the HAL-layer and the service interface-
      * layer values.