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

Commit faab9f9c authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Ricardo Cerqueira
Browse files

RIL: Make RIL subclassable

Change-Id: I9144ef279ca9c8cb9e657a28342f0f4cb3e7debd

Conflicts:
	src/java/com/android/internal/telephony/RIL.java
parent 8c4891c0
Loading
Loading
Loading
Loading
+43 −43
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ class RILRequest {
 *
 * {@hide}
 */
public final class RIL extends BaseCommands implements CommandsInterface {
public class RIL extends BaseCommands implements CommandsInterface {
    static final String RILJ_LOG_TAG = "RILJ";
    static final boolean RILJ_LOGD = true;
    static final boolean RILJ_LOGV = false; // STOPSHIP if true
@@ -2223,7 +2223,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    private void sendScreenState(boolean on) {
    protected void sendScreenState(boolean on) {
        RILRequest rr = RILRequest.obtain(RIL_REQUEST_SCREEN_STATE, null);
        rr.mParcel.writeInt(1);
        rr.mParcel.writeInt(on ? 1 : 0);
@@ -2242,7 +2242,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        updateScreenState();
   }

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

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

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

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

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

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

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

@@ -2348,7 +2348,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 mRequestList
     */
    private void clearRequestList(int error, boolean loggable) {
    protected void clearRequestList(int error, boolean loggable) {
        RILRequest rr;
        synchronized (mRequestList) {
            int count = mRequestList.size();
@@ -2372,7 +2372,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    private RILRequest findAndRemoveRequestFromList(int serial) {
    protected RILRequest findAndRemoveRequestFromList(int serial) {
        RILRequest rr = null;
        synchronized (mRequestList) {
            rr = mRequestList.get(serial);
@@ -2384,7 +2384,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return rr;
    }

    private RILRequest
    protected RILRequest
    processSolicited (Parcel p) {
        int serial, error;
        boolean found = false;
@@ -2695,7 +2695,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return s;
    }

    private void
    protected void
    processUnsolicited (Parcel p) {
        int response;
        Object ret;
@@ -3156,7 +3156,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
     *
     * @param rilVer is the version of the ril or -1 if disconnected.
     */
    private void notifyRegistrantsRilConnectionChanged(int rilVer) {
    protected void notifyRegistrantsRilConnectionChanged(int rilVer) {
        mRilVersion = rilVer;
        if (mRilConnectedRegistrants != null) {
            mRilConnectedRegistrants.notifyRegistrants(
@@ -3164,7 +3164,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        }
    }

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

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

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

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

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

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

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

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

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


    private Object
    protected Object
    responseICC_IO(Parcel p) {
        int sw1, sw2;
        Message ret;
@@ -3311,7 +3311,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return new IccIoResult(sw1, sw2, android.util.Base64.decode(s, android.util.Base64.DEFAULT));
    }

    private Object
    protected Object
    responseIccCardStatus(Parcel p) {
        IccCardApplicationStatus appStatus;

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

    private Object
    protected Object
    responseSimRefresh(Parcel p) {
        IccRefreshResponse response = new IccRefreshResponse();

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

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

    private DataCallResponse getDataCallResponse(Parcel p, int version) {
    protected DataCallResponse getDataCallResponse(Parcel p, int version) {
        DataCallResponse dataCall = new DataCallResponse();

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

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

@@ -3495,7 +3495,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();
@@ -3549,7 +3549,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;
@@ -3574,7 +3574,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return ret;
    }

    private Object
    protected Object
    responseCellList(Parcel p) {
       int num, rssi;
       String location;
@@ -3616,7 +3616,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) {
@@ -3628,7 +3628,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;
@@ -3650,7 +3650,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return response;
    }

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

    private Object
    protected Object
    responseSignalStrength(Parcel p) {
        // Assume this is gsm, but doesn't matter as ServiceStateTracker
        // sets the proper value.
@@ -3697,7 +3697,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        return signalStrength;
    }

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

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

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

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

@@ -3748,7 +3748,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) {
@@ -4049,29 +4049,29 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    private void riljLog(String msg) {
    protected void riljLog(String msg) {
        Rlog.d(RILJ_LOG_TAG, msg
                + (mInstanceId != null ? (" [SUB" + mInstanceId + "]") : ""));
    }

    private void riljLogv(String msg) {
    protected void riljLogv(String msg) {
        Rlog.v(RILJ_LOG_TAG, msg
                + (mInstanceId != null ? (" [SUB" + mInstanceId + "]") : ""));
    }

    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));
    }