summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRicardo Cerqueira <github@cerqueira.org>2012-03-17 00:03:33 +0000
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-01-31 23:28:59 +0000
commitbc3688674fbfc1a079adbef7cd3d0e1f501cae0c (patch)
tree41e5ca528ff061146025636ea3eb613edb2dea8a /src
parent5343f09644650fae7708337eb55788f3d20aabb0 (diff)
downloadframeworks_opt_telephony-bc3688674fbfc1a079adbef7cd3d0e1f501cae0c.zip
frameworks_opt_telephony-bc3688674fbfc1a079adbef7cd3d0e1f501cae0c.tar.gz
frameworks_opt_telephony-bc3688674fbfc1a079adbef7cd3d0e1f501cae0c.tar.bz2
LGEQualcommUiccRIL: New subclass to deal with the latest qcom RIL
Yet another generation of CAF RIL, this one is necessary to support multi-RAT (GSM/LTE) radios... Change-Id: I87b5126ffbc16f3ccc7caaf227354edf95543c35 LGEQualcommUiccRIL: Fix LTE support Change-Id: Ifab51550113926d6d1b6c421e805f456d95faca8 LGEQualcommUiccRIL: Fix multi-PDP support Multiple concurrent PDPs are now functional, allowing the back-compat singlepdp flag to be disabled Change-Id: I8ef55e96b9f05d4a4dd8dbbaeddf6d48ded7fc67 Update to 4.2 APIs
Diffstat (limited to 'src')
-rw-r--r--src/java/com/android/internal/telephony/LGEQualcommUiccRIL.java190
1 files changed, 190 insertions, 0 deletions
diff --git a/src/java/com/android/internal/telephony/LGEQualcommUiccRIL.java b/src/java/com/android/internal/telephony/LGEQualcommUiccRIL.java
new file mode 100644
index 0000000..d1bb24a
--- /dev/null
+++ b/src/java/com/android/internal/telephony/LGEQualcommUiccRIL.java
@@ -0,0 +1,190 @@
+/*
+ * Copyright (C) 2012 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.Message;
+import android.os.Parcel;
+import android.os.SystemProperties;
+import android.telephony.SignalStrength;
+import android.text.TextUtils;
+import android.util.Log;
+
+import java.util.ArrayList;
+
+/**
+ * Custom Qualcomm No SimReady RIL for LGE using the latest Uicc stack
+ *
+ * {@hide}
+ */
+public class LGEQualcommUiccRIL extends QualcommSharedRIL implements CommandsInterface {
+ boolean RILJ_LOGV = true;
+ boolean RILJ_LOGD = true;
+
+ public LGEQualcommUiccRIL(Context context, int networkMode, int cdmaSubscription) {
+ super(context, networkMode, cdmaSubscription);
+ }
+
+ /*
+ @Override
+ public void
+ setupDataCall(String radioTechnology, String profile, String apn,
+ String user, String password, String authType, String protocol,
+ Message result) {
+
+ RILRequest rrSPT = RILRequest.obtain(
+ 121, null); //121 - RIL_REQUEST_VSS_SET_PDN_TABLE
+ rrSPT.mp.writeInt(1); // pdnId
+ rrSPT.mp.writeInt(apn.length()); // apnLength
+ rrSPT.mp.writeString(apn); // apn
+ rrSPT.mp.writeInt(0); // ipType
+ rrSPT.mp.writeInt(0); // inactivityTime
+ rrSPT.mp.writeInt(1); // enable
+ send(rrSPT);
+
+
+
+ RILRequest rr
+ = RILRequest.obtain(RIL_REQUEST_SETUP_DATA_CALL, result);
+
+ rr.mp.writeInt(7);
+
+ rr.mp.writeString(radioTechnology);
+ rr.mp.writeString(profile);
+ rr.mp.writeString(apn);
+ rr.mp.writeString(user);
+ rr.mp.writeString(password);
+ rr.mp.writeString(authType);
+ rr.mp.writeString(protocol);
+
+ if (RILJ_LOGD) riljLog(rr.serialString() + "> "
+ + requestToString(rr.mRequest) + " " + radioTechnology + " "
+ + profile + " " + apn + " " + user + " "
+ + password + " " + authType + " " + protocol);
+
+ send(rr);
+ }
+ */
+
+ @Override
+ protected Object
+ responseSetupDataCall(Parcel p) {
+ DataCallState dataCall;
+
+ boolean oldRil = needsOldRilFeature("datacall");
+
+ if (!oldRil)
+ return super.responseSetupDataCall(p);
+
+ p.readString();
+ return super.responseSetupDataCall(p);
+
+ }
+ @Override
+ protected Object
+ responseIccCardStatus(Parcel p) {
+ IccCardApplicationStatus ca;
+
+ IccCardStatus status = new IccCardStatus();
+ status.setCardState(p.readInt());
+ status.setUniversalPinState(p.readInt());
+ status.mGsmUmtsSubscriptionAppIndex = p.readInt();
+ status.mCdmaSubscriptionAppIndex = p.readInt();
+
+ status.mImsSubscriptionAppIndex = p.readInt();
+
+ int numApplications = p.readInt();
+
+ // limit to maximum allowed applications
+ if (numApplications > IccCardStatus.CARD_MAX_APPS) {
+ numApplications = IccCardStatus.CARD_MAX_APPS;
+ }
+ status.mApplications = new IccCardApplicationStatus[numApplications];
+
+
+ for (int i = 0; i < numApplications; i++) {
+ ca = new IccCardApplicationStatus();
+ ca.app_type = ca.AppTypeFromRILInt(p.readInt());
+ ca.app_state = ca.AppStateFromRILInt(p.readInt());
+ ca.perso_substate = ca.PersoSubstateFromRILInt(p.readInt());
+ ca.aid = p.readString();
+ ca.app_label = p.readString();
+ ca.pin1_replaced = p.readInt();
+ ca.pin1 = ca.PinStateFromRILInt(p.readInt());
+ ca.pin2 = ca.PinStateFromRILInt(p.readInt());
+ p.readInt(); //remaining_count_pin1
+ p.readInt(); //remaining_count_puk1
+ p.readInt(); //remaining_count_pin2
+ p.readInt(); //remaining_count_puk2
+ status.mApplications[i] = ca;
+ }
+ int appIndex = -1;
+ if (mPhoneType == RILConstants.CDMA_PHONE) {
+ appIndex = status.mCdmaSubscriptionAppIndex;
+ Log.d(LOG_TAG, "This is a CDMA PHONE " + appIndex);
+ } else {
+ appIndex = status.mGsmUmtsSubscriptionAppIndex;
+ Log.d(LOG_TAG, "This is a GSM PHONE " + appIndex);
+ }
+
+ if (numApplications > 0) {
+ IccCardApplicationStatus application = status.mApplications[appIndex];
+ mAid = application.aid;
+ mUSIM = application.app_type
+ == IccCardApplicationStatus.AppType.APPTYPE_USIM;
+ mSetPreferredNetworkType = mPreferredNetworkType;
+
+ if (TextUtils.isEmpty(mAid))
+ mAid = "";
+ Log.d(LOG_TAG, "mAid " + mAid);
+ }
+
+ return status;
+ }
+
+ @Override
+ protected Object
+ responseSignalStrength(Parcel p) {
+ int numInts = 12;
+ int response[];
+
+ boolean oldRil = needsOldRilFeature("signalstrength");
+ boolean noLte = false;
+
+ /* TODO: Add SignalStrength class to match RIL_SignalStrength */
+ response = new int[numInts];
+ for (int i = 0 ; i < numInts ; i++) {
+ if ((oldRil || noLte) && i > 6 && i < 12) {
+ response[i] = -1;
+ } else {
+ response[i] = p.readInt();
+ }
+ if (i == 7 && response[i] == 99) {
+ response[i] = -1;
+ noLte = true;
+ }
+ if (i == 8 && !(noLte || oldRil)) {
+ response[i] *= -1;
+ }
+ }
+
+ 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);
+ }
+
+}