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

Commit e14af0e2 authored by Wink Saville's avatar Wink Saville
Browse files

Add RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING & reportStkServiceIsRunning.

These are used to notify the vendor ril that the StkService is
running and ready to receive RIL_UNSOL_STK_XXX commands.
parent 1e3d1b4b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1157,6 +1157,14 @@ public interface CommandsInterface {
     */
    void reportSmsMemoryStatus(boolean available, Message result);

    /**
     * Indicates to the vendor ril that StkService is running
     * rand is eady to receive RIL_UNSOL_STK_XXXX commands.
     *
     * @param result callback message
     */
    void reportStkServiceIsRunning(Message result);

    void invokeOemRilRequestRaw(byte[] data, Message response);

    void invokeOemRilRequestStrings(String[] strings, Message response);
+12 −0
Original line number Diff line number Diff line
@@ -1829,6 +1829,17 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        send(rr);
    }

    /**
     * {@inheritDoc}
     */
    public void reportStkServiceIsRunning(Message result) {
        RILRequest rr = RILRequest.obtain(RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING, result);

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

        send(rr);
    }

    //***** Private Methods

    private void sendScreenState(boolean on) {
@@ -3121,6 +3132,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
            case RIL_REQUEST_SET_SMSC_ADDRESS: return "RIL_REQUEST_SET_SMSC_ADDRESS";
            case RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE: return "REQUEST_EXIT_EMERGENCY_CALLBACK_MODE";
            case RIL_REQUEST_REPORT_SMS_MEMORY_STATUS: return "RIL_REQUEST_REPORT_SMS_MEMORY_STATUS";
            case RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING: return "RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING";
            default: return "<unknown request>";
        }
    }
+1 −0
Original line number Diff line number Diff line
@@ -220,6 +220,7 @@ cat include/telephony/ril.h | \
    int RIL_REQUEST_GET_SMSC_ADDRESS = 100;
    int RIL_REQUEST_SET_SMSC_ADDRESS = 101;
    int RIL_REQUEST_REPORT_SMS_MEMORY_STATUS = 102;
    int RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING = 103;
    int RIL_UNSOL_RESPONSE_BASE = 1000;
    int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000;
    int RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED = 1001;
+3 −4
Original line number Diff line number Diff line
@@ -25,8 +25,6 @@ import android.os.Message;

import com.android.internal.telephony.IccUtils;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.EncodeException;
import com.android.internal.telephony.GsmAlphabet;
import com.android.internal.telephony.gsm.SimCard;
import com.android.internal.telephony.gsm.SIMFileHandler;
import com.android.internal.telephony.gsm.SIMRecords;
@@ -34,8 +32,6 @@ import com.android.internal.telephony.gsm.SIMRecords;
import android.util.Config;

import java.io.ByteArrayOutputStream;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * Enumeration for representing the tag value of COMPREHENSION-TLV objects. If
@@ -174,6 +170,9 @@ public class StkService extends Handler implements AppInterface {

        // Register for SIM ready event.
        mSimRecords.registerForRecordsLoaded(this, MSG_ID_SIM_LOADED, null);

        mCmdIf.reportStkServiceIsRunning(null);
        StkLog.d(this, "StkService: is running");
    }

    public void dispose() {
+4 −0
Original line number Diff line number Diff line
@@ -1022,6 +1022,10 @@ public final class SimulatedCommands extends BaseCommands
        unimplemented(result);
    }

    public void reportStkServiceIsRunning(Message result) {
        resultSuccess(result, null);
    }

    private boolean isSimLocked() {
        if (mSimLockedState != SimLockState.NONE) {
            return true;