Injection camera: Block camera access on devices that don't support injection camera

- For devices that do not support camera injection, the external camera
ID will not be registered in the camera service. In this case, when the
user uses the camera on the virtual display of the second device (such
as a Chromebook, tablet) connected by the device, the internal camera
will be projected onto the virtual display. In order not to display the
internal camera screen on the virtual display to protect personal
privacy on the device, onCameraUnavailable will be called.

Bug: 207481642
Test: Manual
Change-Id: Iea12915734373e9f3a5d0c03874cf49236acc3f5
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index cb26763..19e9bbb 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -1300,13 +1300,18 @@
             wp<CameraService> mParent;
     };
 
+    // When injecting the camera, it will check whether the injecting camera status is unavailable.
+    // If it is, the disconnect function will be called to to prevent camera access on the device.
+    status_t checkIfInjectionCameraIsPresent(const String8& externalCamId,
+            sp<BasicClient> clientSp);
+
     void clearInjectionParameters();
 
     // This is the existing camera id being replaced.
     String8 mInjectionInternalCamId;
     // This is the external camera Id replacing the internalId.
     String8 mInjectionExternalCamId;
-    bool mInjectionInitPending = true;
+    bool mInjectionInitPending = false;
     // Guard mInjectionInternalCamId and mInjectionInitPending.
     Mutex mInjectionParametersLock;
 };