universal7885: interfaces: Implement FMRadio HAL V1.2

* Also, track our fork of OneUI theme lib

* Implement read from sysfs interface which can fix channel searching on some cases

* Commit link: fead45ba0e

Change-Id: I81532b7f8169637fdcad0f678790a2b1f1888ecc
Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
roynatech2544 2022-02-20 13:24:15 +09:00
commit e07865c670
No known key found for this signature in database
GPG key ID: 9675C32163D88D30
14 changed files with 140 additions and 25 deletions

View file

@ -14,6 +14,7 @@ android_app {
],
required: [
"privapp_whitelist_com.eurekateam.fmradio.xml",
"vendor.eureka.hardware.fmradio@1.2-service",
],
optimize: {
proguard_flags_files: ["rules.pro"],

View file

@ -4,6 +4,14 @@ cc_library_shared {
"-Wno-unused-parameter",
],
srcs: ["fm_ioctl.cpp"],
shared_libs: [
"libhidlbase",
"liblog",
"libutils",
"vendor.eureka.hardware.fmradio@1.0",
"vendor.eureka.hardware.fmradio@1.1",
"vendor.eureka.hardware.fmradio@1.2",
],
header_libs: ["jni_headers"],
}

View file

@ -11,6 +11,16 @@
#include "kernel_internal.h"
#include <algorithm>
#include <jni.h>
#include <hardware/hardware.h>
#include <hidl/HidlSupport.h>
#include <hidl/LegacySupport.h>
#include <hidl/Status.h>
#include <vendor/eureka/hardware/fmradio/1.2/IFMRadio.h>
using android::sp;
using vendor::eureka::hardware::fmradio::V1_2::IFMRadio;
using vendor::eureka::hardware::fmradio::V1_0::Direction;
using vendor::eureka::hardware::fmradio::V1_1::Status;
//#define DEBUG
#define TRACK_SIZE 30
@ -185,7 +195,12 @@ static long fm_radio_get_freqs(int fd){
long ret = 0;
fm_radio_set_mute(fd, true);
for (long & track : tracks){
fm_radio_channel_searching(fd, 1, 0, FM_CHANNEL_SPACING_50KHZ, &ret);
if (mSysfs) {
service->adjustFreqByStep(Direction::UP);
ret = (long) service->getFreqFromSysfs();
} else {
fm_radio_channel_searching(fd, 1, 0, FM_CHANNEL_SPACING_50KHZ, &ret);
}
if (contains(tracks, ret)) break;
track = ret;
printf("Found Freq %ld\n", ret);