jni: Resolve V4L2_CID_AUDIO_MUTE redefinitions
* Give priority to linux/videodev2.h, and define
the value only if not provided by the kernel
Change-Id: I1ac54aa1c38ec069966cfd8a59ab30545261a065
diff --git a/jni/FmConst.h b/jni/FmConst.h
index e37160f..fc858d9 100644
--- a/jni/FmConst.h
+++ b/jni/FmConst.h
@@ -48,7 +48,9 @@
#define V4L2_CTRL_CLASS_USER 0x00980000
#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
+#ifndef V4L2_CID_AUDIO_MUTE
#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE + 9)
+#endif
const UINT SEARCH_DWELL_TIME = 2;
const UINT SEEK_DWELL_TIME = 0;
diff --git a/jni/FmIoctlsInterface.cpp b/jni/FmIoctlsInterface.cpp
index 640a90f..04cfd64 100644
--- a/jni/FmIoctlsInterface.cpp
+++ b/jni/FmIoctlsInterface.cpp
@@ -26,7 +26,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "FmIoctlsInterface.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
@@ -36,6 +35,7 @@
#include <sys/ioctl.h>
#include <linux/videodev2.h>
#include <math.h>
+#include "FmIoctlsInterface.h"
char const * const FmIoctlsInterface::LOGTAG = "FmIoctlsInterface";
diff --git a/jni/FmPerformanceParams.cpp b/jni/FmPerformanceParams.cpp
index 9d1542f..aa26a37 100644
--- a/jni/FmPerformanceParams.cpp
+++ b/jni/FmPerformanceParams.cpp
@@ -26,13 +26,13 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "FmPerformanceParams.h"
-#include "FmIoctlsInterface.h"
-
#include <cstdio>
#include <linux/videodev2.h>
#include <utils/Log.h>
+#include "FmPerformanceParams.h"
+#include "FmIoctlsInterface.h"
+
signed char FmPerformanceParams :: SetAfRmssiTh
(
UINT fd, unsigned short th
diff --git a/jni/android_hardware_fm.cpp b/jni/android_hardware_fm.cpp
index fb15d7b..79d6eae 100644
--- a/jni/android_hardware_fm.cpp
+++ b/jni/android_hardware_fm.cpp
@@ -32,8 +32,6 @@
#include <nativehelper/JNIHelp.h>
#include <utils/Log.h>
#include "utils/misc.h"
-#include "FmIoctlsInterface.h"
-#include "ConfigFmThs.h"
#include <cutils/properties.h>
#include <fcntl.h>
#include <math.h>
@@ -44,6 +42,8 @@
#include "android_runtime/Log.h"
#include "android_runtime/AndroidRuntime.h"
#include "radio-helium.h"
+#include "FmIoctlsInterface.h"
+#include "ConfigFmThs.h"
#define RADIO "/dev/radio0"
#define FM_JNI_SUCCESS 0L