cameraservice: Add metrics for extension sessions

We want to log camera extension usage in cameraservice. This CL adds
the scaffolding for it. Specifically, it does the following:

  - Adds CameraExtensionSessionStats.aidl: This is used as the interface
    that CameraExtensionSession, CameraService, and CameraServiceProxy
    use to parcel extension metrics around.

  - Adds 'reportExtensionStats' to ICameraService: To keep the details
    of extensions away from cameraservice, CameraExtensionSession is
    responsible for collecting and reporting the stats. CameraService
    simply maps the reported stats to the current camera session and
    passes it to CameraServiceProxy when the session is closed.

    Some additional safeguards are added for this function because
    CameraExtensionSession can potentially report stats after the
    session has already been closed from cameraservice.

Bug: 261470491
Test: No functional change.
      `atest CtsCameraTestCases` passes.
      `statsd_testdrive 227` confirms that extension metrics are logged
          correctly.
Change-Id: I4a9897fc2b09cabb7618e94f8484757735c5e1f3
diff --git a/services/camera/libcameraservice/utils/CameraServiceProxyWrapper.h b/services/camera/libcameraservice/utils/CameraServiceProxyWrapper.h
index d47c738..e32580c 100644
--- a/services/camera/libcameraservice/utils/CameraServiceProxyWrapper.h
+++ b/services/camera/libcameraservice/utils/CameraServiceProxyWrapper.h
@@ -65,6 +65,8 @@
                 const std::string& userTag, int32_t videoStabilizationMode,
                 const std::vector<hardware::CameraStreamStats>& streamStats);
 
+        String16 updateExtensionSessionStats(const hardware::CameraExtensionSessionStats& extStats);
+
         // Returns the logId associated with this event.
         int64_t getLogId();
     };
@@ -127,6 +129,9 @@
     // frameworks/av/camera/include/camera/CameraSessionStats.h for more details about this
     // identifier. Returns a non-0 value on success.
     int64_t getCurrentLogIdForCamera(const String8& cameraId);
+
+    // Update the stored extension stats to the latest values
+    String16 updateExtensionStats(const hardware::CameraExtensionSessionStats& extStats);
 };
 
 } // android