mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-21 11:55:31 -04:00
universal7885: Include a radio wrapper
vendor.samsung.hardware.radio@2.1 extends android.hardware.radio@1.4 which can be casted and registered
This commit is contained in:
parent
21cd0f77f7
commit
cdcdf5481c
5 changed files with 65 additions and 3 deletions
21
universal7885-common/hidl-packages/radio/Android.bp
Normal file
21
universal7885-common/hidl-packages/radio/Android.bp
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
cc_binary {
|
||||||
|
name: "android.hardware.radio@1.4-service.samsung",
|
||||||
|
init_rc: ["android.hardware.radio@1.4-service.samsung.rc"],
|
||||||
|
relative_install_path: "hw",
|
||||||
|
vendor: true,
|
||||||
|
srcs: [
|
||||||
|
"service.cpp",
|
||||||
|
],
|
||||||
|
shared_libs: [
|
||||||
|
"libhidlbase",
|
||||||
|
"liblog",
|
||||||
|
"libutils",
|
||||||
|
"android.hardware.radio@1.0",
|
||||||
|
"android.hardware.radio@1.1",
|
||||||
|
"android.hardware.radio@1.2",
|
||||||
|
"android.hardware.radio@1.3",
|
||||||
|
"android.hardware.radio@1.4",
|
||||||
|
"vendor.samsung.hardware.radio@2.1",
|
||||||
|
"android.hidl.safe_union@1.0",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
service vendor.radio-1-4 /vendor/bin/hw/android.hardware.radio@1.4-service.samsung
|
||||||
|
class hal
|
||||||
|
user system
|
||||||
|
group system
|
||||||
38
universal7885-common/hidl-packages/radio/service.cpp
Normal file
38
universal7885-common/hidl-packages/radio/service.cpp
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
#define LOG_TAG "android.hardware.radio@1.4-service.samsung"
|
||||||
|
|
||||||
|
#include <android/hardware/radio/1.4/IRadio.h>
|
||||||
|
#include <hidl/HidlTransportSupport.h>
|
||||||
|
#include <vendor/samsung/hardware/radio/2.1/ISehRadio.h>
|
||||||
|
|
||||||
|
using android::OK;
|
||||||
|
using android::sp;
|
||||||
|
using android::status_t;
|
||||||
|
using android::hardware::configureRpcThreadpool;
|
||||||
|
using android::hardware::joinRpcThreadpool;
|
||||||
|
using android::hardware::radio::V1_4::IRadio;
|
||||||
|
using vendor::samsung::hardware::radio::V2_1::ISehRadio;
|
||||||
|
|
||||||
|
#define SLOT_1 "slot1"
|
||||||
|
#define SLOT_2 "slot2"
|
||||||
|
|
||||||
|
static void registerInstance(const char *name) {
|
||||||
|
sp<ISehRadio> sehRadio = ISehRadio::getService(name);
|
||||||
|
sp<IRadio> radio = IRadio::castFrom(static_cast<sp<IRadio>>(sehRadio));
|
||||||
|
if (radio) {
|
||||||
|
status_t status = radio->registerAsService(name);
|
||||||
|
ALOGW_IF(status != OK, "Could not register IRadio v1.4 %s", name);
|
||||||
|
} else {
|
||||||
|
ALOGE("Failed to cast to Radio V1.4");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
configureRpcThreadpool(1, true);
|
||||||
|
|
||||||
|
registerInstance(SLOT_1);
|
||||||
|
registerInstance(SLOT_2);
|
||||||
|
ALOGD("Default service is ready.");
|
||||||
|
|
||||||
|
joinRpcThreadpool();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
@ -217,6 +217,7 @@
|
||||||
/(vendor|system/vendor)/bin/hw/vendor\.samsung\.hardware\.gnss@[0-9]\.[0-9]-service u:object_r:hal_gnss_default_exec:s0
|
/(vendor|system/vendor)/bin/hw/vendor\.samsung\.hardware\.gnss@[0-9]\.[0-9]-service u:object_r:hal_gnss_default_exec:s0
|
||||||
/(vendor|system/vendor)/bin/hw/android\.hardware\.sensors@[0-9]\.[0-9]-service\.a10 u:object_r:hal_sensors_default_exec:s0
|
/(vendor|system/vendor)/bin/hw/android\.hardware\.sensors@[0-9]\.[0-9]-service\.a10 u:object_r:hal_sensors_default_exec:s0
|
||||||
/(vendor|system/vendor)/bin/hw/android\.hardware\.power\.stats-service\.exynos7 u:object_r:hal_power_stats_default_exec:s0
|
/(vendor|system/vendor)/bin/hw/android\.hardware\.power\.stats-service\.exynos7 u:object_r:hal_power_stats_default_exec:s0
|
||||||
|
/(vendor|system/vendor)/bin/hw/android\.hardware\.radio@1\.4-service\.samsung u:object_r:hal_radio_default_exec:s0
|
||||||
/(vendor|system/vendor)/firmware(/.*)? u:object_r:vendor_firmware_file:s0
|
/(vendor|system/vendor)/firmware(/.*)? u:object_r:vendor_firmware_file:s0
|
||||||
|
|
||||||
/factory(/.*)? u:object_r:sec_efs_file:s0
|
/factory(/.*)? u:object_r:sec_efs_file:s0
|
||||||
|
|
|
||||||
|
|
@ -275,12 +275,10 @@ PRODUCT_COPY_FILES += \
|
||||||
|
|
||||||
# RIL
|
# RIL
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
android.hardware.radio@1.4.vendor \
|
android.hardware.radio@1.4-service.samsung \
|
||||||
android.hardware.radio@1.0 \
|
android.hardware.radio@1.0 \
|
||||||
android.hardware.radio.config@1.2.vendor \
|
android.hardware.radio.config@1.2.vendor \
|
||||||
android.hardware.radio.deprecated@1.0.vendor \
|
android.hardware.radio.deprecated@1.0.vendor \
|
||||||
vendor.samsung.hardware.radio@2.1.vendor \
|
|
||||||
vendor.samsung.hardware.radio.channel@2.0.vendor
|
|
||||||
|
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
secril_config_svc
|
secril_config_svc
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue