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

Commit f370441d authored by jt1134's avatar jt1134
Browse files

fascinate: fix DriverCall to match Samsung libril

Change-Id: I8a4b515248c878ef2d037201e0d1ae3037c616ad
parent 70cb78d9
Loading
Loading
Loading
Loading
+27 −2
Original line number 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 mIsSamsungCdma = SystemProperties.getBoolean("ro.ril.samsung_cdma", false);

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

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

                dc.state = DriverCall.stateFromCLCC(p.readInt());
@@ -782,5 +787,25 @@ public SamsungRIL(Context context, int networkMode, int cdmaSubscription) {
	        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;
        }
    }
}