Native Routing API - Phase 3
Release is automatically called during Destroy
Bug: 23899814
Change-Id: I54a22d493f3de5b8562788ac14a2b8a3ebc6fb29
diff --git a/src/itf/IAndroidConfiguration.c b/src/itf/IAndroidConfiguration.c
index 9465269..9b2dd8e 100644
--- a/src/itf/IAndroidConfiguration.c
+++ b/src/itf/IAndroidConfiguration.c
@@ -382,3 +382,13 @@
IAndroidConfiguration *thiz = (IAndroidConfiguration *) self;
thiz->mItf = &IAndroidConfiguration_Itf;
}
+
+void IAndroidConfiguration_deinit(void *self)
+{
+ IAndroidConfiguration *thiz = (IAndroidConfiguration *) self;
+ if (thiz->mRoutingProxy != NULL) {
+ thiz->mItf->ReleaseJavaProxy(&thiz->mItf, SL_ANDROID_JAVA_PROXY_ROUTING);
+ }
+
+}
+
diff --git a/src/sles.c b/src/sles.c
index 785392b..0761d24 100644
--- a/src/sles.c
+++ b/src/sles.c
@@ -300,7 +300,8 @@
IObject_deinit(void *),
IPresetReverb_deinit(void *),
IThreadSync_deinit(void *),
- IVirtualizer_deinit(void *);
+ IVirtualizer_deinit(void *),
+ IAndroidConfiguration_deinit(void *);
extern bool
IAndroidAcousticEchoCancellation_Expose(void *),
@@ -366,6 +367,7 @@
#ifndef ANDROID
#define IAndroidConfiguration_init NULL
+#define IAndroidConfiguration_deinit NULL
#define IAndroidEffect_init NULL
#define IAndroidEffectCapabilities_init NULL
#define IAndroidEffectSend_init NULL
@@ -440,7 +442,8 @@
{ /* MPH_ANDROIDEFFECTCAPABILITIES */ IAndroidEffectCapabilities_init, NULL,
IAndroidEffectCapabilities_deinit, IAndroidEffectCapabilities_Expose, NULL },
{ /* MPH_ANDROIDEFFECTSEND */ IAndroidEffectSend_init, NULL, NULL, NULL, NULL },
- { /* MPH_ANDROIDCONFIGURATION */ IAndroidConfiguration_init, NULL, NULL, NULL, NULL },
+ { /* MPH_ANDROIDCONFIGURATION */ IAndroidConfiguration_init, NULL, IAndroidConfiguration_deinit,
+ NULL, NULL },
{ /* MPH_ANDROIDSIMPLEBUFFERQUEUE */ IBufferQueue_init /* alias */, NULL, NULL, NULL, NULL },
// Android API level 10 extended interfaces
{ /* MPH_ANDROIDBUFFERQUEUESOURCE */ IAndroidBufferQueue_init, NULL, IAndroidBufferQueue_deinit,