Introduce CaptureStateNotifier

This is a helper class for notifying a client of capture
state changes.

Bug: 146157104
Test: Compiles (further testing as part of the topic).
Merged-In: Ie27bc404805d319a6969290a6369d59fb68c1f38
Change-Id: I2902468c4692ba68e4bc9be0e5038d5505da7154
diff --git a/media/libaudioclient/Android.bp b/media/libaudioclient/Android.bp
index 65afc8d..0ec63b9 100644
--- a/media/libaudioclient/Android.bp
+++ b/media/libaudioclient/Android.bp
@@ -21,6 +21,7 @@
         "AudioVolumeGroup.cpp",
     ],
     shared_libs: [
+        "capture_state_listener-aidl-cpp",
         "libaudiofoundation",
         "libaudioutils",
         "libbinder",
@@ -34,6 +35,9 @@
     ],
     include_dirs: ["system/media/audio_utils/include"],
     export_include_dirs: ["include"],
+    export_shared_lib_headers: [
+        "capture_state_listener-aidl-cpp",
+    ],
 }
 
 cc_library_shared {
@@ -148,3 +152,11 @@
     ],
     path: "aidl",
 }
+
+aidl_interface {
+    name: "capture_state_listener-aidl",
+    local_include_dir: "aidl",
+    srcs: [
+        "aidl/android/media/ICaptureStateListener.aidl",
+    ],
+}
diff --git a/media/libaudioclient/aidl/android/media/ICaptureStateListener.aidl b/media/libaudioclient/aidl/android/media/ICaptureStateListener.aidl
new file mode 100644
index 0000000..8502282
--- /dev/null
+++ b/media/libaudioclient/aidl/android/media/ICaptureStateListener.aidl
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.media;
+
+interface ICaptureStateListener {
+    void setCaptureState(boolean active);
+}