libfmjni: Resolve property isolation issues

* Set system instead of vendor properties for FM init
  on devices that don't use firmware download.
* Shut the radio down properly while we are at it.

Change-Id: I8f77a4f822ec8c609fe3526d7e96ea19d46cb1f8
This commit is contained in:
Michael Bestas
2020-04-22 05:05:04 +03:00
parent 01148c2002
commit e33227ed63
3 changed files with 35 additions and 13 deletions

View File

@@ -267,6 +267,12 @@ exit:
close_fd:
event_listener_canceled = true;
pthread_join(event_listener_thread, NULL);
if (strcmp(value, "rome") != 0) {
ret = FmIoctlsInterface::close_fm_patch_dl();
if (ret != FM_SUCCESS) {
ALOGE("FM patch downloader close failed: %d\n", ret);
}
}
close(fd_driver);
fd_driver = -1;
set_fm_state(FM_OFF);
@@ -278,6 +284,9 @@ close_fd:
int FmRadioController ::Pwr_Down()
{
int ret = 0;
char value[PROPERTY_VALUE_MAX] = {'\0'};
property_get("vendor.bluetooth.soc", value, NULL);
if((cur_fm_state != FM_OFF)) {
Stop_Scan_Seek();
@@ -290,6 +299,12 @@ int FmRadioController ::Pwr_Down()
event_listener_canceled = true;
pthread_join(event_listener_thread, NULL);
}
if (strcmp(value, "rome") != 0) {
ret = FmIoctlsInterface::close_fm_patch_dl();
if (ret != FM_SUCCESS) {
ALOGE("FM patch downloader close failed: %d\n", ret);
}
}
ALOGD("%s, [ret=%d]\n", __func__, ret);
return ret;
}