diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index dbdd7c4..7f095dc 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -81,7 +81,8 @@ TARGET_POWERHAL_VARIANT := qcom TARGET_SYSTEM_PROP += device/samsung/klte-common/system.prop # Radio -BOARD_RIL_CLASS := ../../../device/samsung/klte-common/ril +BOARD_PROVIDES_LIBRIL := true +TARGET_RIL_VARIANT := caf # Recovery BOARD_CUSTOM_RECOVERY_KEYMAPPING := ../../device/samsung/klte-common/recovery/recovery_keys.c diff --git a/common-proprietary-files.txt b/common-proprietary-files.txt index 51af267..6f9a117 100644 --- a/common-proprietary-files.txt +++ b/common-proprietary-files.txt @@ -302,7 +302,6 @@ bin/ks|949406ae5d1b74034b3828af1905a181e4b69961 bin/qcks|9026c84f32e1ee5121024c72b878c09dfde95e5b bin/qmuxd|e257d63996812e2eb23810bda59913f558ee03d2 bin/rfs_access|49a8516ed01b609a9e5079d8135b75db5b024236 -bin/rild|0b849cf10cb658e425e871e0d3cf86fe2ccdafd7 bin/rmt_storage|000ddcabfc9416e9a27ba6d04860cc14b6803cdd vendor/lib/libril-qcril-hook-oem.so|6a73ed46f4fbcb283eea5fb44b24a7d14522bfe5 diff --git a/klte.mk b/klte.mk index b302834..8a71b8d 100644 --- a/klte.mk +++ b/klte.mk @@ -137,7 +137,7 @@ PRODUCT_COPY_FILES += \ # Radio PRODUCT_PACKAGES += \ libsecnativefeature \ - libshim_ril + libshim_cutils_atomic # Ramdisk PRODUCT_PACKAGES += \ diff --git a/ril/telephony/java/com/android/internal/telephony/KlteRIL.java b/ril/telephony/java/com/android/internal/telephony/KlteRIL.java deleted file mode 100644 index 30fa579..0000000 --- a/ril/telephony/java/com/android/internal/telephony/KlteRIL.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright (C) 2014-2016 The CyanogenMod Project - * Copyright (C) 2017 The LineageOS Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.internal.telephony; - -import android.content.Context; -import android.os.Message; -import android.os.Parcel; -import android.telephony.PhoneNumberUtils; -import android.telephony.SignalStrength; - -import com.android.internal.telephony.cdma.CdmaInformationRecords; -import com.android.internal.telephony.cdma.CdmaInformationRecords.CdmaSignalInfoRec; -import com.android.internal.telephony.cdma.SignalToneUtil; -import com.android.internal.telephony.uicc.IccCardApplicationStatus; -import com.android.internal.telephony.uicc.IccCardStatus; -import com.android.internal.telephony.uicc.IccUtils; - -import java.util.ArrayList; -import java.util.Collections; - -import static com.android.internal.telephony.RILConstants.*; - -/** - * RIL customization for Galaxy S5 (GSM) LTE devices - * - * {@hide} - */ -public class KlteRIL extends RIL { - - public KlteRIL(Context context, int networkMode, int cdmaSubscription) { - super(context, networkMode, cdmaSubscription, null); - } - - public KlteRIL(Context context, int preferredNetworkType, - int cdmaSubscription, Integer instanceId) { - super(context, preferredNetworkType, cdmaSubscription, instanceId); - } - - private void - fixNitz(Parcel p) { - int dataPosition = p.dataPosition(); - String nitz = p.readString(); - long nitzReceiveTime = p.readLong(); - - String[] nitzParts = nitz.split(","); - if (nitzParts.length >= 4) { - // 0=date, 1=time+zone, 2=dst, 3(+)=garbage that confuses ServiceStateTracker - nitz = nitzParts[0] + "," + nitzParts[1] + "," + nitzParts[2]; - p.setDataPosition(dataPosition); - p.writeString(nitz); - p.writeLong(nitzReceiveTime); - // The string is shorter now, drop the extra bytes - p.setDataSize(p.dataPosition()); - } - } - - @Override - public void - dial(String address, int clirMode, UUSInfo uusInfo, Message result) { - RILRequest rr = RILRequest.obtain(RIL_REQUEST_DIAL, result); - - rr.mParcel.writeString(address); - rr.mParcel.writeInt(clirMode); - rr.mParcel.writeInt(0); // CallDetails.call_type - rr.mParcel.writeInt(1); // CallDetails.call_domain - rr.mParcel.writeString(""); // CallDetails.getCsvFromExtras - - if (uusInfo == null) { - rr.mParcel.writeInt(0); // UUS information is absent - } else { - rr.mParcel.writeInt(1); // UUS information is present - rr.mParcel.writeInt(uusInfo.getType()); - rr.mParcel.writeInt(uusInfo.getDcs()); - rr.mParcel.writeByteArray(uusInfo.getUserData()); - } - - if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); - - send(rr); - } - - @Override - public void - acceptCall(Message result) { - RILRequest rr - = RILRequest.obtain(RIL_REQUEST_ANSWER, result); - - rr.mParcel.writeInt(1); - rr.mParcel.writeInt(0); - - if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); - - send(rr); - } - - @Override - protected void - processUnsolicited(Parcel p, int type) { - Object ret; - int dataPosition = p.dataPosition(); - int response = p.readInt(); - - switch(response) { - case RIL_UNSOL_NITZ_TIME_RECEIVED: - fixNitz(p); - break; - } - - p.setDataPosition(dataPosition); - super.processUnsolicited(p, type); - } - - @Override - protected Object - responseIccCardStatus(Parcel p) { - IccCardApplicationStatus appStatus; - - IccCardStatus cardStatus = new IccCardStatus(); - cardStatus.setCardState(p.readInt()); - cardStatus.setUniversalPinState(p.readInt()); - cardStatus.mGsmUmtsSubscriptionAppIndex = p.readInt(); - cardStatus.mCdmaSubscriptionAppIndex = p.readInt(); - cardStatus.mImsSubscriptionAppIndex = p.readInt(); - int numApplications = p.readInt(); - - // limit to maximum allowed applications - if (numApplications > IccCardStatus.CARD_MAX_APPS) { - numApplications = IccCardStatus.CARD_MAX_APPS; - } - cardStatus.mApplications = new IccCardApplicationStatus[numApplications]; - for (int i = 0; i < numApplications; i++) { - appStatus = new IccCardApplicationStatus(); - appStatus.app_type = appStatus.AppTypeFromRILInt(p.readInt()); - appStatus.app_state = appStatus.AppStateFromRILInt(p.readInt()); - appStatus.perso_substate = appStatus.PersoSubstateFromRILInt(p.readInt()); - appStatus.aid = p.readString(); - appStatus.app_label = p.readString(); - appStatus.pin1_replaced = p.readInt(); - appStatus.pin1 = appStatus.PinStateFromRILInt(p.readInt()); - appStatus.pin2 = appStatus.PinStateFromRILInt(p.readInt()); - p.readInt(); // pin1_num_retries - p.readInt(); // puk1_num_retries - p.readInt(); // pin2_num_retries - p.readInt(); // puk2_num_retries - p.readInt(); // perso_unblock_retries - cardStatus.mApplications[i] = appStatus; - } - return cardStatus; - } - - @Override - protected Object - responseCallList(Parcel p) { - int num; - int voiceSettings; - ArrayList response; - DriverCall dc; - - num = p.readInt(); - response = new ArrayList(num); - - if (RILJ_LOGV) { - riljLog("responseCallList: num=" + num + - " mEmergencyCallbackModeRegistrant=" + mEmergencyCallbackModeRegistrant + - " mTestingEmergencyCall=" + mTestingEmergencyCall.get()); - } - for (int i = 0; i < num; i++) { - dc = new DriverCall(); - - dc.state = DriverCall.stateFromCLCC(p.readInt()); - dc.index = p.readInt() & 0xff; - dc.TOA = p.readInt(); - dc.isMpty = (0 != p.readInt()); - dc.isMT = (0 != p.readInt()); - dc.als = p.readInt(); - dc.isVoice = (0 != p.readInt()); - int call_type = p.readInt(); // Samsung CallDetails - int call_domain = p.readInt(); // Samsung CallDetails - String csv = p.readString(); // Samsung CallDetails - dc.isVoicePrivacy = (0 != p.readInt()); - dc.number = p.readString(); - int np = p.readInt(); - dc.numberPresentation = DriverCall.presentationFromCLIP(np); - dc.name = p.readString(); - dc.namePresentation = DriverCall.presentationFromCLIP(p.readInt()); - int uusInfoPresent = p.readInt(); - if (uusInfoPresent == 1) { - dc.uusInfo = new UUSInfo(); - dc.uusInfo.setType(p.readInt()); - dc.uusInfo.setDcs(p.readInt()); - byte[] userData = p.createByteArray(); - dc.uusInfo.setUserData(userData); - riljLogv(String.format("Incoming UUS : type=%d, dcs=%d, length=%d", - dc.uusInfo.getType(), dc.uusInfo.getDcs(), - dc.uusInfo.getUserData().length)); - riljLogv("Incoming UUS : data (string)=" - + new String(dc.uusInfo.getUserData())); - riljLogv("Incoming UUS : data (hex): " - + IccUtils.bytesToHexString(dc.uusInfo.getUserData())); - } else { - riljLogv("Incoming UUS : NOT present!"); - } - - // Make sure there's a leading + on addresses with a TOA of 145 - dc.number = PhoneNumberUtils.stringFromStringAndTOA(dc.number, dc.TOA); - - response.add(dc); - - if (dc.isVoicePrivacy) { - mVoicePrivacyOnRegistrants.notifyRegistrants(); - riljLog("InCall VoicePrivacy is enabled"); - } else { - mVoicePrivacyOffRegistrants.notifyRegistrants(); - riljLog("InCall VoicePrivacy is disabled"); - } - } - - Collections.sort(response); - - if ((num == 0) && mTestingEmergencyCall.getAndSet(false)) { - if (mEmergencyCallbackModeRegistrant != null) { - riljLog("responseCallList: call ended, testing emergency call," + - " notify ECM Registrants"); - mEmergencyCallbackModeRegistrant.notifyRegistrant(); - } - } - - return response; - } - - @Override - protected Object responseSignalStrength(Parcel p) { - int numInts = 12; - int response[]; - - // Get raw data - response = new int[numInts]; - for (int i = 0; i < numInts; i++) { - response[i] = p.readInt(); - } - //gsm - response[0] &= 0xff; - //cdma - response[2] %= 256; - response[4] %= 256; - response[7] &= 0xff; - - return new SignalStrength(response[0], response[1], response[2], response[3], response[4], response[5], response[6], response[7], response[8], response[9], response[10], response[11], true); - - } - - @Override - protected void notifyRegistrantsCdmaInfoRec(CdmaInformationRecords infoRec) { - final int response = RIL_UNSOL_CDMA_INFO_REC; - - if (infoRec.record instanceof CdmaSignalInfoRec) { - CdmaSignalInfoRec rec = (CdmaSignalInfoRec) infoRec.record; - if (rec != null - && rec.isPresent - && rec.signalType == SignalToneUtil.IS95_CONST_IR_SIGNAL_IS54B - && rec.alertPitch == SignalToneUtil.IS95_CONST_IR_ALERT_MED - && rec.signal == SignalToneUtil.IS95_CONST_IR_SIG_IS54B_L) { - /* Drop record, otherwise IS95_CONST_IR_SIG_IS54B_L tone will - * continue to play after the call is connected */ - return; - } - } - super.notifyRegistrantsCdmaInfoRec(infoRec); - } -} diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index b1e8cef..d824d9e 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -30,7 +30,7 @@ import init.qcom.usb.rc import init.target.rc on early-init - export LD_SHIM_LIBS /system/lib/hw/camera.vendor.msm8974.so|libshim_camera.so + export LD_SHIM_LIBS /system/lib/hw/camera.vendor.msm8974.so|libshim_camera.so:/system/lib/libcutils.so|libshim_cutils_atomic.so mount debugfs debugfs /sys/kernel/debug chmod 0755 /sys/kernel/debug @@ -928,15 +928,6 @@ service macloader /system/bin/macloader oneshot seclabel u:r:macloader:s0 -service ril-daemon /system/bin/rild - class main - socket rild stream 660 root radio - socket sap_uim_socket1 stream 660 bluetooth bluetooth - socket rild-debug stream 660 radio system - socket rild-cas stream 660 casdrm mmb - user root - group radio cache inet misc audio log system wakelock qcom_diag - on property:wlan.driver.status=ok start macloader diff --git a/system.prop b/system.prop index 7007a84..7a92e41 100644 --- a/system.prop +++ b/system.prop @@ -51,7 +51,6 @@ persist.radio.add_power_save=1 rild.libpath=/system/vendor/lib/libsec-ril.so ro.telephony.mms_data_profile=5 ro.ril.telephony.mqanelements=6 -ro.telephony.ril_class=KlteRIL # Ril sends only one RIL_UNSOL_CALL_RING, so set call_ring.multiple to false ro.telephony.call_ring.multiple=0