Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b29e308d authored by Koushik Dutta's avatar Koushik Dutta Committed by Gerrit Code Review
Browse files

Merge changes I8a4b5152,Id46c31bf into gingerbread

* changes:
  fascinate: fix DriverCall to match Samsung libril
  fascinate: fix parsing of incoming sms' messageId
parents 4037deda f370441d
Loading
Loading
Loading
Loading
+27 −2
Original line number Original line Diff line number Diff line
@@ -33,6 +33,8 @@ public class SamsungRIL extends RIL implements CommandsInterface {


	private boolean mSignalbarCount = SystemProperties.getInt("ro.telephony.sends_barcount", 0) == 1 ? true : false;
	private boolean mSignalbarCount = SystemProperties.getInt("ro.telephony.sends_barcount", 0) == 1 ? true : false;


	private boolean mIsSamsungCdma = SystemProperties.getBoolean("ro.ril.samsung_cdma", false);

public SamsungRIL(Context context) {
public SamsungRIL(Context context) {
		super(context);
		super(context);
	}
	}
@@ -679,6 +681,9 @@ public SamsungRIL(Context context, int networkMode, int cdmaSubscription) {
            response = new ArrayList<DriverCall>(num);
            response = new ArrayList<DriverCall>(num);


            for (int i = 0 ; i < num ; i++) {
            for (int i = 0 ; i < num ; i++) {
                if (mIsSamsungCdma)
                    dc = new SamsungDriverCall();
                else
                    dc = new DriverCall();
                    dc = new DriverCall();


                dc.state = DriverCall.stateFromCLCC(p.readInt());
                dc.state = DriverCall.stateFromCLCC(p.readInt());
@@ -782,5 +787,25 @@ public SamsungRIL(Context context, int networkMode, int cdmaSubscription) {
	        return response;
	        return response;
	    }
	    }



    protected class SamsungDriverCall extends DriverCall {
        @Override
        public String
        toString() {
            // Samsung CDMA devices' call parcel is formatted differently
            // fake unused data for video calls, and fix formatting
            // so that voice calls' information can be correctly parsed
            return "id=" + index + ","
                    + state + ","
                    + "toa=" + TOA + ","
                    + (isMpty ? "conf" : "norm") + ","
                    + (isMT ? "mt" : "mo") + ","
                    + "als=" + als + ","
                    + (isVoice ? "voc" : "nonvoc") + ","
                    + "nonvid" + ","
                    + number + ","
                    + "cli=" + numberPresentation + ","
                    + "name=" + name + ","
                    + namePresentation;
        }
    }
}
}
+15 −4
Original line number Original line Diff line number Diff line
@@ -20,6 +20,8 @@ import static android.telephony.SmsMessage.ENCODING_16BIT;
import static android.telephony.SmsMessage.MAX_USER_DATA_BYTES;
import static android.telephony.SmsMessage.MAX_USER_DATA_BYTES;
import static android.telephony.SmsMessage.MAX_USER_DATA_BYTES_WITH_HEADER;
import static android.telephony.SmsMessage.MAX_USER_DATA_BYTES_WITH_HEADER;


import android.os.SystemProperties;

import android.util.Log;
import android.util.Log;


import android.telephony.SmsMessage;
import android.telephony.SmsMessage;
@@ -876,11 +878,20 @@ public final class BearerData {
            paramBits -= EXPECTED_PARAM_SIZE;
            paramBits -= EXPECTED_PARAM_SIZE;
            decodeSuccess = true;
            decodeSuccess = true;
            bData.messageType = inStream.read(4);
            bData.messageType = inStream.read(4);
            // Samsung Fascinate parses messageId differently than other devices
            // fix it here so that incoming sms works correctly
            if ("fascinatemtd".equals(SystemProperties.get("ro.product.device"))) {
                inStream.skip(4);
                bData.messageId = inStream.read(8) << 8;
                bData.messageId |= inStream.read(8);
                bData.hasUserDataHeader = (inStream.read(8) == 1);
            } else {
                bData.messageId = inStream.read(8) << 8;
                bData.messageId = inStream.read(8) << 8;
                bData.messageId |= inStream.read(8);
                bData.messageId |= inStream.read(8);
                bData.hasUserDataHeader = (inStream.read(1) == 1);
                bData.hasUserDataHeader = (inStream.read(1) == 1);
                inStream.skip(3);
                inStream.skip(3);
            }
            }
        }
        if ((! decodeSuccess) || (paramBits > 0)) {
        if ((! decodeSuccess) || (paramBits > 0)) {
            Log.d(LOG_TAG, "MESSAGE_IDENTIFIER decode " +
            Log.d(LOG_TAG, "MESSAGE_IDENTIFIER decode " +
                      (decodeSuccess ? "succeeded" : "failed") +
                      (decodeSuccess ? "succeeded" : "failed") +