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

Commit 7657b943 authored by Koushik Dutta's avatar Koushik Dutta
Browse files

Add SamsungRIL which overrides RIL. Samsung does a lot of nasty stuff in...

Add SamsungRIL which overrides RIL. Samsung does a lot of nasty stuff in libril.so that prevents usage of the built libril.so.

Change-Id: Ic66e7162ed122a4e8b23c8c415e30c70f85fd250
parent c58ecabc
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.net.LocalServerSocket;
import android.os.Looper;
import android.provider.Settings;
import android.util.Log;
import android.os.SystemProperties;

import com.android.internal.telephony.cdma.CDMAPhone;
import com.android.internal.telephony.gsm.GSMPhone;
@@ -107,7 +108,15 @@ public class PhoneFactory {
                Log.i(LOG_TAG, "Cdma Subscription set to " + Integer.toString(cdmaSubscription));

                //reads the system properties and makes commandsinterface

                String sRILClassname = SystemProperties.get("ro.telephony.ril_class");

                if(sRILClassname == "samsung")
                {
                    sCommandsInterface = new SamsungRIL(context, networkMode, cdmaSubscription);
                } else {
                    sCommandsInterface = new RIL(context, networkMode, cdmaSubscription);
                }

                int phoneType = getPhoneType(networkMode);
                if (phoneType == Phone.PHONE_TYPE_GSM) {
+38 −38
Original line number Diff line number Diff line
@@ -204,8 +204,8 @@ class RILRequest {
 *
 * {@hide}
 */
public final class RIL extends BaseCommands implements CommandsInterface {
    static final String LOG_TAG = "RILJ";
public class RIL extends BaseCommands implements CommandsInterface {
    protected static final String LOG_TAG = "RILJ";
    private static final boolean DBG = false;
    static final boolean RILJ_LOGD = Config.LOGD;
    static final boolean RILJ_LOGV = DBG ? Config.LOGD : Config.LOGV;
@@ -238,7 +238,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
    int mRequestMessagesWaiting;

    // Is this the first radio state change?
    private boolean mInitialRadioStateChange = true;
    protected boolean mInitialRadioStateChange = true;

    //I'd rather this be LinkedList or something
    ArrayList<RILRequest> mRequestsList = new ArrayList<RILRequest>();
@@ -2007,7 +2007,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        sendScreenState(true);
   }

    private RadioState getRadioStateFromInt(int stateInt) {
    protected RadioState getRadioStateFromInt(int stateInt) {
        RadioState state;

        /* RIL_RadioState ril.h */
@@ -2030,7 +2030,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return state;
    }

    private void switchToRadioState(RadioState newState) {
    protected void switchToRadioState(RadioState newState) {

        if (mInitialRadioStateChange) {
            if (newState.isOn()) {
@@ -2085,7 +2085,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    private void
    protected void
    send(RILRequest rr) {
        Message msg;

@@ -2146,7 +2146,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    private RILRequest findAndRemoveRequestFromList(int serial) {
    protected RILRequest findAndRemoveRequestFromList(int serial) {
        synchronized (mRequestsList) {
            for (int i = 0, s = mRequestsList.size() ; i < s ; i++) {
                RILRequest rr = mRequestsList.get(i);
@@ -2163,7 +2163,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return null;
    }

    private void
    protected void
    processSolicited (Parcel p) {
        int serial, error;
        boolean found = false;
@@ -2330,7 +2330,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        rr.release();
    }

    private String
    protected String
    retToString(int req, Object ret) {
        if (ret == null) return "";
        switch (req) {
@@ -2391,7 +2391,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return s;
    }

    private void
    protected void
    processUnsolicited (Parcel p) {
        int response;
        Object ret;
@@ -2740,7 +2740,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    private Object
    protected Object
    responseInts(Parcel p) {
        int numInts;
        int response[];
@@ -2757,12 +2757,12 @@ public final class RIL extends BaseCommands implements CommandsInterface {
    }


    private Object
    protected Object
    responseVoid(Parcel p) {
        return null;
    }

    private Object
    protected Object
    responseCallForward(Parcel p) {
        int numInfos;
        CallForwardInfo infos[];
@@ -2785,7 +2785,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return infos;
    }

    private Object
    protected Object
    responseSuppServiceNotification(Parcel p) {
        SuppServiceNotification notification = new SuppServiceNotification();

@@ -2798,7 +2798,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return notification;
    }

    private Object
    protected Object
    responseCdmaSms(Parcel p) {
        SmsMessage sms;
        sms = SmsMessage.newFromParcel(p);
@@ -2806,7 +2806,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return sms;
    }

    private Object
    protected Object
    responseString(Parcel p) {
        String response;

@@ -2815,7 +2815,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

    private Object
    protected Object
    responseStrings(Parcel p) {
        int num;
        String response[];
@@ -2834,7 +2834,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

    private Object
    protected Object
    responseRaw(Parcel p) {
        int num;
        byte response[];
@@ -2844,7 +2844,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

    private Object
    protected Object
    responseSMS(Parcel p) {
        int messageRef, errorCode;
        String ackPDU;
@@ -2859,7 +2859,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
    }


    private Object
    protected Object
     responseICC_IO(Parcel p) {
        int sw1, sw2;
        byte data[] = null;
@@ -2878,7 +2878,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return new IccIoResult(sw1, sw2, s);
    }

    private Object
    protected Object
    responseIccCardStatus(Parcel p) {
        IccCardApplication ca;

@@ -2910,7 +2910,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return status;
    }

    private Object
    protected Object
    responseCallList(Parcel p) {
        int num;
        int voiceSettings;
@@ -2975,7 +2975,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

    private Object
    protected Object
    responseDataCallList(Parcel p) {
        int num;
        ArrayList<DataCallState> response;
@@ -3002,7 +3002,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

    private Object
    protected Object
    responseNetworkInfos(Parcel p) {
        String strings[] = (String [])responseStrings(p);
        ArrayList<NetworkInfo> ret;
@@ -3027,7 +3027,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return ret;
    }

   private Object
   protected Object
   responseCellList(Parcel p) {
       int num, rssi;
       String location;
@@ -3069,7 +3069,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
       return response;
    }

    private Object responseGmsBroadcastConfig(Parcel p) {
    protected Object responseGmsBroadcastConfig(Parcel p) {
        int num;
        ArrayList<SmsBroadcastConfigInfo> response;
        SmsBroadcastConfigInfo info;
@@ -3091,7 +3091,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

    private Object
    protected Object
    responseCdmaBroadcastConfig(Parcel p) {
        int numServiceCategories;
        int response[];
@@ -3130,7 +3130,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

    private Object
    protected Object
    responseSignalStrength(Parcel p) {
        int numInts = 7;
        int response[];
@@ -3144,7 +3144,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

    private ArrayList<CdmaInformationRecords>
    protected ArrayList<CdmaInformationRecords>
    responseCdmaInformationRecord(Parcel p) {
        int numberOfInfoRecs;
        ArrayList<CdmaInformationRecords> response;
@@ -3164,7 +3164,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

    private Object
    protected Object
    responseCdmaCallWaiting(Parcel p) {
        CdmaCallWaitingNotification notification = new CdmaCallWaitingNotification();

@@ -3180,7 +3180,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return notification;
    }

    private Object
    protected Object
    responseCallRing(Parcel p){
        char response[] = new char[4];

@@ -3192,7 +3192,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

    private void
    protected void
    notifyRegistrantsCdmaInfoRec(CdmaInformationRecords infoRec) {
        int response = RIL_UNSOL_CDMA_INFO_REC;
        if (infoRec.record instanceof CdmaInformationRecords.CdmaDisplayInfoRec) {
@@ -3399,27 +3399,27 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    private void riljLog(String msg) {
    protected void riljLog(String msg) {
        Log.d(LOG_TAG, msg);
    }

    private void riljLogv(String msg) {
    protected void riljLogv(String msg) {
        Log.v(LOG_TAG, msg);
    }

    private void unsljLog(int response) {
    protected void unsljLog(int response) {
        riljLog("[UNSL]< " + responseToString(response));
    }

    private void unsljLogMore(int response, String more) {
    protected void unsljLogMore(int response, String more) {
        riljLog("[UNSL]< " + responseToString(response) + " " + more);
    }

    private void unsljLogRet(int response, Object ret) {
    protected void unsljLogRet(int response, Object ret) {
        riljLog("[UNSL]< " + responseToString(response) + " " + retToString(response, ret));
    }

    private void unsljLogvRet(int response, Object ret) {
    protected void unsljLogvRet(int response, Object ret) {
        riljLogv("[UNSL]< " + responseToString(response) + " " + retToString(response, ret));
    }

+766 −0

File added.

Preview size limit exceeded, changes collapsed.