Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remap MSM8660 stock unsolicited RIL responses
The proprietary RIL produces responses that are either obsolete (and shold be ignored) or do not match their corresponding values in frameworks/base/telephony/java/com/android/internal/telephony/RILConstants.java. This patch remaps the mismatched response types and ignores the obsolete ones. Change-Id: Iecfe6c07f6566a40c7c7893988ffa0bd28bf34e4
- Loading branch information
gh2o
committed
Oct 26, 2014
1 parent
9a42511
commit 17c3efc
Showing
3 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
ril/telephony/java/com/android/internal/telephony/SamsungMSM8660RIL.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* 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.Parcel; | ||
|
||
/** | ||
* RIL for devices in the Samsung MSM8660 family. | ||
* This class contains workarounds for various things. | ||
* {@hide} | ||
*/ | ||
public class SamsungMSM8660RIL extends SamsungQualcommRIL { | ||
|
||
public SamsungMSM8660RIL(Context context, int networkMode, int cdmaSubscription) { | ||
super(context, networkMode, cdmaSubscription); | ||
} | ||
|
||
@Override | ||
protected void | ||
processUnsolicited(Parcel p) { | ||
int dataPosition = p.dataPosition(); | ||
int origResponse = p.readInt(); | ||
int newResponse = origResponse; | ||
switch (origResponse) { | ||
case 1036: | ||
newResponse = RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED; | ||
break; | ||
case 1039: | ||
newResponse = RIL_UNSOL_ON_SS; | ||
break; | ||
case 1040: | ||
newResponse = RIL_UNSOL_STK_CC_ALPHA_NOTIFY; | ||
break; | ||
case 1041: | ||
newResponse = RIL_UNSOL_UICC_SUBSCRIPTION_STATUS_CHANGED; | ||
break; | ||
case 1037: // RIL_UNSOL_TETHERED_MODE_STATE_CHANGED | ||
case 1038: // RIL_UNSOL_DATA_NETWORK_STATE_CHANGED | ||
case 1042: // RIL_UNSOL_QOS_STATE_CHANGED_IND | ||
riljLog("SamsungMSM8660RIL: ignoring unsolicited response " + | ||
origResponse); | ||
return; | ||
} | ||
if (newResponse != origResponse) { | ||
riljLog("SamsungMSM8660RIL: remap unsolicited response from " + | ||
origResponse + " to " + newResponse); | ||
p.setDataPosition(dataPosition); | ||
p.writeInt(newResponse); | ||
} | ||
p.setDataPosition(dataPosition); | ||
super.processUnsolicited(p); | ||
} | ||
|
||
} |