msm8974-common: libinit: Commonize {cdma,gsm}_properties functions

* It doesn't make sense to maintain these in the numerous device-
  specific trees. It especially doesn't make sense for those to be
  subtly-different.

Change-Id: I4e82c0f6b5b835ac4c742a5d5663a8f3498aaf7b
This commit is contained in:
Kevin F. Haggerty 2020-02-28 07:50:43 -07:00
parent a1be441339
commit 1d1a7f182c
No known key found for this signature in database
GPG Key ID: 6D95512933112729
2 changed files with 47 additions and 1 deletions

View File

@ -42,6 +42,45 @@ void init_target_properties()
{
}
void set_rild_libpath(char const variant[])
{
std::string libpath("/system/vendor/lib/libsec-ril.");
libpath += variant;
libpath += ".so";
property_override("rild.libpath", libpath.c_str());
}
void cdma_properties(char const operator_alpha[],
char const operator_numeric[],
char const default_cdma_sub[],
char const default_network[],
char const rild_lib_variant[])
{
// Dynamic CDMA Properties
property_set("ro.cdma.home.operator.alpha", operator_alpha);
property_set("ro.cdma.home.operator.numeric", operator_numeric);
property_set("ro.telephony.default_cdma_sub", default_cdma_sub);
property_set("ro.telephony.default_network", default_network);
set_rild_libpath(rild_lib_variant);
// Static CDMA Properties
property_set("ril.subscription.types", "NV,RUIM");
property_set("telephony.lteOnCdmaDevice", "1");
}
void gsm_properties(const char default_network[],
char const rild_lib_variant[])
{
set_rild_libpath(rild_lib_variant);
// Dynamic GSM Properties
property_set("ro.telephony.default_network", default_network);
// Static GSM Properties
property_set("telephony.lteOnGsmDevice", "1");
}
void property_override(char const prop[], char const value[])
{
prop_info *pi;

View File

@ -1,6 +1,6 @@
/*
Copyright (c) 2016, The CyanogenMod Project
Copyright (c) 2018, The LineageOS Project
Copyright (c) 2018-2020, The LineageOS Project
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@ -31,6 +31,13 @@
#ifndef __INIT_MSM8974__H__
#define __INIT_MSM8974__H__
void cdma_properties(char const operator_alpha[],
char const operator_numeric[],
char const default_cdma_sub[],
char const default_network[],
char const rild_lib_variant[]);
void gsm_properties(char const default_network[],
char const rild_lib_variant[]);
void init_target_properties();
void property_override(char const prop[], char const value[]);
void property_override_dual(char const system_prop[],