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

Commit 93c4fc94 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Added the new RIL request to set SIM power state"

parents df54365c df97820b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2061,6 +2061,14 @@ public interface CommandsInterface {
     */
    public void unregisterForPcoData(Handler h);

    /**
     * Set SIM card power up or down
     *
     * @param powerUp True if powering up the sim card
     * @param result callback message contains the information of SUCCESS/FAILURE
     */
    public void setSimCardPower(boolean powerUp, Message result);

    default public List<ClientRequestStats> getClientRequestStats() {
        return null;
    }
+31 −14
Original line number Diff line number Diff line
@@ -16,41 +16,37 @@

package com.android.internal.telephony;

import static com.android.internal.telephony.RILConstants.*;
import static com.android.internal.util.Preconditions.checkNotNull;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.hardware.display.DisplayManager;
import android.hardware.radio.V1_0.CellInfoCdma;
import android.hardware.radio.V1_0.CellInfoGsm;
import android.hardware.radio.V1_0.CellInfoLte;
import android.hardware.radio.V1_0.CellInfoType;
import android.hardware.radio.V1_0.CellInfoWcdma;
import android.hardware.radio.V1_0.Carrier;
import android.hardware.radio.V1_0.CarrierRestrictions;
import android.hardware.radio.V1_0.CdmaBroadcastSmsConfigInfo;
import android.hardware.radio.V1_0.CdmaSmsAck;
import android.hardware.radio.V1_0.CdmaSmsMessage;
import android.hardware.radio.V1_0.CdmaSmsWriteArgs;
import android.hardware.radio.V1_0.DataProfileInfo;
import android.hardware.radio.V1_0.CellInfoCdma;
import android.hardware.radio.V1_0.CellInfoGsm;
import android.hardware.radio.V1_0.CellInfoLte;
import android.hardware.radio.V1_0.CellInfoType;
import android.hardware.radio.V1_0.CellInfoWcdma;
import android.hardware.radio.V1_0.Dial;
import android.hardware.radio.V1_0.HardwareConfigModem;
import android.hardware.radio.V1_0.GsmBroadcastSmsConfigInfo;
import android.hardware.radio.V1_0.GsmSmsMessage;
import android.hardware.radio.V1_0.HardwareConfigModem;
import android.hardware.radio.V1_0.IRadio;
import android.hardware.radio.V1_0.LceDataInfo;
import android.hardware.radio.V1_0.IccIo;
import android.hardware.radio.V1_0.ImsSmsMessage;
import android.hardware.radio.V1_0.LceDataInfo;
import android.hardware.radio.V1_0.NvWriteItem;
import android.hardware.radio.V1_0.RadioError;
import android.hardware.radio.V1_0.RadioIndicationType;
import android.hardware.radio.V1_0.RadioResponseInfo;
import android.hardware.radio.V1_0.RadioResponseType;
import android.hardware.radio.V1_0.SetupDataCallResult;
import android.hardware.radio.V1_0.SelectUiccSub;
import android.hardware.radio.V1_0.SetupDataCallResult;
import android.hardware.radio.V1_0.SimApdu;
import android.hardware.radio.V1_0.SmsWriteArgs;
import android.hardware.radio.V1_0.UusInfo;
@@ -95,8 +91,6 @@ import com.android.internal.telephony.dataconnection.DcFailCause;
import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
import com.android.internal.telephony.gsm.SuppServiceNotification;
import com.android.internal.telephony.metrics.TelephonyMetrics;

import com.android.internal.telephony.uicc.IccIoResult;
import com.android.internal.telephony.uicc.IccRefreshResponse;
import com.android.internal.telephony.uicc.IccUtils;

@@ -114,6 +108,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;

import static com.android.internal.telephony.RILConstants.*;

/**
 * {@hide}
 */
@@ -3904,6 +3900,25 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    @Override
    public void setSimCardPower(boolean powerUp, Message result) {
        IRadio radioProxy = getRadioProxy(result);
        if (radioProxy != null) {
            RILRequest rr = obtainRequest(RIL_REQUEST_SET_SIM_CARD_POWER, result,
                    mRILDefaultWorkSource);

            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
            }

            try {
                radioProxy.setSimCardPower(rr.mSerial, powerUp);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(rr, "setSimCardPower", e);
            }
        }
    }

    @Override
    public void getIMEI(Message result) {
        throw new RuntimeException("getIMEI not expected to be called");
@@ -5328,6 +5343,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                return "RIL_REQUEST_SET_ALLOWED_CARRIERS";
            case RIL_REQUEST_GET_ALLOWED_CARRIERS:
                return "RIL_REQUEST_GET_ALLOWED_CARRIERS";
            case RIL_REQUEST_SET_SIM_CARD_POWER:
                return "RIL_REQUEST_SET_SIM_CARD_POWER";
            case RIL_RESPONSE_ACKNOWLEDGEMENT:
                return "RIL_RESPONSE_ACKNOWLEDGEMENT";
            default: return "<unknown request>";
+7 −0
Original line number Diff line number Diff line
@@ -1186,6 +1186,13 @@ public class RadioResponse extends IRadioResponse.Stub {

    public void setIndicationFilterResponse(RadioResponseInfo responseInfo) {}

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
    public void setSimCardPowerResponse(RadioResponseInfo responseInfo) {
        responseVoid(responseInfo);
    }

    private void responseIccCardStatus(RadioResponseInfo responseInfo, CardStatus cardStatus) {
        RILRequest rr = mRil.processResponse(responseInfo);

+4 −0
Original line number Diff line number Diff line
@@ -623,4 +623,8 @@ class ImsPhoneCommandInterface extends BaseCommands implements CommandsInterface
    @Override
    public void getAllowedCarriers(Message result) {
    }

    @Override
    public void setSimCardPower(boolean powerUp, Message result) {
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -626,4 +626,7 @@ class SipCommandInterface extends BaseCommands implements CommandsInterface {
    public void getAllowedCarriers(Message result) {
    }

    @Override
    public void setSimCardPower(boolean powerUp, Message result) {
    }
}
Loading