Reset slimbus port on AUDIOFOCUS LOSS
On Audio focus loss, slave device, FM, keeps on sending packets to
master device, audio manager, even master is disconnected to slave
and slave's buffer overflowed after some time. Due to this, on Audio
focus gain, slave don't send packets to master. Hence no audio for
FM. Reset slimbus data port to overcome this situation.
CRs-Fixed: 1082673
Change-Id: I8317c6e82fe4844970e84e929e2c6328284c6ca9
diff --git a/jni/FmConst.h b/jni/FmConst.h
index 26eb616..e37160f 100644
--- a/jni/FmConst.h
+++ b/jni/FmConst.h
@@ -153,6 +153,8 @@
V4L2_CID_PRV_IRIS_LOWER_BAND,
V4L2_CID_PRV_IRIS_AUDIO_MODE,
V4L2_CID_PRV_IRIS_RMSSI,
+
+ V4L2_CID_PRV_ENABLE_SLIMBUS = 0x00980940,
};
#endif
diff --git a/jni/android_hardware_fm.cpp b/jni/android_hardware_fm.cpp
index b5b0a5e..0599002 100644
--- a/jni/android_hardware_fm.cpp
+++ b/jni/android_hardware_fm.cpp
@@ -1498,6 +1498,15 @@
return FM_JNI_SUCCESS;
}
+static jint android_hardware_fmradio_FmReceiverJNI_enableSlimbusNative
+ (JNIEnv * env, jobject thiz, jint fd, jint val)
+{
+ ALOGD("%s: val = %d\n", __func__, val);
+ int err = JNI_ERR;
+ err = vendor_interface->set_fm_ctrl(V4L2_CID_PRV_ENABLE_SLIMBUS, val);
+ return err;
+}
+
static void classInitNative(JNIEnv* env, jclass clazz) {
ALOGI("ClassInit native called \n");
@@ -1644,6 +1653,8 @@
(void*)android_hardware_fmradio_FmReceiverJNI_setSpurDataNative},
{ "configurePerformanceParams", "(I)V",
(void*)android_hardware_fmradio_FmReceiverJNI_configurePerformanceParams},
+ { "enableSlimbus", "(II)I",
+ (void*)android_hardware_fmradio_FmReceiverJNI_enableSlimbusNative},
};
int register_android_hardware_fm_fmradio(JNIEnv* env)