libfmjni: Improve and fix FM jni logs
* Log cur_fm_state as Debug instead of Error * Log successful and state logs as Debug and Info instead of Error * Log step by step firmware download as Info and Debug * Fix logging of the is_rds_support * Add __func__ name for the cur_fm_state logs * Add a cur_fm_state log for Stop_Scan_Seek * Add missing LOG_TAG for all sources using ALOG* * Avoid double log on error in IsRdsSupport * Fix typos, relevant warnings and cleanup related sources Change-Id: I2abe77c6f00c02ef106b569bef5db6b366e76df1
This commit is contained in:
@@ -27,6 +27,8 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|||||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "android_hardware_fm"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -476,19 +478,19 @@ static char parse_load_frm_fhandler
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
bool has_carriage_rtn = false;
|
bool has_carriage_rtn = false;
|
||||||
|
|
||||||
while((bytes_read = fread(buf, 1, MAX_LINE_LEN, fp))) {
|
while (bytes_read = fread(buf, 1, MAX_LINE_LEN, fp)) {
|
||||||
for(i = 0; i < bytes_read; i++) {
|
for (i = 0; i < bytes_read; i++) {
|
||||||
if(line_len == line_allocated) {
|
if (line_len == line_allocated) {
|
||||||
line_allocated += 25;
|
line_allocated += 25;
|
||||||
new_line = realloc(line, line_allocated);
|
new_line = realloc(line, line_allocated);
|
||||||
if(new_line == NULL) {
|
if (new_line == NULL) {
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
ALOGE("memory allocation failed for line\n");
|
ALOGE("memory allocation failed for line\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
line = (char *)new_line;
|
line = (char *)new_line;
|
||||||
}
|
}
|
||||||
if((buf[i] == '\n')) {
|
if (buf[i] == '\n') {
|
||||||
has_carriage_rtn = false;
|
has_carriage_rtn = false;
|
||||||
line[line_len] = '\0';
|
line[line_len] = '\0';
|
||||||
ret = parse_line(key_file, line, &cur_grp);
|
ret = parse_line(key_file, line, &cur_grp);
|
||||||
@@ -497,15 +499,15 @@ static char parse_load_frm_fhandler
|
|||||||
ALOGE("could not parse the line, line not proper\n");
|
ALOGE("could not parse the line, line not proper\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}else if(buf[i] == '\r') {
|
} else if (buf[i] == '\r') {
|
||||||
ALOGE("File has carriage return\n");
|
ALOGE("File has carriage return\n");
|
||||||
has_carriage_rtn = true;
|
has_carriage_rtn = true;
|
||||||
}else if(has_carriage_rtn) {
|
} else if (has_carriage_rtn) {
|
||||||
ALOGE("File format is not proper, no line character\
|
ALOGE("File format is not proper, no line character\
|
||||||
after carraige return\n");
|
after carraige return\n");
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
break;
|
break;
|
||||||
}else {
|
} else {
|
||||||
line[line_len] = buf[i];
|
line[line_len] = buf[i];
|
||||||
line_len++;
|
line_len++;
|
||||||
}
|
}
|
||||||
@@ -809,7 +811,7 @@ static char line_is_key_value_pair
|
|||||||
}
|
}
|
||||||
while((str != equal_start) && isalnum(*str))
|
while((str != equal_start) && isalnum(*str))
|
||||||
str++;
|
str++;
|
||||||
if((str == equal_start)) {
|
if (str == equal_start) {
|
||||||
key = (char *)malloc(sizeof(char) * (key_len + 1));
|
key = (char *)malloc(sizeof(char) * (key_len + 1));
|
||||||
if(key == NULL) {
|
if(key == NULL) {
|
||||||
ALOGE("could not alloc memory for new key\n");
|
ALOGE("could not alloc memory for new key\n");
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|||||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "android_hardware_fm"
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
@@ -568,7 +570,7 @@ void ConfigFmThs :: SetRxSearchAfThs
|
|||||||
|
|
||||||
keyfile = get_key_file();
|
keyfile = get_key_file();
|
||||||
|
|
||||||
ALOGE("file name is: %s\n", file);
|
ALOGD("%s: file name is: %s\n", __func__, file);
|
||||||
if(!parse_load_file(keyfile, file)) {
|
if(!parse_load_file(keyfile, file)) {
|
||||||
ALOGE("Error in loading threshold file\n");
|
ALOGE("Error in loading threshold file\n");
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|||||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "android_hardware_fm"
|
||||||
|
|
||||||
#include "FmIoctlsInterface.h"
|
#include "FmIoctlsInterface.h"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@@ -51,24 +53,24 @@ int FmIoctlsInterface :: start_fm_patch_dl
|
|||||||
#endif
|
#endif
|
||||||
struct v4l2_capability cap;
|
struct v4l2_capability cap;
|
||||||
|
|
||||||
ALOGE("start_fm_patch_dl = %d\n",fd);
|
ALOGI("%s: start_fm_patch_dl = %d\n", __func__, fd);
|
||||||
ret = ioctl(fd, VIDIOC_QUERYCAP, &cap);
|
ret = ioctl(fd, VIDIOC_QUERYCAP, &cap);
|
||||||
ALOGE("executed cmd\n");
|
ALOGD("%s: executed cmd\n", __func__);
|
||||||
if(ret == IOCTL_SUCC) {
|
if(ret == IOCTL_SUCC) {
|
||||||
ret = snprintf(versionStr, MAX_VER_STR_LEN, "%d", cap.version);
|
ret = snprintf(versionStr, MAX_VER_STR_LEN, "%d", cap.version);
|
||||||
if(ret >= MAX_VER_STR_LEN) {
|
if(ret >= MAX_VER_STR_LEN) {
|
||||||
return FM_FAILURE;
|
return FM_FAILURE;
|
||||||
}else {
|
}else {
|
||||||
ret = property_set(FM_VERSION_PROP, versionStr);
|
ret = property_set(FM_VERSION_PROP, versionStr);
|
||||||
ALOGE("set versionStr done");
|
ALOGD("set versionStr done");
|
||||||
if(ret != PROP_SET_SUCC)
|
if(ret != PROP_SET_SUCC)
|
||||||
return FM_FAILURE;
|
return FM_FAILURE;
|
||||||
ret = property_set(FM_MODE_PROP, "normal");
|
ret = property_set(FM_MODE_PROP, "normal");
|
||||||
ALOGE("set FM_MODE_PROP done");
|
ALOGD("set FM_MODE_PROP done");
|
||||||
if(ret != PROP_SET_SUCC)
|
if(ret != PROP_SET_SUCC)
|
||||||
return FM_FAILURE;
|
return FM_FAILURE;
|
||||||
ret = property_set(FM_INIT_PROP, "0");
|
ret = property_set(FM_INIT_PROP, "0");
|
||||||
ALOGE("set FM_INIT_PROP done");
|
ALOGD("set FM_INIT_PROP done");
|
||||||
if(ret != PROP_SET_SUCC)
|
if(ret != PROP_SET_SUCC)
|
||||||
return FM_FAILURE;
|
return FM_FAILURE;
|
||||||
#ifndef QCOM_NO_FM_FIRMWARE
|
#ifndef QCOM_NO_FM_FIRMWARE
|
||||||
@@ -311,7 +313,7 @@ int FmIoctlsInterface :: get_upperband_limit
|
|||||||
return FM_FAILURE;
|
return FM_FAILURE;
|
||||||
}else {
|
}else {
|
||||||
freq = (tuner.rangehigh / TUNE_MULT);
|
freq = (tuner.rangehigh / TUNE_MULT);
|
||||||
ALOGE("high freq: %d\n",freq);
|
ALOGI("high freq: %lu\n", freq);
|
||||||
return FM_SUCCESS;
|
return FM_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -330,7 +332,7 @@ int FmIoctlsInterface :: get_lowerband_limit
|
|||||||
return FM_FAILURE;
|
return FM_FAILURE;
|
||||||
}else {
|
}else {
|
||||||
freq = (tuner.rangelow / TUNE_MULT);
|
freq = (tuner.rangelow / TUNE_MULT);
|
||||||
ALOGE("low freq: %d\n",freq);
|
ALOGE("low freq: %lu\n",freq);
|
||||||
return FM_SUCCESS;
|
return FM_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|||||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "android_hardware_fm"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
#include "FmPerformanceParams.h"
|
#include "FmPerformanceParams.h"
|
||||||
@@ -54,7 +56,7 @@ signed char FmPerformanceParams :: SetBand
|
|||||||
76000, 90000);
|
76000, 90000);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ALOGE("Band type: %ld is invalid\n", band);
|
ALOGE("Band type: %u is invalid\n", band);
|
||||||
ret = FM_FAILURE;
|
ret = FM_FAILURE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|||||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "android_hardware_fm"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@@ -163,7 +165,7 @@ int FmRadioController ::Pwr_Up(int freq)
|
|||||||
|
|
||||||
ALOGI("%s,[freq=%d]\n", __func__, freq);
|
ALOGI("%s,[freq=%d]\n", __func__, freq);
|
||||||
property_get("qcom.bluetooth.soc", value, NULL);
|
property_get("qcom.bluetooth.soc", value, NULL);
|
||||||
ALOGD("BT soc is %s\n", value);
|
ALOGD("BT soc is '%s'\n", value);
|
||||||
if (fd_driver < 0) {
|
if (fd_driver < 0) {
|
||||||
ret = open_dev();
|
ret = open_dev();
|
||||||
if (ret != FM_SUCCESS) {
|
if (ret != FM_SUCCESS) {
|
||||||
@@ -173,7 +175,7 @@ int FmRadioController ::Pwr_Up(int freq)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cur_fm_state == FM_OFF) {
|
if (cur_fm_state == FM_OFF) {
|
||||||
ALOGE("cur_fm_state = %d\n",cur_fm_state);
|
ALOGD("%s: cur_fm_state = %d\n", __func__, cur_fm_state);
|
||||||
if (strcmp(value, "rome") != 0) {
|
if (strcmp(value, "rome") != 0) {
|
||||||
ret = FmIoctlsInterface::start_fm_patch_dl(fd_driver);
|
ret = FmIoctlsInterface::start_fm_patch_dl(fd_driver);
|
||||||
if (ret != FM_SUCCESS) {
|
if (ret != FM_SUCCESS) {
|
||||||
@@ -284,7 +286,7 @@ int FmRadioController ::Pwr_Down()
|
|||||||
V4L2_CID_PRV_STATE, FM_DEV_NONE);
|
V4L2_CID_PRV_STATE, FM_DEV_NONE);
|
||||||
}
|
}
|
||||||
if(event_listener_thread != 0) {
|
if(event_listener_thread != 0) {
|
||||||
ALOGD("%s, event_listener_thread canceeled\n", __func__);
|
ALOGD("%s, event_listener_thread cancelled\n", __func__);
|
||||||
event_listener_canceled = true;
|
event_listener_canceled = true;
|
||||||
pthread_join(event_listener_thread, NULL);
|
pthread_join(event_listener_thread, NULL);
|
||||||
}
|
}
|
||||||
@@ -333,7 +335,7 @@ int FmRadioController :: Seek(int dir)
|
|||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
if (cur_fm_state != FM_ON) {
|
if (cur_fm_state != FM_ON) {
|
||||||
ALOGE("%s error Fm state: %d\n", __func__,cur_fm_state);
|
ALOGE("%s error Fm state: %d\n", __func__, cur_fm_state);
|
||||||
return FM_FAILURE;
|
return FM_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,7 +385,7 @@ bool FmRadioController ::IsRds_support
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
is_rds_support = true;
|
is_rds_support = true;
|
||||||
ALOGI("is_rds_support: \n", is_rds_support);
|
ALOGI("is_rds_support: %d\n", is_rds_support);
|
||||||
return is_rds_support;
|
return is_rds_support;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -392,12 +394,12 @@ int FmRadioController ::MuteOn()
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ALOGE("cur_fm_state = %d\n", cur_fm_state);
|
ALOGD("%s: cur_fm_state = %d\n", __func__, cur_fm_state);
|
||||||
if((cur_fm_state != FM_OFF) &&
|
if((cur_fm_state != FM_OFF) &&
|
||||||
(cur_fm_state != FM_ON_IN_PROGRESS)) {
|
(cur_fm_state != FM_ON_IN_PROGRESS)) {
|
||||||
ret = FmIoctlsInterface::set_control(fd_driver,
|
ret = FmIoctlsInterface::set_control(fd_driver,
|
||||||
V4L2_CID_AUDIO_MUTE, MUTE_L_R_CHAN);
|
V4L2_CID_AUDIO_MUTE, MUTE_L_R_CHAN);
|
||||||
ALOGE("CMD executed mute\n");
|
ALOGI("CMD executed mute\n");
|
||||||
}else {
|
}else {
|
||||||
ret = FM_FAILURE;
|
ret = FM_FAILURE;
|
||||||
}
|
}
|
||||||
@@ -409,12 +411,12 @@ int FmRadioController ::MuteOff()
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ALOGE("cur_fm_state = %d\n", cur_fm_state);
|
ALOGD("%s: cur_fm_state = %d\n", __func__, cur_fm_state);
|
||||||
if((cur_fm_state != FM_OFF) &&
|
if((cur_fm_state != FM_OFF) &&
|
||||||
(cur_fm_state != FM_ON_IN_PROGRESS)) {
|
(cur_fm_state != FM_ON_IN_PROGRESS)) {
|
||||||
ret = FmIoctlsInterface::set_control(fd_driver,
|
ret = FmIoctlsInterface::set_control(fd_driver,
|
||||||
V4L2_CID_AUDIO_MUTE, UNMUTE_L_R_CHAN);
|
V4L2_CID_AUDIO_MUTE, UNMUTE_L_R_CHAN);
|
||||||
ALOGE("CMD executed for unmute\n");
|
ALOGI("CMD executed for unmute\n");
|
||||||
}else {
|
}else {
|
||||||
ret = FM_FAILURE;
|
ret = FM_FAILURE;
|
||||||
}
|
}
|
||||||
@@ -458,6 +460,7 @@ int FmRadioController :: Stop_Scan_Seek
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
ALOGD("%s: cur_fm_state = %d\n", __func__, cur_fm_state);
|
||||||
if((cur_fm_state == SEEK_IN_PROGRESS) ||
|
if((cur_fm_state == SEEK_IN_PROGRESS) ||
|
||||||
(cur_fm_state == SCAN_IN_PROGRESS)) {
|
(cur_fm_state == SCAN_IN_PROGRESS)) {
|
||||||
ret = FmIoctlsInterface::set_control(fd_driver,
|
ret = FmIoctlsInterface::set_control(fd_driver,
|
||||||
@@ -616,7 +619,7 @@ int FmRadioController :: SetDeConstant
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ALOGE("cur_fm_state: %d, emphasis: %d\n", cur_fm_state, emphasis);
|
ALOGD("cur_fm_state: %d, emphasis: %ld\n", cur_fm_state, emphasis);
|
||||||
if(cur_fm_state == FM_ON) {
|
if(cur_fm_state == FM_ON) {
|
||||||
switch(emphasis) {
|
switch(emphasis) {
|
||||||
case DE_EMP75:
|
case DE_EMP75:
|
||||||
@@ -686,7 +689,7 @@ int FmRadioController :: GetStationList
|
|||||||
freq |= tmpFreqByte2;
|
freq |= tmpFreqByte2;
|
||||||
ALOGI(" freq: %d", freq);
|
ALOGI(" freq: %d", freq);
|
||||||
real_freq = (freq * FREQ_MULTIPLEX) + lowBand;
|
real_freq = (freq * FREQ_MULTIPLEX) + lowBand;
|
||||||
ALOGI(" real_freq: %d", real_freq);
|
ALOGI("real_freq: %f", real_freq);
|
||||||
if ( (real_freq < lowBand ) || (real_freq > highBand) ) {
|
if ( (real_freq < lowBand ) || (real_freq > highBand) ) {
|
||||||
ALOGI("Frequency out of band limits");
|
ALOGI("Frequency out of band limits");
|
||||||
} else {
|
} else {
|
||||||
@@ -741,7 +744,7 @@ int FmRadioController ::ScanList
|
|||||||
return FM_FAILURE;
|
return FM_FAILURE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ALOGI("Scanlist: not proper state %d\n",cur_fm_state );
|
ALOGI("Scanlist: not proper state %d\n", cur_fm_state);
|
||||||
return FM_FAILURE;
|
return FM_FAILURE;
|
||||||
}
|
}
|
||||||
return FM_SUCCESS;
|
return FM_SUCCESS;
|
||||||
@@ -798,7 +801,7 @@ int FmRadioController :: EnableRDS
|
|||||||
{
|
{
|
||||||
int ret = FM_FAILURE;
|
int ret = FM_FAILURE;
|
||||||
|
|
||||||
ALOGE("%s:cur_fm_state = %d\n", __func__, cur_fm_state);
|
ALOGD("%s: cur_fm_state = %d\n", __func__, cur_fm_state);
|
||||||
if (cur_fm_state == FM_ON) {
|
if (cur_fm_state == FM_ON) {
|
||||||
ret = FmIoctlsInterface::set_control(fd_driver,
|
ret = FmIoctlsInterface::set_control(fd_driver,
|
||||||
V4L2_CID_PRV_RDSON, 1);
|
V4L2_CID_PRV_RDSON, 1);
|
||||||
@@ -818,7 +821,7 @@ int FmRadioController :: EnableRDS
|
|||||||
rds_enabled = 1;
|
rds_enabled = 1;
|
||||||
EnableAF();
|
EnableAF();
|
||||||
} else {
|
} else {
|
||||||
ALOGE("%s:not in proper state cur_fm_state = %d\n", cur_fm_state);
|
ALOGE("%s: not in proper state cur_fm_state = %d\n", __func__, cur_fm_state);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -833,7 +836,7 @@ int FmRadioController :: DisableRDS
|
|||||||
{
|
{
|
||||||
int ret = FM_FAILURE;
|
int ret = FM_FAILURE;
|
||||||
|
|
||||||
ALOGE("%s:cur_fm_state = %d\n", __func__, cur_fm_state);
|
ALOGD("%s: cur_fm_state = %d\n", __func__, cur_fm_state);
|
||||||
if (cur_fm_state == FM_ON) {
|
if (cur_fm_state == FM_ON) {
|
||||||
ret = FmIoctlsInterface::set_control(fd_driver,
|
ret = FmIoctlsInterface::set_control(fd_driver,
|
||||||
V4L2_CID_PRV_RDSON, 2);
|
V4L2_CID_PRV_RDSON, 2);
|
||||||
@@ -845,7 +848,7 @@ int FmRadioController :: DisableRDS
|
|||||||
rds_enabled = 0;
|
rds_enabled = 0;
|
||||||
DisableAF();
|
DisableAF();
|
||||||
} else {
|
} else {
|
||||||
ALOGE("%s:not in proper state cur_fm_state = %d\n", cur_fm_state);
|
ALOGE("%s: not in proper state cur_fm_state = %d\n", __func__, cur_fm_state);
|
||||||
ret = FM_FAILURE;
|
ret = FM_FAILURE;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __FM_RADIO_CTRL_H__
|
#ifndef __FM_RADIO_CTRL_H__
|
||||||
#define __FM_RADIO_CTRL_H___
|
#define __FM_RADIO_CTRL_H__
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|||||||
11
LibfmJni.cpp
11
LibfmJni.cpp
@@ -27,6 +27,8 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
|||||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define LOG_TAG "android_hardware_fm"
|
||||||
|
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
#include "JNIHelp.h"
|
#include "JNIHelp.h"
|
||||||
#include "android_runtime/AndroidRuntime.h"
|
#include "android_runtime/AndroidRuntime.h"
|
||||||
@@ -291,8 +293,9 @@ jint IsRdsSupport(JNIEnv *env, jobject thiz)
|
|||||||
ret = JNI_FALSE;
|
ret = JNI_FALSE;
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
ALOGE("%s, error, [ret=%d]\n", __func__, ret);
|
ALOGE("%s, error, [ret=%d]\n", __func__, ret);
|
||||||
}
|
} else {
|
||||||
ALOGD("%s, [ret=%d]\n", __func__, ret);
|
ALOGD("%s, [ret=%d]\n", __func__, ret);
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,7 +321,7 @@ jint SetAntenna(JNIEnv *env, jobject thiz, jint antenna)
|
|||||||
} else if (1 == antenna) {
|
} else if (1 == antenna) {
|
||||||
ana = FM_SHORT_ANA;
|
ana = FM_SHORT_ANA;
|
||||||
} else {
|
} else {
|
||||||
ALOGE("%s:fail, para error\n", __func__);
|
ALOGE("%s: fail, para error\n", __func__);
|
||||||
jret = JNI_FALSE;
|
jret = JNI_FALSE;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@@ -367,9 +370,9 @@ jint JNI_OnLoad(JavaVM *jvm, void *reserved)
|
|||||||
{
|
{
|
||||||
JNIEnv *e;
|
JNIEnv *e;
|
||||||
int status;
|
int status;
|
||||||
ALOGE("FM : loading FM-JNI\n");
|
ALOGI("FM: loading FM-JNI\n");
|
||||||
|
|
||||||
if(jvm->GetEnv((void **)&e, JNI_VERSION_1_6)) {
|
if (jvm->GetEnv((void **)&e, JNI_VERSION_1_6)) {
|
||||||
ALOGE("JNI version mismatch error");
|
ALOGE("JNI version mismatch error");
|
||||||
return JNI_ERR;
|
return JNI_ERR;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user