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

Commit f1d359a9 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

RIL: Make RIL subclassable

parent 19b1c12b
Loading
Loading
Loading
Loading
+42 −42
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ class RILRequest {
 *
 * {@hide}
 */
public final class RIL extends BaseCommands implements CommandsInterface {
public class RIL extends BaseCommands implements CommandsInterface {
    static final String LOG_TAG = "RILJ";
    static final boolean RILJ_LOGD = true;
    static final boolean RILJ_LOGV = false; // STOP SHIP if true
@@ -1953,7 +1953,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {

    //***** Private Methods

    private void sendScreenState(boolean on) {
    protected void sendScreenState(boolean on) {
        RILRequest rr = RILRequest.obtain(RIL_REQUEST_SCREEN_STATE, null);
        rr.mp.writeInt(1);
        rr.mp.writeInt(on ? 1 : 0);
@@ -1974,7 +1974,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 */
@@ -1997,7 +1997,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return state;
    }

    private void switchToRadioState(RadioState newState) {
    protected void switchToRadioState(RadioState newState) {
        setRadioState(newState);
    }

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

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

@@ -2051,7 +2051,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        msg.sendToTarget();
    }

    private void
    protected void
    processResponse (Parcel p) {
        int type;

@@ -2071,7 +2071,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
     * @param error is the RIL_Errno sent back
     * @param loggable true means to print all requests in mRequestslist
     */
    private void clearRequestsList(int error, boolean loggable) {
    protected void clearRequestsList(int error, boolean loggable) {
        RILRequest rr;
        synchronized (mRequestsList) {
            int count = mRequestsList.size();
@@ -2095,7 +2095,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);
@@ -2112,7 +2112,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return null;
    }

    private void
    protected void
    processSolicited (Parcel p) {
        int serial, error;
        boolean found = false;
@@ -2281,7 +2281,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) {
@@ -2345,7 +2345,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return s;
    }

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

    private Object
    protected Object
    responseInts(Parcel p) {
        int numInts;
        int response[];
@@ -2767,12 +2767,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[];
@@ -2795,7 +2795,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return infos;
    }

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

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

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

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

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

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

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

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


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

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

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

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

    private DataCallState getDataCallState(Parcel p, int version) {
    protected DataCallState getDataCallState(Parcel p, int version) {
        DataCallState dataCall = new DataCallState();

        dataCall.version = version;
@@ -3024,7 +3024,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return dataCall;
    }

    private Object
    protected Object
    responseDataCallList(Parcel p) {
        ArrayList<DataCallState> response;

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

    private Object
    protected Object
    responseSetupDataCall(Parcel p) {
        int ver = p.readInt();
        int num = p.readInt();
@@ -3087,7 +3087,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return dataCall;
    }

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

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

    private Object responseGetPreferredNetworkType(Parcel p) {
    protected Object responseGetPreferredNetworkType(Parcel p) {
       int [] response = (int[]) responseInts(p);

       if (response.length >= 1) {
@@ -3166,7 +3166,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;
@@ -3188,7 +3188,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

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

    private Object
    protected Object
    responseSignalStrength(Parcel p) {
        int numInts = 12;
        int response[];
@@ -3241,7 +3241,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;
@@ -3261,7 +3261,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

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

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

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

@@ -3291,7 +3291,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) {
@@ -3504,27 +3504,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));
    }