Skip to content

Commit

Permalink
Remap MSM8660 stock unsolicited RIL responses
Browse files Browse the repository at this point in the history
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
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 1 deletion.
3 changes: 3 additions & 0 deletions BoardConfigCommon.mk
Expand Up @@ -80,6 +80,9 @@ TARGET_RECOVERY_FSTAB := device/samsung/msm8660-common/rootdir/etc/fstab.qcom
# Releasetools
TARGET_RELEASETOOLS_EXTENSIONS := device/samsung/msm8660-common

# RIL
BOARD_RIL_CLASS := ../../../device/samsung/msm8660-common/ril

# SELinux
BOARD_SEPOLICY_DIRS += \
device/samsung/msm8660-common/sepolicy
Expand Down
2 changes: 1 addition & 1 deletion msm8660.mk
Expand Up @@ -66,7 +66,7 @@ PRODUCT_PROPERTY_OVERRIDES += \

# RIL Class
PRODUCT_PROPERTY_OVERRIDES += \
ro.telephony.ril_class=SamsungQualcommRIL
ro.telephony.ril_class=SamsungMSM8660RIL

# Ramdisk
PRODUCT_PACKAGES += \
Expand Down
@@ -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);
}

}

0 comments on commit 17c3efc

Please sign in to comment.