Bug 734299 - Part 1: Detect a datacall quirk on the SGS2. r=qDot

This commit is contained in:
Philipp von Weitershausen 2012-03-12 16:45:57 -07:00
Родитель 44e71eb2ed
Коммит d9e50025e7
1 изменённых файлов: 18 добавлений и 5 удалений

Просмотреть файл

@ -76,6 +76,7 @@ const UINT32_SIZE = 4;
const PARCEL_SIZE_SIZE = UINT32_SIZE;
let RILQUIRKS_CALLSTATE_EXTRA_UINT32 = false;
let RILQUIRKS_DATACALLSTATE_DOWN_IS_UP = false;
/**
* This object contains helpers buffering incoming data & deconstructing it
@ -553,17 +554,26 @@ let RIL = {
/**
* Set quirk flags based on the RIL model detected. Note that this
* requires the RIL being "warmed up" first, which happens when on
* an incoming or outgoing call.
* an incoming or outgoing voice call or data call.
*/
rilQuirksInitialized: false,
initRILQuirks: function initRILQuirks() {
if (this.rilQuirksInitialized) {
return;
}
// The Samsung Galaxy S2 I-9100 radio sends an extra Uint32 in the
// call state.
let model_id = libcutils.property_get("ril.model_id");
if (DEBUG) debug("Detected RIL model " + model_id);
if (model_id == "I9100") {
if (DEBUG) debug("Enabling RILQUIRKS_CALLSTATE_EXTRA_UINT32 for I9100.");
if (DEBUG) {
debug("Detected I9100, enabling " +
"RILQUIRKS_CALLSTATE_EXTRA_UINT32, " +
"RILQUIRKS_DATACALLSTATE_DOWN_IS_UP.");
}
RILQUIRKS_CALLSTATE_EXTRA_UINT32 = true;
RILQUIRKS_DATACALLSTATE_DOWN_IS_UP = true;
}
this.rilQuirksInitialized = true;
@ -1045,9 +1055,7 @@ RIL[REQUEST_CHANGE_SIM_PIN] = function REQUEST_CHANGE_SIM_PIN() {
RIL[REQUEST_CHANGE_SIM_PIN2] = null;
RIL[REQUEST_ENTER_NETWORK_DEPERSONALIZATION] = null;
RIL[REQUEST_GET_CURRENT_CALLS] = function REQUEST_GET_CURRENT_CALLS(length) {
if (!this.rilQuirksInitialized) {
this.initRILQuirks();
}
this.initRILQuirks();
let calls_length = 0;
// The RIL won't even send us the length integer if there are no active calls.
@ -1221,6 +1229,8 @@ RIL[REQUEST_GET_MUTE] = null;
RIL[REQUEST_QUERY_CLIP] = null;
RIL[REQUEST_LAST_DATA_CALL_FAIL_CAUSE] = null;
RIL[REQUEST_DATA_CALL_LIST] = function REQUEST_DATA_CALL_LIST(length) {
this.initRILQuirks();
let num = 0;
if (length) {
num = Buf.readUint32();
@ -2036,6 +2046,9 @@ let Phone = {
break;
case DATACALL_ACTIVE_DOWN:
newDataCall.state = GECKO_NETWORK_STATE_SUSPENDED;
if (RILQUIRKS_DATACALLSTATE_DOWN_IS_UP) {
newDataCall.state = GECKO_NETWORK_STATE_CONNECTED;
}
break;
case DATACALL_ACTIVE_UP:
newDataCall.state = GECKO_NETWORK_STATE_CONNECTED;