Update ril

This commit is contained in:
Valera1978 2016-01-14 11:52:42 +03:00
parent 44673fb448
commit 31665bcf4b
2 changed files with 146 additions and 110 deletions

View File

@ -107,12 +107,6 @@
<item>"wifi_p2p,13,1,0,-1,true"</item>
</string-array>
<!-- This device is "voice capable". -->
<bool name="config_voice_capable">true</bool>
<!-- This device does allow sms service. -->
<bool name="config_sms_capable">true</bool>
<!-- An Array of "[ConnectivityManager connectionType],
[# simultaneous connection types]" -->
<string-array translatable="false" name="radioAttributes">
@ -267,6 +261,24 @@
The default is false. -->
<bool name="config_lidControlsSleep">true</bool>
<!-- Configure wifi tcp buffersizes in the form:
rmem_min,rmem_def,rmem_max,wmem_min,wmem_def,wmem_max -->
<string name="config_wifi_tcp_buffers" translatable="false">524288,2097152,4194304,262144,524288,1048576</string>
<string-array name="config_mobile_tcp_buffers">
<item>"lte:2097152,4194304,8388608,262144,524288,1048576"</item>
<item>"lte_ca:2097152,4194304,8388608,262144,524288,1048576"</item>
<item>"umts:4094,87380,1220608,4096,16384,1220608"</item>
<item>"hspa:4094,87380,1220608,4096,16384,1220608"</item>
<item>"hsupa:4094,87380,1220608,4096,16384,1220608"</item>
<item>"hsdpa:4094,87380,2441216,4096,16384,2441216"</item>
<item>"hspap:4094,87380,1220608,4096,16384,1220608"</item>
<item>"edge:4093,26280,35040,4096,16384,35040"</item>
<item>"gprs:4092,8760,11680,4096,8760,11680"</item>
<item>"evdo:4094,87380,1048576,4096,16384,262144"</item>
<item>"ehrpd:4094,87380,1048576,4096,16384,262144"</item>
</string-array>
<!-- Boolean to enable stylus gestures -->
<bool name="config_stylusGestures">true</bool>

View File

@ -1,8 +1,5 @@
/*
* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright (C) 2006 The Android Open Source Project
* Copyright (c) 2014, The CyanogenMod Project. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -22,35 +19,41 @@ package com.android.internal.telephony;
import static com.android.internal.telephony.RILConstants.*;
import android.content.Context;
import android.media.AudioManager;
import android.telephony.Rlog;
import android.os.AsyncResult;
import android.os.Message;
import android.os.Parcel;
import android.os.SystemProperties;
import android.telephony.PhoneNumberUtils;
import android.telephony.Rlog;
import android.telephony.SignalStrength;
import java.io.IOException;
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 java.util.ArrayList;
import java.util.Collections;
import com.android.internal.telephony.uicc.IccCardApplicationStatus;
import com.android.internal.telephony.uicc.IccCardStatus;
/**
* RIL customization for tabpro LTE devices
* RIL customization for Galaxy Note Pro 12.2 LTE
*
* {@hide}
*/
public class TabproLteRIL extends RIL {
private static final int RIL_REQUEST_DIAL_EMERGENCY = 10016;
private static final int RIL_REQUEST_DIAL_EMERGENCY = 10001;
private static final int RIL_UNSOL_ON_SS_LL = 11055;
private final AudioManager mAudioManager;
private boolean mIsGsm = false;
public TabproLteRIL(Context context, int networkMode, int cdmaSubscription, Integer instanceId) {
super(context, networkMode, cdmaSubscription, instanceId);
mAudioManager = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);
public TabproLteRIL(Context context, int networkMode, int cdmaSubscription) {
super(context, networkMode, cdmaSubscription, null);
mQANElements = 6;
}
public TabproLteRIL(Context context, int preferredNetworkType,
int cdmaSubscription, Integer instanceId) {
super(context, preferredNetworkType, cdmaSubscription, instanceId);
mQANElements = 6;
}
@ -87,7 +90,7 @@ public class TabproLteRIL extends RIL {
@Override
protected Object
responseIccCardStatus(Parcel p) {
IccCardApplicationStatus appStatus;
IccCardApplicationStatus appStatus = null;
IccCardStatus cardStatus = new IccCardStatus();
cardStatus.setCardState(p.readInt());
@ -114,7 +117,6 @@ public class TabproLteRIL extends RIL {
appStatus.pin1_replaced = p.readInt();
appStatus.pin1 = appStatus.PinStateFromRILInt(p.readInt());
appStatus.pin2 = appStatus.PinStateFromRILInt(p.readInt());
// All subsequent readInt()s added for our device
p.readInt(); // pin1_num_retries
p.readInt(); // puk1_num_retries
p.readInt(); // pin2_num_retries
@ -123,6 +125,40 @@ public class TabproLteRIL extends RIL {
cardStatus.mApplications[i] = appStatus;
}
// For Sprint LTE only SIM
if (appStatus != null
&& numApplications == 1
&& !mIsGsm
&& appStatus.app_type == appStatus.AppTypeFromRILInt(2)) {
cardStatus.mApplications = new IccCardApplicationStatus[3];
cardStatus.mApplications[0] = appStatus;
cardStatus.mGsmUmtsSubscriptionAppIndex = 0;
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;
}
@ -146,7 +182,6 @@ public class TabproLteRIL extends RIL {
dc = new DriverCall();
dc.state = DriverCall.stateFromCLCC(p.readInt());
// & 0xff to truncate to 1 byte added for us, not in RIL.java
dc.index = p.readInt() & 0xff;
dc.TOA = p.readInt();
dc.isMpty = (0 != p.readInt());
@ -154,7 +189,6 @@ public class TabproLteRIL extends RIL {
dc.als = p.readInt();
voiceSettings = p.readInt();
dc.isVoice = (0 != voiceSettings);
boolean isVideo = (0 != p.readInt());
int call_type = p.readInt(); // Samsung CallDetails
int call_domain = p.readInt(); // Samsung CallDetails
String csv = p.readString(); // Samsung CallDetails
@ -163,7 +197,7 @@ public class TabproLteRIL extends RIL {
int np = p.readInt();
dc.numberPresentation = DriverCall.presentationFromCLIP(np);
dc.name = p.readString();
dc.namePresentation = p.readInt();
dc.namePresentation = DriverCall.presentationFromCLIP(p.readInt());
int uusInfoPresent = p.readInt();
if (uusInfoPresent == 1) {
dc.uusInfo = new UUSInfo();
@ -226,7 +260,6 @@ public class TabproLteRIL extends RIL {
int lteCqi = p.readInt();
int tdScdmaRscp = p.readInt();
// constructor sets default true, makeSignalStrengthFromRilParcel does not set it
boolean isGsm = true;
if ((lteSignalStrength & 0xff) == 255 || lteSignalStrength == 99) {
lteSignalStrength = 99;
@ -244,53 +277,89 @@ public class TabproLteRIL extends RIL {
" evdoEcio: " + evdoEcio + " evdoSnr:" + evdoSnr +
" lteSignalStrength:" + lteSignalStrength + " lteRsrp:" + lteRsrp +
" lteRsrq:" + lteRsrq + " lteRssnr:" + lteRssnr + " lteCqi:" + lteCqi +
" tdScdmaRscp:" + tdScdmaRscp + " isGsm:" + (isGsm ? "true" : "false"));
" tdScdmaRscp:" + tdScdmaRscp + " isGsm:" + (mIsGsm ? "true" : "false"));
return new SignalStrength(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio, evdoDbm,
evdoEcio, evdoSnr, lteSignalStrength, lteRsrp, lteRsrq, lteRssnr, lteCqi,
tdScdmaRscp, isGsm);
tdScdmaRscp, mIsGsm);
}
@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);
}
@Override
public void setPhoneType(int phoneType) {
super.setPhoneType(phoneType);
mIsGsm = (phoneType != RILConstants.CDMA_PHONE);
}
@Override
protected void
processUnsolicited (Parcel p) {
Object ret;
int dataPosition = p.dataPosition(); // save off position within the Parcel
int dataPosition = p.dataPosition();
int response = p.readInt();
int newResponse = response;
switch(response) {
// SAMSUNG STATES
case 11010: // RIL_UNSOL_AM:
ret = responseString(p);
String amString = (String) ret;
Rlog.d(RILJ_LOG_TAG, "Executing AM: " + amString);
try {
Runtime.getRuntime().exec("am " + amString);
} catch (IOException e) {
e.printStackTrace();
Rlog.e(RILJ_LOG_TAG, "am " + amString + " could not be executed.");
case RIL_UNSOL_ON_SS_LL:
newResponse = RIL_UNSOL_ON_SS;
break;
}
if (newResponse != response) {
p.setDataPosition(dataPosition);
p.writeInt(newResponse);
}
break;
case 11021: // RIL_UNSOL_RESPONSE_HANDOVER:
ret = responseVoid(p);
break;
case 1036:
ret = responseVoid(p);
break;
case 11017: // RIL_UNSOL_WB_AMR_STATE:
ret = responseInts(p);
setWbAmr(((int[])ret)[0]);
break;
default:
// Rewind the Parcel
p.setDataPosition(dataPosition);
// Forward responses that we are not overriding to the super class
super.processUnsolicited(p);
return;
}
@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);
}
private void
dialEmergencyCall(String address, int clirMode, Message result) {
RILRequest rr;
rr = RILRequest.obtain(RIL_REQUEST_DIAL_EMERGENCY, result);
rr.mParcel.writeString(address);
rr.mParcel.writeInt(clirMode);
rr.mParcel.writeInt(0); // CallDetails.call_type
rr.mParcel.writeInt(3); // CallDetails.call_domain
rr.mParcel.writeString(""); // CallDetails.getCsvFromExtra
rr.mParcel.writeInt(0); // Unknown
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
send(rr);
}
@Override
@ -351,27 +420,9 @@ public class TabproLteRIL extends RIL {
return rr;
}
private void
dialEmergencyCall(String address, int clirMode, Message result) {
RILRequest rr;
Rlog.v(RILJ_LOG_TAG, "Emergency dial: " + address);
rr = RILRequest.obtain(RIL_REQUEST_DIAL_EMERGENCY, result);
rr.mParcel.writeString(address + "/");
rr.mParcel.writeInt(clirMode);
rr.mParcel.writeInt(0); // CallDetails.call_type
rr.mParcel.writeInt(3); // CallDetails.call_domain
rr.mParcel.writeString(""); // CallDetails.getCsvFromExtra
rr.mParcel.writeInt(0); // Unknown
if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
send(rr);
}
private Object
responseDataRegistrationState(Parcel p) {
String response[] = (String[])responseStrings(p); // all data from parcell get popped
String response[] = (String[])responseStrings(p);
/* DANGER WILL ROBINSON
* In some cases from Vodaphone we are receiving a RAT of 102
* while in tunnels of the metro. Lets Assume that if we
@ -383,31 +434,4 @@ public class TabproLteRIL extends RIL {
}
return response;
}
/**
* Set audio parameter "wb_amr" for HD-Voice (Wideband AMR).
*
* @param state: 0 = unsupported, 1 = supported.
*/
private void setWbAmr(int state) {
if (state == 1) {
Rlog.d(RILJ_LOG_TAG, "setWbAmr(): setting audio parameter - wb_amr=on");
mAudioManager.setParameters("wide_voice_enable=true");
}else if (state == 0) {
Rlog.d(RILJ_LOG_TAG, "setWbAmr(): setting audio parameter - wb_amr=off");
mAudioManager.setParameters("wide_voice_enable=false");
}
}
private void logParcel(Parcel p) {
StringBuffer s = new StringBuffer();
byte [] bytes = p.marshall();
for (int i = 0; i < bytes.length; i++) {
if (i > 0) s.append(" ");
if (i == p.dataPosition()) s.append("*** ");
s.append(bytes[i]);
}
riljLog("parcel position=" + p.dataPosition() + ": " + s);
}
}