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

Commit 7ad9060b authored by Hall Liu's avatar Hall Liu Committed by Gerrit Code Review
Browse files

Merge "Surface APIs to use WorkSource"

parents efe1bfee a761b1d4
Loading
Loading
Loading
Loading
+14 −6
Original line number Original line Diff line number Diff line
@@ -1895,8 +1895,9 @@ public interface CommandsInterface {
     *
     *
     * @param itemID the ID of the item to read
     * @param itemID the ID of the item to read
     * @param response callback message with the String response in the obj field
     * @param response callback message with the String response in the obj field
     * @param workSource calling WorkSource
     */
     */
    void nvReadItem(int itemID, Message response);
    default void nvReadItem(int itemID, Message response, WorkSource workSource) {}


    /**
    /**
     * Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
     * Write one of the NV items defined in {@link RadioNVItems} / {@code ril_nv_items.h}.
@@ -1905,8 +1906,10 @@ public interface CommandsInterface {
     * @param itemID the ID of the item to read
     * @param itemID the ID of the item to read
     * @param itemValue the value to write, as a String
     * @param itemValue the value to write, as a String
     * @param response Callback message.
     * @param response Callback message.
     * @param workSource calling WorkSource
     */
     */
    void nvWriteItem(int itemID, String itemValue, Message response);
    default void nvWriteItem(int itemID, String itemValue, Message response,
            WorkSource workSource) {}


    /**
    /**
     * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
     * Update the CDMA Preferred Roaming List (PRL) in the radio NV storage.
@@ -2059,23 +2062,27 @@ public interface CommandsInterface {
     * Get modem activity info and stats
     * Get modem activity info and stats
     *
     *
     * @param result Callback message contains the modem activity information
     * @param result Callback message contains the modem activity information
     * @param workSource calling WorkSource
     */
     */
    public void getModemActivityInfo(Message result);
    default void getModemActivityInfo(Message result, WorkSource workSource) {}


    /**
    /**
     * Set allowed carriers
     * Set allowed carriers
     *
     *
     * @param carriers Allowed carriers
     * @param carriers Allowed carriers
     * @param result Callback message contains the number of carriers set successfully
     * @param result Callback message contains the number of carriers set successfully
     * @param workSource calling WorkSource
     */
     */
    public void setAllowedCarriers(List<CarrierIdentifier> carriers, Message result);
    default void setAllowedCarriers(List<CarrierIdentifier> carriers, Message result,
            WorkSource workSource) {}


    /**
    /**
     * Get allowed carriers
     * Get allowed carriers
     *
     *
     * @param result Callback message contains the allowed carriers
     * @param result Callback message contains the allowed carriers
     * @param workSource calling WorkSource
     */
     */
    public void getAllowedCarriers(Message result);
    default void getAllowedCarriers(Message result, WorkSource workSource) {}


    /**
    /**
     * Register for unsolicited PCO data.  This information is carrier-specific,
     * Register for unsolicited PCO data.  This information is carrier-specific,
@@ -2167,8 +2174,9 @@ public interface CommandsInterface {
     * - {@link android.telephony.TelephonyManager#CARD_POWER_UP}
     * - {@link android.telephony.TelephonyManager#CARD_POWER_UP}
     * - {@link android.telephony.TelephonyManager#CARD_POWER_UP_PASS_THROUGH}
     * - {@link android.telephony.TelephonyManager#CARD_POWER_UP_PASS_THROUGH}
     * @param result callback message contains the information of SUCCESS/FAILURE
     * @param result callback message contains the information of SUCCESS/FAILURE
     * @param workSource calling WorkSource
     */
     */
    void setSimCardPower(int state, Message result);
    default void setSimCardPower(int state, Message result, WorkSource workSource) {}


    /**
    /**
     * Register for unsolicited Carrier Public Key.
     * Register for unsolicited Carrier Public Key.
+16 −12
Original line number Original line Diff line number Diff line
@@ -2102,9 +2102,10 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
     *
     *
     * @param itemID the ID of the item to read
     * @param itemID the ID of the item to read
     * @param response callback message with the String response in the obj field
     * @param response callback message with the String response in the obj field
     * @param workSource calling WorkSource
     */
     */
    public void nvReadItem(int itemID, Message response) {
    public void nvReadItem(int itemID, Message response, WorkSource workSource) {
        mCi.nvReadItem(itemID, response);
        mCi.nvReadItem(itemID, response, workSource);
    }
    }


    /**
    /**
@@ -2114,9 +2115,11 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
     * @param itemID the ID of the item to read
     * @param itemID the ID of the item to read
     * @param itemValue the value to write, as a String
     * @param itemValue the value to write, as a String
     * @param response Callback message.
     * @param response Callback message.
     * @param workSource calling WorkSource
     */
     */
    public void nvWriteItem(int itemID, String itemValue, Message response) {
    public void nvWriteItem(int itemID, String itemValue, Message response,
        mCi.nvWriteItem(itemID, itemValue, response);
            WorkSource workSource) {
        mCi.nvWriteItem(itemID, itemValue, response, workSource);
    }
    }


    /**
    /**
@@ -3481,8 +3484,8 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    /**
    /**
     * Returns the modem activity information
     * Returns the modem activity information
     */
     */
    public void getModemActivityInfo(Message response)  {
    public void getModemActivityInfo(Message response, WorkSource workSource)  {
        mCi.getModemActivityInfo(response);
        mCi.getModemActivityInfo(response, workSource);
    }
    }


    /**
    /**
@@ -3497,8 +3500,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    /**
    /**
     * Set allowed carriers
     * Set allowed carriers
     */
     */
    public void setAllowedCarriers(List<CarrierIdentifier> carriers, Message response) {
    public void setAllowedCarriers(List<CarrierIdentifier> carriers, Message response,
        mCi.setAllowedCarriers(carriers, response);
            WorkSource workSource) {
        mCi.setAllowedCarriers(carriers, response, workSource);
    }
    }


    /** Sets the SignalStrength reporting criteria. */
    /** Sets the SignalStrength reporting criteria. */
@@ -3514,8 +3518,8 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    /**
    /**
     * Get allowed carriers
     * Get allowed carriers
     */
     */
    public void getAllowedCarriers(Message response) {
    public void getAllowedCarriers(Message response, WorkSource workSource) {
        mCi.getAllowedCarriers(response);
        mCi.getAllowedCarriers(response, workSource);
    }
    }


    /**
    /**
@@ -3657,8 +3661,8 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
     * - {@link android.telephony.TelephonyManager#CARD_POWER_UP}
     * - {@link android.telephony.TelephonyManager#CARD_POWER_UP}
     * - {@link android.telephony.TelephonyManager#CARD_POWER_UP_PASS_THROUGH}
     * - {@link android.telephony.TelephonyManager#CARD_POWER_UP_PASS_THROUGH}
     **/
     **/
    public void setSimPowerState(int state) {
    public void setSimPowerState(int state, WorkSource workSource) {
        mCi.setSimCardPower(state, null);
        mCi.setSimCardPower(state, null, workSource);
    }
    }


    public void setRadioIndicationUpdateMode(int filters, int mode) {
    public void setRadioIndicationUpdateMode(int filters, int mode) {
+21 −12
Original line number Original line Diff line number Diff line
@@ -3242,11 +3242,12 @@ public class RIL extends BaseCommands implements CommandsInterface {
    }
    }


    @Override
    @Override
    public void nvReadItem(int itemID, Message result) {
    public void nvReadItem(int itemID, Message result, WorkSource workSource) {
        workSource = getDeafultWorkSourceIfInvalid(workSource);
        IRadio radioProxy = getRadioProxy(result);
        IRadio radioProxy = getRadioProxy(result);
        if (radioProxy != null) {
        if (radioProxy != null) {
            RILRequest rr = obtainRequest(RIL_REQUEST_NV_READ_ITEM, result,
            RILRequest rr = obtainRequest(RIL_REQUEST_NV_READ_ITEM, result,
                    mRILDefaultWorkSource);
                    workSource);


            if (RILJ_LOGD) {
            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
@@ -3262,11 +3263,12 @@ public class RIL extends BaseCommands implements CommandsInterface {
    }
    }


    @Override
    @Override
    public void nvWriteItem(int itemId, String itemValue, Message result) {
    public void nvWriteItem(int itemId, String itemValue, Message result, WorkSource workSource) {
        workSource = getDeafultWorkSourceIfInvalid(workSource);
        IRadio radioProxy = getRadioProxy(result);
        IRadio radioProxy = getRadioProxy(result);
        if (radioProxy != null) {
        if (radioProxy != null) {
            RILRequest rr = obtainRequest(RIL_REQUEST_NV_WRITE_ITEM, result,
            RILRequest rr = obtainRequest(RIL_REQUEST_NV_WRITE_ITEM, result,
                    mRILDefaultWorkSource);
                    workSource);


            if (RILJ_LOGD) {
            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
@@ -3601,11 +3603,12 @@ public class RIL extends BaseCommands implements CommandsInterface {
    }
    }


    @Override
    @Override
    public void getModemActivityInfo(Message result) {
    public void getModemActivityInfo(Message result, WorkSource workSource) {
        workSource = getDeafultWorkSourceIfInvalid(workSource);
        IRadio radioProxy = getRadioProxy(result);
        IRadio radioProxy = getRadioProxy(result);
        if (radioProxy != null) {
        if (radioProxy != null) {
            RILRequest rr = obtainRequest(RIL_REQUEST_GET_ACTIVITY_INFO, result,
            RILRequest rr = obtainRequest(RIL_REQUEST_GET_ACTIVITY_INFO, result,
                    mRILDefaultWorkSource);
                    workSource);


            if (RILJ_LOGD) {
            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
@@ -3627,12 +3630,15 @@ public class RIL extends BaseCommands implements CommandsInterface {
    }
    }


    @Override
    @Override
    public void setAllowedCarriers(List<CarrierIdentifier> carriers, Message result) {
    public void setAllowedCarriers(List<CarrierIdentifier> carriers, Message result,
            WorkSource workSource) {
        checkNotNull(carriers, "Allowed carriers list cannot be null.");
        checkNotNull(carriers, "Allowed carriers list cannot be null.");
        workSource = getDeafultWorkSourceIfInvalid(workSource);

        IRadio radioProxy = getRadioProxy(result);
        IRadio radioProxy = getRadioProxy(result);
        if (radioProxy != null) {
        if (radioProxy != null) {
            RILRequest rr = obtainRequest(RIL_REQUEST_SET_ALLOWED_CARRIERS, result,
            RILRequest rr = obtainRequest(RIL_REQUEST_SET_ALLOWED_CARRIERS, result,
                    mRILDefaultWorkSource);
                    workSource);


            if (RILJ_LOGD) {
            if (RILJ_LOGD) {
                String logStr = "";
                String logStr = "";
@@ -3686,11 +3692,13 @@ public class RIL extends BaseCommands implements CommandsInterface {
    }
    }


    @Override
    @Override
    public void getAllowedCarriers(Message result) {
    public void getAllowedCarriers(Message result, WorkSource workSource) {
        workSource = getDeafultWorkSourceIfInvalid(workSource);

        IRadio radioProxy = getRadioProxy(result);
        IRadio radioProxy = getRadioProxy(result);
        if (radioProxy != null) {
        if (radioProxy != null) {
            RILRequest rr = obtainRequest(RIL_REQUEST_GET_ALLOWED_CARRIERS, result,
            RILRequest rr = obtainRequest(RIL_REQUEST_GET_ALLOWED_CARRIERS, result,
                    mRILDefaultWorkSource);
                    workSource);


            if (RILJ_LOGD) {
            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
@@ -3835,11 +3843,12 @@ public class RIL extends BaseCommands implements CommandsInterface {
    }
    }


    @Override
    @Override
    public void setSimCardPower(int state, Message result) {
    public void setSimCardPower(int state, Message result, WorkSource workSource) {
        workSource = getDeafultWorkSourceIfInvalid(workSource);
        IRadio radioProxy = getRadioProxy(result);
        IRadio radioProxy = getRadioProxy(result);
        if (radioProxy != null) {
        if (radioProxy != null) {
            RILRequest rr = obtainRequest(RIL_REQUEST_SET_SIM_CARD_POWER, result,
            RILRequest rr = obtainRequest(RIL_REQUEST_SET_SIM_CARD_POWER, result,
                    mRILDefaultWorkSource);
                    workSource);


            if (RILJ_LOGD) {
            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + state);
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + state);
+0 −25
Original line number Original line Diff line number Diff line
@@ -21,7 +21,6 @@ import android.net.KeepalivePacketData;
import android.net.LinkProperties;
import android.net.LinkProperties;
import android.os.Handler;
import android.os.Handler;
import android.os.Message;
import android.os.Message;
import android.service.carrier.CarrierIdentifier;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.NetworkScanRequest;
import android.telephony.NetworkScanRequest;
import android.telephony.data.DataProfile;
import android.telephony.data.DataProfile;
@@ -33,8 +32,6 @@ import com.android.internal.telephony.UUSInfo;
import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;


import java.util.List;

/**
/**
 * Volte doesn't need CommandsInterface. The class does nothing but made to work
 * Volte doesn't need CommandsInterface. The class does nothing but made to work
 * with Phone's constructor.
 * with Phone's constructor.
@@ -588,12 +585,6 @@ class ImsPhoneCommandInterface extends BaseCommands implements CommandsInterface
    public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2,
    public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2,
                                            int p3, String data, Message response) {}
                                            int p3, String data, Message response) {}


    @Override
    public void nvReadItem(int itemID, Message response) {}

    @Override
    public void nvWriteItem(int itemID, String itemValue, Message response) {}

    @Override
    @Override
    public void nvWriteCdmaPrl(byte[] preferredRoamingList, Message response) {}
    public void nvWriteCdmaPrl(byte[] preferredRoamingList, Message response) {}


@@ -627,23 +618,11 @@ class ImsPhoneCommandInterface extends BaseCommands implements CommandsInterface
    public void pullLceData(Message result) {
    public void pullLceData(Message result) {
    }
    }


    @Override
    public void getModemActivityInfo(Message result) {
    }

    @Override
    @Override
    public void setCarrierInfoForImsiEncryption(ImsiEncryptionInfo imsiEncryptionInfo,
    public void setCarrierInfoForImsiEncryption(ImsiEncryptionInfo imsiEncryptionInfo,
                                                Message result) {
                                                Message result) {
    }
    }


    @Override
    public void setAllowedCarriers(List<CarrierIdentifier> carriers, Message result) {
    }

    @Override
    public void getAllowedCarriers(Message result) {
    }

    @Override
    @Override
    public void sendDeviceState(int stateType, boolean state, Message result) {
    public void sendDeviceState(int stateType, boolean state, Message result) {
    }
    }
@@ -663,10 +642,6 @@ class ImsPhoneCommandInterface extends BaseCommands implements CommandsInterface
            Message result) {
            Message result) {
    }
    }


    @Override
    public void setSimCardPower(int state, Message result) {
    }

    @Override
    @Override
    public void startNattKeepalive(
    public void startNattKeepalive(
            int contextId, KeepalivePacketData packetData, int intervalMillis, Message result) {
            int contextId, KeepalivePacketData packetData, int intervalMillis, Message result) {
+0 −27
Original line number Original line Diff line number Diff line
@@ -21,7 +21,6 @@ import android.net.KeepalivePacketData;
import android.net.LinkProperties;
import android.net.LinkProperties;
import android.os.Handler;
import android.os.Handler;
import android.os.Message;
import android.os.Message;
import android.service.carrier.CarrierIdentifier;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.NetworkScanRequest;
import android.telephony.NetworkScanRequest;
import android.telephony.data.DataProfile;
import android.telephony.data.DataProfile;
@@ -32,8 +31,6 @@ import com.android.internal.telephony.UUSInfo;
import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;


import java.util.List;

/**
/**
 * SIP doesn't need CommandsInterface. The class does nothing but made to work
 * SIP doesn't need CommandsInterface. The class does nothing but made to work
 * with Phone's constructor.
 * with Phone's constructor.
@@ -593,14 +590,6 @@ class SipCommandInterface extends BaseCommands implements CommandsInterface {
            int p3, String data, Message response) {
            int p3, String data, Message response) {
    }
    }


    @Override
    public void nvReadItem(int itemID, Message response) {
    }

    @Override
    public void nvWriteItem(int itemID, String itemValue, Message response) {
    }

    @Override
    @Override
    public void nvWriteCdmaPrl(byte[] preferredRoamingList, Message response) {
    public void nvWriteCdmaPrl(byte[] preferredRoamingList, Message response) {
    }
    }
@@ -629,23 +618,11 @@ class SipCommandInterface extends BaseCommands implements CommandsInterface {
    public void pullLceData(Message result) {
    public void pullLceData(Message result) {
    }
    }


    @Override
    public void getModemActivityInfo(Message result) {
    }

    @Override
    @Override
    public void setCarrierInfoForImsiEncryption(ImsiEncryptionInfo imsiEncryptionInfo,
    public void setCarrierInfoForImsiEncryption(ImsiEncryptionInfo imsiEncryptionInfo,
                                                Message result) {
                                                Message result) {
    }
    }


    @Override
    public void setAllowedCarriers(List<CarrierIdentifier> carriers, Message result) {
    }

    @Override
    public void getAllowedCarriers(Message result) {
    }

    @Override
    @Override
    public void sendDeviceState(int stateType, boolean state, Message result) {
    public void sendDeviceState(int stateType, boolean state, Message result) {
    }
    }
@@ -665,10 +642,6 @@ class SipCommandInterface extends BaseCommands implements CommandsInterface {
            Message result) {
            Message result) {
    }
    }


    @Override
    public void setSimCardPower(int state, Message result) {
    }

    @Override
    @Override
    public void startNattKeepalive(
    public void startNattKeepalive(
            int contextId, KeepalivePacketData packetData, int intervalMillis, Message result) {
            int contextId, KeepalivePacketData packetData, int intervalMillis, Message result) {
Loading