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

Commit ab4dd938 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

Merge "TD-SCDMA signal strength support for Samsung Qualcomm device." into cm-10.2

parents 4dcf1d2d 62978cc8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ public class SamsungQualcommRIL extends QualcommMSIM42RIL implements CommandsInt
    private boolean oldRilState = needsOldRilFeature("exynos4RadioState");
    private boolean googleEditionSS = needsOldRilFeature("googleEditionSS");
    private boolean driverCall = needsOldRilFeature("newDriverCall");
    private boolean hasTdScdmaSignalStrength = needsOldRilFeature("TdScdmaSignalStrength");
    private String[] lastKnownOfGood = {null, null, null};
    public SamsungQualcommRIL(Context context, int networkMode,
            int cdmaSubscription) {
@@ -186,8 +187,7 @@ public class SamsungQualcommRIL extends QualcommMSIM42RIL implements CommandsInt

    @Override
    protected Object responseSignalStrength(Parcel p) {
        boolean isTdScdma = SystemProperties.get(TelephonyProperties.PROPERTY_DATA_NETWORK_TYPE).equals("TD-SCDMA");
        int numInts = isTdScdma ? 13 : 12;
        int numInts = hasTdScdmaSignalStrength ? 13 : 12;
        int response[];

        // This is a mashup of algorithms used in
@@ -220,7 +220,7 @@ public class SamsungQualcommRIL extends QualcommMSIM42RIL implements CommandsInt
        }else{ // lte is gsm on samsung/qualcomm cdma stack
            response[7] &= 0xff;
        }
        return isTdScdma ? new SignalStrength(response[0], response[1], response[2], response[3], response[4], response[5], response[6], response[7], response[8], response[9], response[10], response[11], response[12], (p.readInt() != 0)) :
        return hasTdScdmaSignalStrength ? new SignalStrength(response[0], response[1], response[2], response[3], response[4], response[5], response[6], response[7], response[8], response[9], response[10], response[11], response[12], (p.readInt() != 0)) :
            new SignalStrength(response[0], response[1], response[2], response[3], response[4], response[5], response[6], response[7], response[8], response[9], response[10], response[11], (p.readInt() != 0));
    }