aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Pasanen <dan.pasanen@gmail.com>2015-11-21 04:20:37 -0600
committerDan Pasanen <invisiblek@cyanogenmod.org>2015-12-10 15:19:50 -0800
commitf06f34d0b526dfb4d2e482b633fb8e13dd6e9ddf (patch)
treeeba14b4741ef412942d690a2b3c88c883707af53
parenta9e3572f43a1b3d4a8b3c6b424f33667d3901dd4 (diff)
ls990: add custom ril class
Change-Id: I3d81000ca1241c24870e00c0477de0c5d8dc63e2
-rw-r--r--BoardConfig.mk3
-rw-r--r--ril/telephony/java/com/android/internal/telephony/LgeLteRIL.java118
-rw-r--r--system.prop1
3 files changed, 122 insertions, 0 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 6dd4faf..5172515 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -38,6 +38,9 @@ TARGET_USERIMAGES_USE_F2FS := true
# Recovery
TARGET_RECOVERY_FSTAB := device/lge/ls990/rootdir/etc/fstab.g3
+# RIL
+BOARD_RIL_CLASS := ../../../device/lge/ls990/ril/
+
# NFC
BOARD_NFC_CHIPSET := pn544
diff --git a/ril/telephony/java/com/android/internal/telephony/LgeLteRIL.java b/ril/telephony/java/com/android/internal/telephony/LgeLteRIL.java
new file mode 100644
index 0000000..4b7e8f4
--- /dev/null
+++ b/ril/telephony/java/com/android/internal/telephony/LgeLteRIL.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2014 The CyanogenMod 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 static com.android.internal.telephony.RILConstants.*;
+
+import android.content.Context;
+import android.os.AsyncResult;
+import android.os.Message;
+import android.os.Parcel;
+import android.os.SystemProperties;
+import android.util.Log;
+
+import com.android.internal.telephony.RILConstants;
+
+import com.android.internal.telephony.uicc.IccCardApplicationStatus;
+import com.android.internal.telephony.uicc.IccCardStatus;
+
+/**
+ * Custom Qualcomm RIL for G3
+ *
+ * {@hide}
+ */
+public class LgeLteRIL extends RIL implements CommandsInterface {
+ static final String LOG_TAG = "LgeLteRIL";
+
+ public LgeLteRIL(Context context, int preferredNetworkType,
+ int cdmaSubscription, Integer instanceId) {
+ this(context, preferredNetworkType, cdmaSubscription);
+ }
+
+ public LgeLteRIL(Context context, int networkMode, int cdmaSubscription) {
+ super(context, networkMode, cdmaSubscription);
+ }
+
+ @Override
+ protected Object
+ responseIccCardStatus(Parcel p) {
+ IccCardApplicationStatus appStatus = null;
+
+ 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());
+ int remaining_count_pin1 = p.readInt();
+ int remaining_count_puk1 = p.readInt();
+ int remaining_count_pin2 = p.readInt();
+ int remaining_count_puk2 = p.readInt();
+ cardStatus.mApplications[i] = appStatus;
+ }
+
+ if (numApplications == 1 && appStatus != null
+ && appStatus.app_type == appStatus.AppTypeFromRILInt(2)) {
+ cardStatus.mApplications = new IccCardApplicationStatus[numApplications + 2];
+ cardStatus.mGsmUmtsSubscriptionAppIndex = 0;
+ cardStatus.mApplications[cardStatus.mGsmUmtsSubscriptionAppIndex] = appStatus;
+ cardStatus.mCdmaSubscriptionAppIndex = 1;
+ cardStatus.mImsSubscriptionAppIndex = 2;
+ IccCardApplicationStatus appStatus2 = new IccCardApplicationStatus();
+ appStatus2.app_type = appStatus2.AppTypeFromRILInt(4); // CSIM State
+ appStatus2.app_state = appStatus.app_state;
+ appStatus2.perso_substate = appStatus.perso_substate;
+ appStatus2.aid = appStatus.aid;
+ appStatus2.app_label = appStatus.app_label;
+ appStatus2.pin1_replaced = appStatus.pin1_replaced;
+ appStatus2.pin1 = appStatus.pin1;
+ appStatus2.pin2 = appStatus.pin2;
+ cardStatus.mApplications[cardStatus.mCdmaSubscriptionAppIndex] = appStatus2;
+ IccCardApplicationStatus appStatus3 = new IccCardApplicationStatus();
+ appStatus3.app_type = appStatus3.AppTypeFromRILInt(5); // IMS State
+ appStatus3.app_state = appStatus.app_state;
+ appStatus3.perso_substate = appStatus.perso_substate;
+ appStatus3.aid = appStatus.aid;
+ appStatus3.app_label = appStatus.app_label;
+ appStatus3.pin1_replaced = appStatus.pin1_replaced;
+ appStatus3.pin1 = appStatus.pin1;
+ appStatus3.pin2 = appStatus.pin2;
+ cardStatus.mApplications[cardStatus.mImsSubscriptionAppIndex] = appStatus3;
+ }
+
+ return cardStatus;
+ }
+}
diff --git a/system.prop b/system.prop
index 65772d9..dc329a3 100644
--- a/system.prop
+++ b/system.prop
@@ -8,6 +8,7 @@ ro.cdma.home.operator.alpha=Sprint
telephony.lteOnCdmaDevice=1
telephony.lte.cdma.device=1
ro.telephony.default_network=8
+ro.telephony.ril_class=LgeLteRIL
ro.ril.def.preferred.network=8
ril.subscription.types=NV,RUIM
persist.radio.no_wait_for_card=1